Hi, I'm trying to compile UML with LLVM. However, LLVM-LD hangs whiile linking modules. It's consuming 99% of the CPU llvm-ld -v -r -o kernel/built-in.o kernel/sched.o kernel/fork.o kernel/exec_domain.o kernel/panic.o kernel/printk.o kernel/profile.o kernel/exit.o kernel/itimer.o kernel/time.o kernel/softirq.o kernel/resource.o kernel/sysctl.o kernel/capability.o kernel/ptrace.o kernel/timer.o kernel/user.o kernel/user_namespace.o kernel/signal.o kernel/sys.o kernel/kmod.o kernel/workqueue.o kernel/pid.o kernel/rcupdate.o kernel/extable.o kernel/params.o kernel/posix-timers.o kernel/kthread.o kernel/wait.o kernel/kfifo.o kernel/sys_ni.o kernel/posix-cpu-timers.o kernel/mutex.o kernel/hrtimer.o kernel/rwsem.o kernel/latency.o kernel/nsproxy.o kernel/srcu.o kernel/die_notifier.o kernel/utsname.o kernel/time/built-in.o kernel/futex.o kernel/rtmutex.o kernel/uid16.o kernel/kallsyms.o kernel/acct.o kernel/configs.o kernel/ksysfs.o kernel/softlockup.o kernel/irq/built-in.o kernel/utsname_sysctl.o Linking bitcode file 'kernel/sched.o' Linked in file 'kernel/sched.o' Linking bitcode file 'kernel/fork.o' Linked in file 'kernel/fork.o' Linking bitcode file 'kernel/exec_domain.o' Linked in file 'kernel/exec_domain.o' Linking bitcode file 'kernel/panic.o' Linked in file 'kernel/panic.o' Linking bitcode file 'kernel/printk.o' Linked in file 'kernel/printk.o' Linking bitcode file 'kernel/profile.o' Linked in file 'kernel/profile.o' Linking bitcode file 'kernel/exit.o' Using GDB I could figure out that it is causing stack overflow (some loop in the code between 0x495be5 and 0x495da7) .... #47 0x0000000000495be5 in ?? () #48 0x0000000000495da7 in ?? () #49 0x0000000000495a24 in ?? () #50 0x0000000000495da7 in ?? () #51 0x0000000000495be5 in ?? () #52 0x0000000000495da7 in ?? () #53 0x0000000000495be5 in ?? () #54 0x0000000000495da7 in ?? () #55 0x0000000000495be5 in ?? () #56 0x0000000000495da7 in ?? () #57 0x0000000000495be5 in ?? () #58 0x0000000000495da7 in ?? () #59 0x0000000000495be5 in ?? () #60 0x0000000000495da7 in ?? () #61 0x0000000000495be5 in ?? () #62 0x0000000000495da7 in ?? () #63 0x0000000000495be5 in ?? () #64 0x000000000049609a in ?? () #65 0x000000000049ab6f in llvm::Linker::LinkModules () #66 0x0000000000491643 in llvm::Linker::LinkInFile () #67 0x0000000000491e57 in llvm::Linker::LinkInFiles () #68 0x00000000004727df in main () any ideas what could be wrong here? thanks.
Forgot to mention that I'm trying to generate LLVM IR. I've also faced this problem while compiling linux kernel with LLVM to generate LLVM IR. On Sun, Sep 28, 2008 at 6:06 PM, Ashish Bijlani <ashish.bijlani at gmail.com> wrote:> Hi, > > I'm trying to compile UML with LLVM. However, LLVM-LD hangs whiile > linking modules. It's consuming 99% of the CPU > > llvm-ld -v -r -o kernel/built-in.o kernel/sched.o kernel/fork.o > kernel/exec_domain.o kernel/panic.o kernel/printk.o kernel/profile.o > kernel/exit.o kernel/itimer.o kernel/time.o kernel/softirq.o > kernel/resource.o kernel/sysctl.o kernel/capability.o kernel/ptrace.o > kernel/timer.o kernel/user.o kernel/user_namespace.o kernel/signal.o > kernel/sys.o kernel/kmod.o kernel/workqueue.o kernel/pid.o > kernel/rcupdate.o kernel/extable.o kernel/params.o > kernel/posix-timers.o kernel/kthread.o kernel/wait.o kernel/kfifo.o > kernel/sys_ni.o kernel/posix-cpu-timers.o kernel/mutex.o > kernel/hrtimer.o kernel/rwsem.o kernel/latency.o kernel/nsproxy.o > kernel/srcu.o kernel/die_notifier.o kernel/utsname.o > kernel/time/built-in.o kernel/futex.o kernel/rtmutex.o kernel/uid16.o > kernel/kallsyms.o kernel/acct.o kernel/configs.o kernel/ksysfs.o > kernel/softlockup.o kernel/irq/built-in.o kernel/utsname_sysctl.o > Linking bitcode file 'kernel/sched.o' > Linked in file 'kernel/sched.o' > Linking bitcode file 'kernel/fork.o' > Linked in file 'kernel/fork.o' > Linking bitcode file 'kernel/exec_domain.o' > Linked in file 'kernel/exec_domain.o' > Linking bitcode file 'kernel/panic.o' > Linked in file 'kernel/panic.o' > Linking bitcode file 'kernel/printk.o' > Linked in file 'kernel/printk.o' > Linking bitcode file 'kernel/profile.o' > Linked in file 'kernel/profile.o' > Linking bitcode file 'kernel/exit.o' > > Using GDB I could figure out that it is causing stack overflow (some > loop in the code between 0x495be5 and 0x495da7) > > .... > #47 0x0000000000495be5 in ?? () > #48 0x0000000000495da7 in ?? () > #49 0x0000000000495a24 in ?? () > #50 0x0000000000495da7 in ?? () > #51 0x0000000000495be5 in ?? () > #52 0x0000000000495da7 in ?? () > #53 0x0000000000495be5 in ?? () > #54 0x0000000000495da7 in ?? () > #55 0x0000000000495be5 in ?? () > #56 0x0000000000495da7 in ?? () > #57 0x0000000000495be5 in ?? () > #58 0x0000000000495da7 in ?? () > #59 0x0000000000495be5 in ?? () > #60 0x0000000000495da7 in ?? () > #61 0x0000000000495be5 in ?? () > #62 0x0000000000495da7 in ?? () > #63 0x0000000000495be5 in ?? () > #64 0x000000000049609a in ?? () > #65 0x000000000049ab6f in llvm::Linker::LinkModules () > #66 0x0000000000491643 in llvm::Linker::LinkInFile () > #67 0x0000000000491e57 in llvm::Linker::LinkInFiles () > #68 0x00000000004727df in main () > > any ideas what could be wrong here? thanks. >
On Sep 28, 2008, at 3:08 PM, Ashish Bijlani wrote:> Forgot to mention that I'm trying to generate LLVM IR. I've also faced > this problem while compiling linux kernel with LLVM to generate LLVM > IR.Please file a bug with the two .o files that cause the problem when linked. The bug report should look like: "This causes llvm-ld to hang: llvm-ld a.o b.o" and include a.o and b.o as attachments. -Chris
On Sun, Sep 28, 2008 at 5:06 PM, Ashish Bijlani <ashish.bijlani at gmail.com> wrote:> Hi, > > I'm trying to compile UML with LLVM. However, LLVM-LD hangs whiile > linking modules. It's consuming 99% of the CPU > llvm-ld -v -r -o kernel/built-in.o kernel/sched.o kernel/fork.oAre you using trunk or the last release? That directory was the cause of this bug, which is fixed in head: http://llvm.org/bugs/show_bug.cgi?id=1860 This bug may also be of interest since it came from compiling that directory too, but possibly should now be marked worksforme now: http://llvm.org/bugs/show_bug.cgi?id=2124 Andrew