Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332905 - sys-fs/lvm2-2.02.72 uses -Wl,--export-dynamic for static linking
Summary: sys-fs/lvm2-2.02.72 uses -Wl,--export-dynamic for static linking
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Robin Johnson
URL: http://bugzilla.redhat.com/show_bug.c...
Whiteboard:
Keywords:
: 333165 333167 333353 333565 334485 336373 (view as bug list)
Depends on:
Blocks: glibc-2.12
  Show dependency tree
 
Reported: 2010-08-15 22:06 UTC by Kevin J Meagher
Modified: 2010-09-30 06:39 UTC (History)
15 users (show)

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


Attachments
-Wl,--no-export-dynamic before -static (lvm2-2.02.72-conflict.patch,2.69 KB, patch)
2010-08-17 00:03 UTC, Samuli Suominen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin J Meagher 2010-08-15 22:06:29 UTC
x86_64-pc-linux-gnu-gcc -c -I. -I../include -DLVM_SHARED_PATH=\"/usr/sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -march=core2 -O3 -pipe -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 dmsetup.c -o dmsetup.o
x86_64-pc-linux-gnu-gcc -march=core2 -O3 -pipe -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L./libdm -L./lib -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L../libdm -L../lib -L../daemons/dmeventd -L../libdm \
              -o dmsetup dmsetup.o -ldevmapper -lm  -ludev
x86_64-pc-linux-gnu-gcc -march=core2 -O3 -pipe -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -march=core2 -O3 -pipe -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L./libdm -L./lib -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L../libdm -L../lib -L../daemons/dmeventd -static -L../libdm/ioctl \
              -o dmsetup.static dmsetup.o -ldevmapper  -ludev -lm  -ludev
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make[1]: *** [dmsetup.static] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-fs/lvm2-2.02.72/work/LVM2.2.02.72/tools'
make: *** [tools.device-mapper] Error 2


Reproducible: Always




Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.12.1-r0, 2.6.34-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-x86_64-Intel-R-_Core-TM-_i5_CPU_750_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 15 Aug 2010 20:45:01 +0000
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://www.gtlib.gatech.edu/pub/gentoo http://gentoo.mirrors.pair.com/ http://gentoo.mirrors.tds.net/gentoo http://gentoo.netnitco.net http://gentoo.llarian.net/ http://gentoo.binarycompass.org http://mirror.datapipe.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.mirrors.hoobly.com/ http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="#seamonkey X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus device-mapper divx dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig fontforge fortran gdbm gif gmedia gnome gnutls gpm gstreamer gtk hal hddtemp iconv ipod jpeg kde lcms ldap libnotify lm_sensors mad midi mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp openssl pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 readline realmedia reflection sdl session spell spl sse sse2 ssl startup-notification svg sysfs tcpd threads tiff timidity truetype unicode usb vorbis wmp x264 xcb xml xorg xscreensaver xulrunner xv xvid 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nvidia" 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, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Kenton Groombridge 2010-08-16 00:51:11 UTC
Occurs with the new glibc 2.12.1 and no previous versions.
Comment 2 Emanuel Ydrefors 2010-08-16 20:03:47 UTC
(In reply to comment #1)
> Occurs with the new glibc 2.12.1 and no previous versions.
> 

I can confirm this.  I have exactly the same problem.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2010-08-16 20:58:49 UTC
Looks like http://bugzilla.redhat.com/show_bug.cgi?id=606830
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2010-08-17 00:03:03 UTC
Created attachment 243283 [details, diff]
-Wl,--no-export-dynamic before -static

Upstream might want to use SHARED_LDFLAGS="-Wl,--export-dynamic" instead and use it only where appropiate.  This one is for fixing the immediate problem.
Comment 5 SpanKY gentoo-dev 2010-08-17 05:36:13 UTC
the people notified in the redhat bug are the ones most likely to fix the issue, or to notify of the issue.  so there isnt really anything for us to do along those lines.  fix lvm2 to not use --export-dynamic + --static.
Comment 6 Stephan Kupfer 2010-08-17 12:47:28 UTC
Patch workes for me, thx Samuli!
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2010-08-17 15:27:06 UTC
*** Bug 333165 has been marked as a duplicate of this bug. ***
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2010-08-17 15:27:23 UTC
*** Bug 333167 has been marked as a duplicate of this bug. ***
Comment 9 Sergiy Zhidenko 2010-08-17 16:25:58 UTC
Patch didn't help me. I'm not sure if I did everything right. I simply applied patch and then did "ebuild *path* compile"

But the error slightly changed. Here it is: 

i686-pc-linux-gnu-gcc -O2 -march=prescott -pipe -fomit-frame-pointer -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L./libdm -L./lib -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L../libdm -L../lib -L../daemons/dmeventd -static -L../libdm/ioctl \
	      -o dmsetup.static dmsetup.o -ldevmapper  -ludev -lm  -ludev
make[2]: Entering directory `/var/tmp/portage/sys-fs/lvm2-2.02.72/work/LVM2.2.02.72/daemons/dmeventd'
i686-pc-linux-gnu-gcc -O2 -march=prescott -pipe -fomit-frame-pointer -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L./libdm -L./lib -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L../libdm -L../lib -L../daemons/dmeventd -Wl,-O1 -Wl,--as-needed -Wl,--export-dynamic -L../../libdm -L../../lib -L../../daemons/dmeventd -static -L. -L../../libdm/ioctl -o dmeventd.static \
	dmeventd.o -ldl -ldevmapper-event -lpthread -lm  -ldevmapper  -ludev
/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make[1]: *** [dmsetup.static] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-fs/lvm2-2.02.72/work/LVM2.2.02.72/tools'
make: *** [tools.device-mapper] Error 2
make: *** Waiting for unfinished jobs....
dmeventd.o: In function `_register_for_event':
dmeventd.c:(.text+0xfe8): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make[2]: *** [dmeventd.static] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-fs/lvm2-2.02.72/work/LVM2.2.02.72/daemons/dmeventd'
make[1]: *** [dmeventd.device-mapper] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-fs/lvm2-2.02.72/work/LVM2.2.02.72/daemons'
make: *** [daemons.device-mapper] Error 2
 * ERROR: sys-fs/lvm2-2.02.72 failed:
 *   compile fail
 * 
 * Call stack:
 *     ebuild.sh, line  54:  Called src_compile
 *   environment, line 3691:  Called die
 * The specific snippet of code:
 *       emake || die "compile fail"
 * 
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2010-08-17 16:29:10 UTC
(In reply to comment #9)
> Patch didn't help me. I'm not sure if I did everything right. I simply applied
> patch and then did "ebuild *path* compile"

Your paste is NOT using the patch, you failed to apply it properly.
Comment 11 Michael Weber (RETIRED) gentoo-dev 2010-08-17 17:54:26 UTC
works here, too.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-17 18:45:12 UTC
InCVS.
Comment 13 Emanuel Ydrefors 2010-08-18 18:23:24 UTC
(In reply to comment #4)
> Created an attachment (id=243283) [details]
> -Wl,--no-export-dynamic before -static
> 
> Upstream might want to use SHARED_LDFLAGS="-Wl,--export-dynamic" instead and
> use it only where appropiate.  This one is for fixing the immediate problem.
> 

The patch works for me also. Thanks.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2010-08-18 21:39:37 UTC
*** Bug 333353 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2010-08-20 05:31:06 UTC
*** Bug 333565 has been marked as a duplicate of this bug. ***
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2010-08-25 18:26:33 UTC
*** Bug 334485 has been marked as a duplicate of this bug. ***
Comment 17 majlo 2010-08-27 18:02:11 UTC
Same bug with 2.02.48 till 2.02.70-r1.
Comment 18 Jacob Godserv 2010-08-31 12:01:27 UTC
Is it just me or is this bug occurring in 2.02.73 as well, even with files/lvm2-2.02.72-dynamic-static-ldflags.patch applied in the ebuild?
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2010-08-31 12:57:18 UTC
(In reply to comment #18)
> Is it just me or is this bug occurring in 2.02.73 as well, even with
> files/lvm2-2.02.72-dynamic-static-ldflags.patch applied in the ebuild?
> 

just you
Comment 20 Jeremy Huddleston Sequoia 2010-09-07 18:00:33 UTC
This is clearly not fixed, so I opened a new ticket with bug #336373
Comment 21 Samuli Suominen (RETIRED) gentoo-dev 2010-09-07 18:01:03 UTC
*** Bug 336373 has been marked as a duplicate of this bug. ***
Comment 22 Samuli Suominen (RETIRED) gentoo-dev 2010-09-07 18:13:30 UTC
*** Bug 336373 has been marked as a duplicate of this bug. ***
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-09-07 18:26:22 UTC
eradicator:
(In reply to comment #20)
> This is clearly not fixed, so I opened a new ticket with bug #336373

# ld --version
GNU ld (GNU Binutils) 2.20.1.20100303
# emerge -pv lvm2 --nodeps
...
[ebuild   R   ] sys-fs/lvm2-2.02.73-r1  USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 0 kB

So works for me...
Comment 24 Jeremy Huddleston Sequoia 2010-09-07 18:53:44 UTC
Right, I understand that this is fixed with newer binutils.  What I'm saying is that there should be a check in lvm2's ebuild to verify that the active binutils supports this option.
Comment 25 Samuli Suominen (RETIRED) gentoo-dev 2010-09-07 19:04:03 UTC
(In reply to comment #24)
> Right, I understand that this is fixed with newer binutils.  What I'm saying is
> that there should be a check in lvm2's ebuild to verify that the active
> binutils supports this option.
> 

nah.  it's a rolling distribution.  surely each is responsible for his own system to make sure it's using stable toolchain before opening bugs, at minimum.
Comment 26 Jacob Godserv 2010-09-08 12:14:44 UTC
(In reply to comment #25)
> nah.  it's a rolling distribution.  surely each is responsible for his own
> system to make sure it's using stable toolchain before opening bugs, at
> minimum.

I'm running a stable ("arm"-keyworded) 2.19.1 binutils and that's failing to compile lvm2. I also suggest you add a dependency if this only builds with certain toolchains.
Comment 27 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-09-08 17:50:57 UTC
There is already a dependency, so we need to bring in a way to abort when the currently active binutils slot is too old.
Comment 28 Samuli Suominen (RETIRED) gentoo-dev 2010-09-08 20:05:43 UTC
(In reply to comment #27)
> There is already a dependency, so we need to bring in a way to abort when the
> currently active binutils slot is too old.
> 

overkill. overkill. overkill.
 
if fact, i'd be _very_ emberrased (like any other sane user) for filing bugs of outdated system.
any unnecessary rant of default behavior of rolling distribution and expece to lose your bugzilla account.

@userrel, please disable account for any future users complaining here for lack of knowledge of maintaining a sane system and insulting developers here, thanks!