-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc option -fno-toplevel-reorder separates top level inline asm which affects eglibc #6736
Comments
We do not support this flag, and I really doubt this will happen one day. |
Right, this flag is deprecated by GCC and we have no intention of implementing it. The code should be fixed to not depend on it. |
Are there existing patches for glibc/eglibc for llvm? BTW. Are there any technical issues to support option?
|
I don't know if there are patches, there are many technical reasons to not support this. We don't track the order of inline asm vs functions. Adding it would be significant implementation effort for an option that is deprecated (and never really made sense). |
Thanks for your answer, Chris. Ok, option support seems to be unlikely. |
I don't really know, but you can definitely email llvmdev and ask if others have any idea |
Wouldn't simple saving of initial lexical order in parser be enough to reorder inlined top level asm to output correctly? I've contacted eglibc maintainers and got the following answer. Seems they expect this option to be supported by compilers: 2010/2/22 Joseph S. Myers joseph@codesourcery.com:
|
*** Bug llvm/llvm-bugzilla-archive#27688 has been marked as a duplicate of this bug. *** |
Host: introduce `GetSDKPath` extension point for Windows
Extended Description
-fno-toplevel-reorder option is used with by eglibc library (libc/csu) to generate init/fini code for ctr*.
C source file comes with inlined asm having special markup. C is compiled into asm and then gawk is used to strip different parts for different crt* files.
However, llvm outputs all top level inlined asm separately in AsmPrinter::doInitialization, and after it outputs all functions. Which results in eglibc fail to build with llvm.
initfini.c fragment:
asm (".section " ".init" );
extern void attribute ((section (".init"))) _init (void);
void
_init (void)
{
call_gmon_start ();
asm ("ALIGN");
asm("END_INIT");
asm ("\n/@_init_PROLOG_ENDS/");
asm ("\n/@_init_EPILOG_BEGINS/");
asm (".section " ".init" );
}
asm ("END_INIT");
asm ("\n/@_init_EPILOG_ENDS/");
asm ("\n/@_fini_PROLOG_BEGINS/");
The text was updated successfully, but these errors were encountered: