forked from OSchip/llvm-project
[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__. llvm-svn: 360503
This commit is contained in:
parent
4bdb136b0f
commit
bbdc8593e1
|
|
@ -47,11 +47,11 @@ __attribute__((section(".init_array"),
|
||||||
used)) static void (*__init)(void) = __do_init;
|
used)) static void (*__init)(void) = __do_init;
|
||||||
#else // CRT_HAS_INITFINI_ARRAY
|
#else // CRT_HAS_INITFINI_ARRAY
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
asm(".pushsection .init,\"ax\",@progbits\n\t"
|
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
|
||||||
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
|
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
|
||||||
".popsection");
|
".popsection");
|
||||||
#elif defined(__arm__)
|
#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"
|
"bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
|
||||||
".popsection");
|
".popsection");
|
||||||
#endif // CRT_HAS_INITFINI_ARRAY
|
#endif // CRT_HAS_INITFINI_ARRAY
|
||||||
|
|
@ -86,11 +86,11 @@ __attribute__((section(".fini_array"),
|
||||||
used)) static void (*__fini)(void) = __do_fini;
|
used)) static void (*__fini)(void) = __do_fini;
|
||||||
#else // CRT_HAS_INITFINI_ARRAY
|
#else // CRT_HAS_INITFINI_ARRAY
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
asm(".pushsection .fini,\"ax\",@progbits\n\t"
|
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
|
||||||
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
|
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
|
||||||
".popsection");
|
".popsection");
|
||||||
#elif defined(__arm__)
|
#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"
|
"bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
|
||||||
".popsection");
|
".popsection");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue