[LLVMbugs] [Bug 6364] New: gcc option -fno-toplevel-reorder separates top level inline asm which affects eglibc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 21 09:20:07 PST 2010


http://www.llvm.org/bugs/show_bug.cgi?id=6364

           Summary: gcc option -fno-toplevel-reorder separates top level
                    inline asm which affects eglibc
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sergey.yakoushkin at gmail.com
                CC: llvmbugs at cs.uiuc.edu
   Estimated Hours: 0.0


Created an attachment (id=4261)
 --> (http://www.llvm.org/bugs/attachment.cgi?id=4261)
source used to create crt code in eglibc

-fno-toplevel-reorder option is used with by eglibc library (libc/csu) to
generate init/fini code for ctr*.

> llvm-gcc initfini.c -c -std=gnu99 -fgnu89-inline -O0 -Wall -Winline -Wwrite-strings -fmerge-all-constants -Wstrict-prototypes -mpreferred-stack-boundary=4 -DHAVE_INITFINI -S -g0 -fPIC -fno-inline-functions -fno-toplevel-reorder -fno-section-anchors -finhibit-size-directive -fno-exceptions -o initfini.s

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*/");

-- 
Configure bugmail: http://www.llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching all bug changes.



More information about the llvm-bugs mailing list