Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579668 - dev-lang/rust-1.7.0-r100: undefined reference to `llvm::Triple::normalize(llvm::StringRef)'
Summary: dev-lang/rust-1.7.0-r100: undefined reference to `llvm::Triple::normalize(llv...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-11 21:54 UTC by Jeff Kowalczyk
Modified: 2016-06-10 20:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,6.19 KB, text/plain)
2016-04-11 21:54 UTC, Jeff Kowalczyk
Details
build.log (build.log,249.49 KB, text/plain)
2016-04-11 21:57 UTC, Jeff Kowalczyk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Kowalczyk 2016-04-11 21:54:11 UTC
Created attachment 430192 [details]
emerge --info

When emerging dev-lang/rust-1.7.0-r100::rust and USE=system-llvm where system is ~x64 and installed llvm is sys-devel/llvm-3.7.1-r1, a linker error results:

note: /var/tmp/portage/dev-lang/rust-1.7.0-r100/work/rustc-1.7.0/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm-6a154fe0.so: undefined reference to `llvm::Triple::normalize(llvm::StringRef)'
collect2: error: ld returned 1 exit status

error: aborting due to previous error
/var/tmp/portage/dev-lang/rust-1.7.0-r100/work/rustc-1.7.0/mk/target.mk:202: recipe for target 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc' failed
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustc] Error 101
 * ERROR: dev-lang/rust-1.7.0-r100::gentoo failed (compile phase):

Also: what does the -r100 designation signify?
Comment 1 Jeff Kowalczyk 2016-04-11 21:57:37 UTC
Created attachment 430194 [details]
build.log
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2016-04-12 14:23:20 UTC
(In reply to Jeff Kowalczyk from comment #0)
> Created attachment 430192 [details]
> emerge --info
> 
> When emerging dev-lang/rust-1.7.0-r100::rust and USE=system-llvm where
> system is ~x64 and installed llvm is sys-devel/llvm-3.7.1-r1, a linker error
> results:

Did you use the one from the tree or rust overlay?

> 
> note:
> /var/tmp/portage/dev-lang/rust-1.7.0-r100/work/rustc-1.7.0/x86_64-unknown-
> linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm-
> 6a154fe0.so: undefined reference to
> `llvm::Triple::normalize(llvm::StringRef)'
> collect2: error: ld returned 1 exit status

So does this happen if you don't use USE=clang? I have not tried USE=clang yet.

> 
> error: aborting due to previous error
> /var/tmp/portage/dev-lang/rust-1.7.0-r100/work/rustc-1.7.0/mk/target.mk:202:
> recipe for target
> 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/
> rustc' failed
> make: ***
> [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin/
> rustc] Error 101
>  * ERROR: dev-lang/rust-1.7.0-r100::gentoo failed (compile phase):
> 
> Also: what does the -r100 designation signify?

Its just because the EAPI spec does not let us handle the LLVM depends appropriately because its not a RDEPEND for LLVM 3.6 and lower while it is a RDEPEND with LLVM 3.7 and newer.
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2016-04-12 15:47:24 UTC
What USE flags do you have for your LLVM build?
Comment 4 Jeff Kowalczyk 2016-04-12 15:50:28 UTC
llvm and clang USE vars on affected system:

[ebuild   R    ] sys-devel/llvm-3.7.1-r1:0/3.7.1::gentoo  USE="clang libffi multitarget ncurses python static-analyzer xml -debug -doc -gold -libedit -lldb -ocaml {-test}" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7" VIDEO_CARDS="-radeon" 0 KiB
[ebuild   R    ] sys-devel/clang-3.7.1-r100:0/3.7::gentoo  USE="python static-analyzer -debug -multitarget" ABI_X86="(64) -32 (-x32)" 0 KiB
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2016-04-15 14:01:40 UTC
Have you tested with without USE=clang on Rust? Have you tested 1.8.0?
Comment 6 Jeff Kowalczyk 2016-04-15 17:24:50 UTC
Confirming can emerge dev-lang/rust-1.7.0-r100:stable/1.7::gentoo with -clang on the affected system.

% sudo emerge \=dev-lang/rust-1.7.0-r100:stable/1.7::gentoo -pv
[ebuild  N     ] dev-lang/rust-1.7.0-r100:stable/1.7::gentoo  USE="system-llvm -clang -debug -doc -libcxx" 0 KiB

Compile time is about half what it was with +clang, FWIW.
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2016-04-15 18:00:18 UTC
Well I can get a very similar failure with USE=clang on dev-lang/rust. Please test without USE=clang confirm that fixes the issue and I'll USE mask USE=clang for brokenness.
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2016-04-15 18:01:14 UTC
I didn't refresh the page since my last comment so I missed your comment. I'll USE mask clang and report the issue upstream.
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2016-04-15 19:50:53 UTC
Actually. Give 1.8.0 a whirl.

[ebuild   R   ~] sys-devel/llvm-3.7.1-r1:0/3.7.1::gentoo  USE="clang libffi multitarget ncurses static-analyzer -debug -doc -gold -libedit -lldb -ocaml -python {-test} -xml" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7" VIDEO_CARDS="radeon" 0 KiB
[ebuild   R   ~] sys-devel/clang-3.7.1-r100:0/3.7::gentoo  USE="static-analyzer -debug -multitarget -python" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild   R   ~] dev-lang/rust-1.8.0-r100:stable/1.8::gentoo  USE="clang system-llvm -debug -doc -libcxx" 0 KiB
Comment 10 Hector Martin 2016-06-10 20:07:20 UTC
rust-1.8.0-r100[clang] fails with the same error when built against llvm-3.8.0-r2:

note: /var/tmp/portage/dev-lang/rust-1.8.0-r100/work/rustc-1.8.0/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm-4fda350b.so: undefined reference to `llvm::Triple::normalize(llvm::StringRef)'

# emerge -pv rust llvm clang
[ebuild   R    ] sys-devel/llvm-3.8.0-r2:0/3.8.0::gentoo  USE="clang libffi multitarget ncurses python static-analyzer xml -debug -doc -gold -libedit -lldb -ocaml {-test}" ABI_X86="32 (64) (-x32)" PYTHON_TARGETS="python2_7" VIDEO_CARDS="-radeon" 0 KiB
[ebuild   R    ] sys-devel/clang-3.8.0-r100:0/3.8::gentoo  USE="python static-analyzer -debug -multitarget" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild   R    ] dev-lang/rust-1.8.0-r100:stable/1.8::gentoo  USE="clang system-llvm -debug -doc -libcxx" 0 KiB

Building rust with USE="-clang" works (or at least seems to get farther - it's not done yet, but got past the first two stages).