[LLVMbugs] [Bug 1748] New: Unable to compile init/main.c from latest Linux kernel

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Oct 28 12:50:11 PDT 2007


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

           Summary: Unable to compile init/main.c from latest Linux kernel
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P2
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


I get a compile error when trying to use llvm-gcc to compile Linux 2.6.24-rc1.
llvm-gcc succesfully produces a bitcode, but it can't compile to native.
When I tell llvm-gcc to compile to bitcode only, and use llc, llc gives me same
error, hence I reported the bug against llc.

$ uname -a
Linux lightspeed2 2.6.23-rc8-hrt1-cfs-v22-g1bef7dc0-dirty #17 Sun Sep 30
18:49:34 EEST 2007 x86_64 GNU/Linux
$ CROSS_COMPILE=llvm- O=/home/edwin/builds/o make
...
CC      init/main.o
Invalid operand found in inline asm: '# __raw_save_flags
        pushfq ; popq ${0:q}'
  INLINEASM <es:# __raw_save_flags
        pushfq ; popq ${0:q}>, 36, %RSP, 1, %NOREG, 8
INLINEASM       <es:# __raw_save_flags
        pushfq ; popq ${0:q}>   36      %mreg(83)       1       %mreg(0)       
8
{standard input}: Assembler messages:
{standard input}:149: Error: junk at end of line, first unrecognized character
is `('
{standard input}:438: Error: invalid character '"' in operand 1
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2

Using "CROSS_COMPILE=llvm- O=/home/edwin/builds/o KBUILD_VERBOSE=1 make", I see
this command-line:
llvm-gcc -Wp,-MD,init/.main.o.d  -nostdinc -isystem
/home/edwin/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/include
-D__KERNEL__ -Iinclude  -include include/linux/autoconf.h  -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -O2  -march=k8 -m64 -mno-red-zone
-mcmodel=kernel -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables
-funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
-maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1
-fomit-frame-pointer -g  -fno-stack-protector -Wdeclaration-after-statement
-Wno-pointer-sign -O5      -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(main)"  -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o
init/.tmp_main.o init/main.c

I added -emit-llvm, and when running llc on the generated bitcode I get:
$ opt -verify init/.tmp_main.o >/dev/null
$ llc -f init/.tmp_main.o
Invalid operand found in inline asm: '# __raw_save_flags
        pushfq ; popq ${0:q}'
  INLINEASM <es:# __raw_save_flags
        pushfq ; popq ${0:q}>, 36, %RSP, 1, %NOREG, 8
INLINEASM       <es:# __raw_save_flags
        pushfq ; popq ${0:q}>   36      %mreg(83)       1       %mreg(0)       
8

Attaching the generated bitcode...


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



More information about the llvm-bugs mailing list