Seems to mostly compile fine, but clang has a very odd issue when it comes to making (intermediate?) libraries: x86_64-pc-linux-gnux32-ranlib: /var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-x32/Release/lib/libclangASTMatchers.a: Memory exhausted I have 16 GB RAM, and plenty of swap (which I'd have noticed if it got used), so I guess this is a virtual memory issue? On the other hand, I've built LLVM 3.4 on the regular x86_32 ABI just fine...
Created attachment 374104 [details] emerge --info
Actually, clang is a separate ebuild, so I'm not clear on why the library name here has "clang" in it.
Maybe linked with #480378 And also http://llvm.org/bugs/show_bug.cgi?id=13666
what does file /usr/bin/clang say?
(In reply to Julian Ospald (hasufell) from comment #4) > what does > > file /usr/bin/clang > > say? $ file /usr/bin/clang /usr/bin/clang: ELF 32-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.4.0, stripped $ objdump -f /usr/bin/clang /usr/bin/clang: file format elf32-x86-64 architecture: i386:x64-32, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x005c8fd8 $ qfile -v file /usr/bin/clang sys-devel/clang-3.2 (/usr/bin/clang)
Unsurprisingly: /usr/bin/clang: cannot open `/usr/bin/clang' (No such file or directory) Can't get clang if LLVM won't build...?
Does it build for you with USE=-clang?
(In reply to Michał Górny from comment #7) > Does it build for you with USE=-clang? yes, sys-devel/llvm-3.4-r1 does
(In reply to Michał Górny from comment #7) > Does it build for you with USE=-clang? Yes
(In reply to Luke-Jr from comment #9) > (In reply to Michał Górny from comment #7) > > Does it build for you with USE=-clang? > > Yes As an interim measure, we can disable USE=clang on x32 then, and mask everything clang-related until upstream fixes the build issues.
Both llvm and clang finally build on x32 with upcoming 3.6 version :) (tested on a chroot with USE=clang and 3.6.0_rc3)
(In reply to Bernard Cafarelli from comment #11) > Both llvm and clang finally build on x32 with upcoming 3.6 version :) > (tested on a chroot with USE=clang and 3.6.0_rc3) How? emerge: there are no ebuilds to satisfy "=sys-devel/clang-3.6.0_rc3-r100". (dependency required by "sys-devel/llvm-3.6.0_rc3[clang]" [ebuild]) (dependency required by "=llvm-3.6.0_rc3" [argument])
Created attachment 397288 [details] llvm-3.6.0_rc3 build failure Aside from aforementioned lack of a clang 3.6.0 ebuild, the llvm one does not build on x32.
Seems that build failure is because llvm-3.6.0.src/projects/compiler-rt/make/platform/clang_linux.mk detects x86_64 via -m64 Adding a #include <features.h> to llvm-3.6.0.src/projects/compiler-rt/make/platform/clang_linux_test_input.c should I think fix that, but clang_linux.mk then needs to be extended to also support x32, which it presently does not. After those two things are fixed, we counter the "Cannot select" issue Steven reported on the upstream bug: https://llvm.org/bugs/show_bug.cgi?id=13666 fatal error: error in backend: Cannot select: 0x3120d00: ch = brind 0x3120d90:1, 0x3124420 [ORD=1] [ID=11] 0x3124420: i32 = add 0x3120d90, 0x3124d20 [ORD=1] [ID=10] 0x3120d90: i32,ch = load 0x3120eb0:1, 0x31240c0, 0x3120250<LD4[JumpTable]> [ORD=1] [ID=9] 0x31240c0: i32 = add 0x3120be0, 0x3124d20 [ORD=1] [ID=8] 0x3120be0: i32 = shl 0x3120eb0, 0x3124030 [ORD=1] [ID=7] 0x3120eb0: i32,ch = CopyFromReg 0x30f0198, 0x31206d0 [ORD=1] [ID=5] 0x31206d0: i32 = Register %vreg173 [ID=1] 0x3124030: i8 = Constant<2> [ID=4] 0x3124d20: i32 = X86ISD::WrapperRIP 0x3124810 [ID=6] 0x3124810: i32 = TargetJumpTable<0> [ID=3] 0x3120250: i32 = undef [ID=2] 0x3124d20: i32 = X86ISD::WrapperRIP 0x3124810 [ID=6] 0x3124810: i32 = TargetJumpTable<0> [ID=3] In function: _ZN11__sanitizer9VSNPrintfEPciPKcP13__va_list_tag clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 3.6.0 (tags/RELEASE_360/final) Target: x86_64-pc-linux-gnux32 Thread model: posix
FYI: llvm/clang-9999 does compile and work!
Good news! Does 3.7.0-r2 fail?
(In reply to Bernard Cafarelli from comment #16) > Good news! Does 3.7.0-r2 fail? Yes. I was able to hand-patch it to build successfully, but the result was still very unreliable.
OK we will wait for 3.8 to mark this one fixed then :)
llvm does *build* on 3.5, 3.7 and 3.8 (with -clang, at least), but whether it's performing correctly is debatable. At least it doesn't pass tests (about 170 failures, some segfaults) with FEATURES=test, even on 3.8.
Supposedly new versions build on x32.