[Bug 804088] New: clang 3.1 and clang 3.2 fail to link 32 bit executable under 64 bit opensuse
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c0 Summary: clang 3.1 and clang 3.2 fail to link 32 bit executable under 64 bit opensuse Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: x86-64 OS/Version: openSUSE 12.2 Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: tizbac2@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17 Trying to use -m32 switch on clang makes the linker use wrong libraries and then fail because they have wrong architecture tiziano@linux-953a:~> gcc -m32 test.c -o test32 tiziano@linux-953a:~> clang -m32 test.c -o test32 /usr/bin/ld: skipping incompatible /usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../libc.so when searching for -lc /usr/bin/ld: i386:x86-64 architecture of input file `/usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../crt1.o' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../crti.o' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../crtn.o' is incompatible with i386 output /usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../crti.o: file class ELFCLASS64 incompatible with ELFCLASS32 /usr/bin/ld: final link failed: File in wrong format clang: error: linker command failed with exit code 1 (use -v to see invocation) tiziano@linux-953a:~> Reproducible: Always Steps to Reproduce: 1. Write a simple hello world like C program 2. Save it to .c file 3. Try to compile it with clang -m32 Actual Results: Linker failure because of wrong libraries choosen Expected Results: Succesful linking -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c Xiaolong Li <xlli@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xlli@suse.com AssignedTo|bnc-team-screening@forge.pr |idonmez@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c1 --- Comment #1 from Ismail Donmez <idonmez@suse.com> 2013-04-24 09:08:30 UTC --- This is tracked at upstream: http://llvm.org/bugs/show_bug.cgi?id=12108 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c2 S J <stephan.jaensch@rantzau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stephan.jaensch@rantzau.de --- Comment #2 from S J <stephan.jaensch@rantzau.de> 2013-12-19 17:15:19 UTC --- While this might be upstream, it looks like a distribution-specific bug. openSUSE 13.1 is released and it's still not possible to compile 32 bit binaries with clang. Might I suggest someone from SUSE take a look at why this is the case? It works just fine on other distributions. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c3 --- Comment #3 from Markus Kolb <novell@tower-net.de> 2014-06-25 07:58:07 UTC --- Any news on this bug? Don't wait for upstream! There might be something wrong in the SUSE build area. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c4 --- Comment #4 from Markus Kolb <novell@tower-net.de> 2014-06-25 08:22:09 UTC --- I've found something... With clang++ you can set -target elf32-i386 Then it uses g++ (instead of ld directly) during linking and the paths looks like /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib/crt1.o instead of /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../crt1.o -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=804088 https://bugzilla.novell.com/show_bug.cgi?id=804088#c5 Ismail Donmez <idonmez@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |UPSTREAM --- Comment #5 from Ismail Donmez <idonmez@suse.com> 2014-08-30 21:08:19 UTC --- I looked into fixing this again and fixing this broke -m64 and the clang code handling this is a mess. Though a workaround is possible with openSUSE 13.2 (or Factory): (as root) cd /usr/lib64/gcc/x86_64-suse-linux/4.8/32 ln -s /usr/lib/crt1.o ln -s /usr/lib/crti.o ln -s /usr/lib/crtn.o -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com