Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409267 - sys-devel/llvm-3.0-r1: libLLVM-3.0.so has no soname
Summary: sys-devel/llvm-3.0-r1: libLLVM-3.0.so has no soname
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL: http://svnweb.mageia.org/packages/cau...
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2012-03-22 05:32 UTC by Richard Yao (RETIRED)
Modified: 2012-03-27 08:07 UTC (History)
2 users (show)

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


Attachments
Sets soname for Linux FreeBSD OpenBSD (llvm-3.0-soname.patch,522 bytes, patch)
2012-03-26 16:16 UTC, Bernard Cafarelli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-03-22 05:32:58 UTC
After sys-devel/llvm-9999 had emerged, clang was broken because preserved-libs did not protect libLLVM-3.0.so. If clang were the system compiler, this would prevent upgrades.

# lddtree `which clang`
clang => /usr/bin/clang (interpreter => /libexec/ld-elf.so.1)
    libLLVM-3.0.so => not found
    libthr.so.3 => /lib/libthr.so.3
    libstdc++.so.6 => /usr/lib/gcc/i686-gentoo-freebsd9.0/4.6.2/libstdc++.so.6
        libm.so.5 => /lib/libm.so.5
    libgcc_s.so.1 => /lib/libgcc_s.so.1
    libc.so.7 => /lib/libc.so.7

# emerge --info clang
Portage 2.2.0_alpha93 (default/bsd/fbsd/x86/9.0, gcc-4.6.2, freebsd-lib-9.0, 9.0-RELEASE i386)
=================================================================
                        System Settings
=================================================================
System uname: FreeBSD-9.0-RELEASE-i386-32bit-ELF
Timestamp of tree: Wed, 21 Mar 2012 22:00:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:         4.2_p24
dev-lang/python:         2.7.2-r3, 3.2.2
dev-util/ccache:         3.1.7
dev-util/pkgconfig:      0.26
sys-apps/baselayout:     2.1
sys-apps/openrc:         0.9.9.3
sys-devel/autoconf:      2.68
sys-devel/automake:      1.9.6-r3, 1.11.3
sys-devel/binutils:      2.20.1-r1
sys-devel/gcc:           4.6.2
sys-devel/gcc-config:    1.5.1-r1
sys-devel/libtool:       2.4.2
sys-devel/make:          3.82-r3
sys-freebsd/freebsd-lib: 9.0 (virtual/os-headers)
Repositories: gentoo
Installed sets: 
ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-gentoo-freebsd9.0"
CFLAGS="-O2 -pipe -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10"
CHOST="i686-gentoo-freebsd9.0"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg ccache chflags distlocks ebuild-locks fixlafiles news noinfo parallel-fetch parallel-install preserve-libs protect-owned sfperms split-log strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext acl berkdb cli cracklib crypt cups cxx dri gdbm iconv ipv6 java5 java6 modules ncurses nls nptlonly oss pam pcre perl python readline session sse3 sse4a ssl sysfs tcpd unicode x86-fbsd xorg zfs zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="BSD" VIDEO_CARDS="apm ark chips cirrus cyrix dummy i128 intel mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis tga trident tseng vmware fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-devel/clang-3.0-r3 was built with the following:
USE="(java5) static-analyzer system-cxx-headers test -debug -multitarget"
Comment 1 Zac Medico gentoo-dev 2012-03-22 06:17:31 UTC
Where are the relevant soname symlink and the file that it points to installed? Maybe the problem is similar to the issue with binutils that's described in this commit:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb9d3b0b53bded18941f12b6e2445d680fb431bb
Comment 2 Richard Yao (RETIRED) gentoo-dev 2012-03-22 06:35:20 UTC
(In reply to comment #1)
> Where are the relevant soname symlink and the file that it points to
> installed? Maybe the problem is similar to the issue with binutils that's
> described in this commit:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=bb9d3b0b53bded18941f12b6e2445d680fb431bb

It is not a symlink:

# ls -l /usr/lib/llvm/libLLVM-3.0.so 
-rwxr-xr-x 1 root root 17047640 Mar 10 01:17 /usr/lib/llvm/libLLVM-3.0.so
Comment 3 Fabian Groffen gentoo-dev 2012-03-22 07:50:46 UTC
please show scanelf --soname /usr/lib/llvm/libLLVM-3.0.so output
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-03-22 07:53:51 UTC
(In reply to comment #3)
> please show scanelf --soname /usr/lib/llvm/libLLVM-3.0.so output

# scanelf --soname /usr/lib/llvm/libLLVM-3.0.so       
 TYPE   SONAME FILE 
ET_DYN  /usr/lib/llvm/libLLVM-3.0.so
Comment 5 Fabian Groffen gentoo-dev 2012-03-22 07:57:54 UTC
right, the soname is missing, so can't blame Portage here
Comment 6 Richard Yao (RETIRED) gentoo-dev 2012-03-23 05:27:09 UTC
(In reply to comment #5)
> right, the soname is missing, so can't blame Portage here

In that case, I will reassign this to the maintainer. I am leaving the portage team on the CC list because of the block on preserve-libs. Feel free to remove the CC if it is inappropriate.
Comment 7 Zac Medico gentoo-dev 2012-03-23 05:31:07 UTC
Yeah, I don't see anything for portage here.
Comment 8 Bernard Cafarelli gentoo-dev 2012-03-23 10:04:14 UTC
Mageia has a patch for this, only for Linux hosts. prefix and bsd, what would you need for ~x86-fbsd and ~ppc-macos?

Upstream bug filled in the meantime
Comment 9 Alexis Ballier gentoo-dev 2012-03-23 10:10:08 UTC
(In reply to comment #8)
> Mageia has a patch for this, only for Linux hosts. prefix and bsd, what
> would you need for ~x86-fbsd and ~ppc-macos?
> 
> Upstream bug filled in the meantime

for ~x86-fbsd, the same as linux
Comment 10 Fabian Groffen gentoo-dev 2012-03-23 10:27:45 UTC
On all ELF platforms with GNU ld, that soname fix is necessary (don't know if they have appropriate guards for that).

On MACH-O platforms, and install_name $(LIBDIR)/libllvm.$(MAJOR).dylib is necessary, but I don't know if something like $(LIBDIR) is available at that point.  The install name needs full path.
Comment 11 Bernard Cafarelli gentoo-dev 2012-03-26 16:16:10 UTC
Here is the relevant Makefile:
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-shlib/Makefile?view=markup

Not sure if the Darwin parts are OK, but at least for ~x86-fbsd, I think I can safely move the -Wl,-soname line to the "ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD))". The other OS in the Makefile are Solaris, Darwin, and Cygwin/MingW

I'll make a patch for llvm-3.0, if it works for ~x86-fbsd I will commit it and ask upstream to update the change (soname for Linux is already in, so -9999 ebuild should work)
Comment 12 Bernard Cafarelli gentoo-dev 2012-03-26 16:16:56 UTC
Created attachment 306741 [details, diff]
Sets soname for Linux FreeBSD OpenBSD
Comment 13 Richard Yao (RETIRED) gentoo-dev 2012-03-26 16:24:05 UTC
(In reply to comment #12)
> Created attachment 306741 [details, diff] [details, diff]
> Sets soname for Linux FreeBSD OpenBSD

This patch results in the following in my Gentoo/FreeBSD 9 chroot:

# scanelf --soname /usr/lib/llvm/libLLVM-3.0.so  
 TYPE   SONAME FILE 
ET_DYN libLLVM-3.0.so /usr/lib/llvm/libLLVM-3.0.so
Comment 14 Bernard Cafarelli gentoo-dev 2012-03-27 08:07:30 UTC
llvm-3.0-r2 is in tree with patch, thanks for testing!