Last active
August 29, 2015 14:01
-
-
Save jroelofs/e0562ebf40d83ab6dd5e to your computer and use it in GitHub Desktop.
-fintegrated-as vs -fno-integrated-as bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[15:00:32] ✘ jroelofs@build1-lucid-cs arm-none-eabi-lite$ cat foobar.c | |
#if defined(MACRO_OUTSIDE) | |
asm( | |
".macro RETURN cond=\n\t" | |
"bx\\cond lr\n\t" | |
".endm\n\t" | |
); | |
#endif | |
char* __attribute__((naked)) | |
foo(char* bar) | |
{ | |
asm ( | |
#if !defined(MACRO_OUTSIDE) | |
".macro RETURN cond=\n\t" | |
"bx\\cond lr\n\t" | |
".endm\n\t" | |
#endif | |
"RETURN\n" | |
); | |
} | |
[15:00:37] ✔ jroelofs@build1-lucid-cs arm-none-eabi-lite$ install/opt/codesourcery/bin/clang -target arm-none-eabi -march=armv7 -g -O2 -c foobar.c -fintegrated-as | |
[15:00:57] ✔ jroelofs@build1-lucid-cs arm-none-eabi-lite$ install/opt/codesourcery/bin/clang -target arm-none-eabi -march=armv7 -g -O2 -c foobar.c -fno-integrated-as | |
[15:01:15] ✔ jroelofs@build1-lucid-cs arm-none-eabi-lite$ install/opt/codesourcery/bin/clang -target arm-none-eabi -march=armv7 -g -O2 -c foobar.c -fno-integrated-as -DMACRO_OUTSIDE | |
[15:01:24] ✔ jroelofs@build1-lucid-cs arm-none-eabi-lite$ install/opt/codesourcery/bin/clang -target arm-none-eabi -march=armv7 -g -O2 -c foobar.c -fintegrated-as -DMACRO_OUTSIDE | |
foobar.c:18:5: error: invalid instruction | |
"RETURN\n" | |
^ | |
<inline asm>:1:2: note: instantiated into assembly here | |
RETURN | |
^~~~~~ | |
1 error generated. | |
[15:01:37] ✘ jroelofs@build1-lucid-cs arm-none-eabi-lite$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment