[compiler-rt] r360503 - [compiler-rt] Fix crtbegin.c compilation
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 19:33:34 PDT 2019
Author: smeenai
Date: Fri May 10 19:33:33 2019
New Revision: 360503
URL: http://llvm.org/viewvc/llvm-project?rev=360503&view=rev
Log:
[compiler-rt] Fix crtbegin.c compilation
We're building with -std=c11 now (as opposed to -std=gnu11), so we can't
use GNU extensions and need to spell inline assembly as __asm__.
Modified:
compiler-rt/trunk/lib/crt/crtbegin.c
Modified: compiler-rt/trunk/lib/crt/crtbegin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/crt/crtbegin.c?rev=360503&r1=360502&r2=360503&view=diff
==============================================================================
--- compiler-rt/trunk/lib/crt/crtbegin.c (original)
+++ compiler-rt/trunk/lib/crt/crtbegin.c Fri May 10 19:33:33 2019
@@ -47,11 +47,11 @@ __attribute__((section(".init_array"),
used)) static void (*__init)(void) = __do_init;
#else // CRT_HAS_INITFINI_ARRAY
#if defined(__i386__) || defined(__x86_64__)
-asm(".pushsection .init,\"ax\", at progbits\n\t"
+__asm__(".pushsection .init,\"ax\", at progbits\n\t"
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
".popsection");
#elif defined(__arm__)
-asm(".pushsection .init,\"ax\",%progbits\n\t"
+__asm__(".pushsection .init,\"ax\",%progbits\n\t"
"bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
".popsection");
#endif // CRT_HAS_INITFINI_ARRAY
@@ -86,11 +86,11 @@ __attribute__((section(".fini_array"),
used)) static void (*__fini)(void) = __do_fini;
#else // CRT_HAS_INITFINI_ARRAY
#if defined(__i386__) || defined(__x86_64__)
-asm(".pushsection .fini,\"ax\", at progbits\n\t"
+__asm__(".pushsection .fini,\"ax\", at progbits\n\t"
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
".popsection");
#elif defined(__arm__)
-asm(".pushsection .fini,\"ax\",%progbits\n\t"
+__asm__(".pushsection .fini,\"ax\",%progbits\n\t"
"bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
".popsection");
#endif
More information about the llvm-commits
mailing list