Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 578304 - sys-devel/llvm-3.7.1: llvm-config provides incorrect information for dynamic linking
Summary: sys-devel/llvm-3.7.1: llvm-config provides incorrect information for dynamic ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL: http://reviews.llvm.org/D11835
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-26 14:58 UTC by William Hubbs
Modified: 2016-03-28 16:53 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,229.92 KB, text/plain)
2016-03-27 03:00 UTC, William Hubbs
Details
llvmdeps.rs (llvmdeps.rs,3.56 KB, text/plain)
2016-03-27 03:46 UTC, William Hubbs
Details
build.log.bz2 (build.log.bz2,36.51 KB, text/plain)
2016-03-28 02:25 UTC, William Hubbs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Hubbs gentoo-dev 2016-03-26 14:58:16 UTC
This is fixed upstream with the following llvm revisions:

252532
260343

I understand that these won't apply to our code because of the
gentoo-specific llvm-config patch we have. I recommend dropping that patch,
applying these in 3.7.1-r1 and testing to see if that takes care of all of our
issues that prompted the gentoo-specific llvm-config patch.

Thanks,

William
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2016-03-26 18:53:25 UTC
upstreams llvm-config is broken in the 3.7.x series when LLVM is compiled with cmake and -DBUILD_SHARED_LIBS=ON is set. This is how Gentoo currently builds ~sys-devel/llvm-3.7.0 and sys-devel/llvm-3.7.1. For more information about the upstream issues see:

http://reviews.llvm.org/D11835
http://reviews.llvm.org/D13198

The result that was merged upstream was:
r252532
r260343

which need to be backported to 3.7.x. The fix is present in LLVM 3.8.0.
Comment 2 William Hubbs gentoo-dev 2016-03-27 03:00:11 UTC
Created attachment 429090 [details]
build.log

This is a build log showing rust-1.7 failing when built with llvm-3.7.1.
Comment 3 William Hubbs gentoo-dev 2016-03-27 03:46:02 UTC
Created attachment 429092 [details]
llvmdeps.rs

I am attaching this file per Cardoe's request.
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2016-03-27 19:47:03 UTC
Prior to 3.7.0, these libraries were always only available for static linking. llvm-config was taught in the two revisions I requested be applied to 3.7.x to return info if it was built as a shared library.

$ llvm-config --shared-mode
shared

Which then causes consumers to link to LLVM as a shared library. Without that option downstream packages will assume that they should link to LLVM as a static library because the other distros that ship LLVM 3.7 still provide it with static libraries or they've backported --shared-mode.

http://packages.ubuntu.com/xenial/amd64/llvm-3.7-dev/filelist
https://www.archlinux.org/packages/extra/x86_64/llvm/
http://pkgs.fedoraproject.org/cgit/rpms/llvm.git/tree/llvm.spec?h=f23
Comment 5 William Hubbs gentoo-dev 2016-03-28 02:25:51 UTC
Created attachment 429124 [details]
build.log.bz2

I just tested 3.7.1-r1 from the llvm-config-hacking branch. 
It fails compilation as shown in this build log.

I noticed this comment in the ebuild:

    # Fix llvm-config for shared linking, sane flags and return values
	    # combination of backported upstream r252532 with our patch
		    # https://bugs.gentoo.org/show_bug.cgi?id=565358

			This probably fails because we still need R260343 backported
			from upstream (see comment #1).

			Once both upstream revisions are backported, we should
			re-evaluate our Gentoo specific patch and re-evaluate why we
			have gentoo-specific patches at all in llvm.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-03-28 16:53:42 UTC
Fixed in 3.7.1-r1. Rust seems to build for me.