Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 472692 - =sys-fs/cryptsetup-1.6.1[static,openssl] - /usr/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': (.text+0x11): undefined reference to `dlopen'
Summary: =sys-fs/cryptsetup-1.6.1[static,openssl] - /usr/lib64/libcrypto.a(dso_dlfcn.o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-08 19:09 UTC by Torsten Kaiser
Modified: 2013-08-08 18:21 UTC (History)
3 users (show)

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


Attachments
build.log for failing sys-fs/cryptsetup-1.6.1 (build.log,76.25 KB, text/plain)
2013-06-08 19:11 UTC, Torsten Kaiser
Details
patch for cryptsetup-1.6.1.ebuild to fix the configure.ac bug (cryptsetup-1.6.1.ebuild.patch,1.10 KB, patch)
2013-06-21 19:05 UTC, Torsten Kaiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kaiser 2013-06-08 19:09:36 UTC
Trying the new useflags to switch the backend of cryptsetup to openssl fails during the link of the static binary.

Example errors:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x11): undefined reference to `dlopen'

/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libcrypto.a(c_zlib.o): In function `bio_zlib_free':
(.text+0x5d): undefined reference to `inflateEnd'

For me it looks like cryptsetup correctly tries to link against libcrypto, but libcrypto itself has additional dependency that are missing.
If I rebuild openssl with USE=-zlib, the errors related to zlib functions disappear, but it still fails because of the dlfcn ones.

My emerge --info:

Portage 2.1.12.3 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.10.0-rc4 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.0-rc4-x86_64-AMD_Phenom-tm-_II_X6_1090T_Processor-with-gentoo-2.2
KiB Mem:    12282652 total,   2417480 free
KiB Swap:   25165756 total,  25165756 free
Timestamp of tree: Sat, 08 Jun 2013 17:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0::java
dev-lang/python:          2.7.5, 3.3.2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.13.2
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.4, 4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo x11 sunrise java mozilla local
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=amdfam10 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /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="-pipe -march=amdfam10 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --jobs=6 --load-average=7 --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/var/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="/usr/portage-local/layman/x11 /usr/portage-local/layman/sunrise /usr/portage-local/layman/java /usr/portage-local/layman/mozilla /root/ebuilds"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip S3TC X a52 aac aalib ace acl acpi ads aften aio alisp alsa altenburgcards amarok amd64 amr amrnb amrr amrwb animgif ao apache2 apng aqua_theme archive async audacious audiofile autoipd avahi bcel bcp bdf beagle berkdb bigpatch binfilter bittorrent bl blas blender-game bluetooth bonusscripts boost bzip2 c++ cairo calendar caps carbone_theme cblas-external cdda cdio cdparanoia cdr cgi chm chroot cifsupcall cisco cli clucene cmdctrl cmdsubmenu compress connectionstatus consolekit contactnotes corefonts cpio cpufreq cracklib crypt cryptsetup cscope css ctype cups curl cutterlimit cutterqueue cuttime cvs cvsgraph cxx dar64 dbase dbm dbus dbx dc1394 declarative demo device-mapper divx djvu dlz dmi dmx dnotify doc domainkeys dot double-precision dpmod dri dts dv dvb dvbplayer dvd dvdarchive dvdchapjump dvdr dvdread dvi ecc editor egl elf emoticon encode enscript equalizer excel exif exiv2 expat extensions extra extra-algorithms extra-cardsets extraengine extras fam fat fbcon festival ffmpeg fftw file file-icons flac fluidsynth fmod font-server fontconfig fortran fping fpx ftp fts3 fuse g3dvl gcj gd gdbm gecko geoip gflags gif gimp git gkrellm gles1 gles2 glib glibc-omitfp glitz glsa glut gmedia gmp gnutls gopher gpac gpg gpgme gphoto2 gpm graphics graphite graphviz gs gstreamer gtk gtk3 gudev gutenprint gzip hddtemp hdri highlight history html htmlhandbook http httpd hvm hwdb ical iceweasel iconv icq icu id3 id3tag ide idea ieee1394 image imagemagick imap infowidget inherit-graph inkjar innodb inotify ipfilter ipsec iptc ipv6 irc irrlicht ithreads jabber jack jad jadetex java java-external java6 jce jingle jit jni john jpeg jpeg2k juju jumpplay kde kdecards kdepim kerberos kexi kipi kmid kpathsea ktts kvm latex lcms ldap libcaca libkms libmpeg2 libmysqlclient libnotify libsamplerate libsexy libssh2 libvisual libwww liemikuutio lights lirc lircsettings livebuffer llvm lm_sensors logrotate logviewer loop-playback lua lucene lyx lzma lzo mad magic mail mailwrapper mainmenuhooks maps masquerade math matroska maya-shaderlibrary mbox mbrola md5sum mdev mdnsresponder-compat meanwhile menu-plugin menubar menuorg metric mhash midi mikmod mime mimencode minizip mixer mjpeg mmap mmx mmxext mng mod modplug modules mounts-check mozdevelop mozdom mozilla mp2 mp3 mp4 mp4live mpd mpeg mpeg2 mpg123 mplayer mppe-mppc mpu401 mschap msn mtp mudflap multilib multiprocess musepack music mysql mysqli mythtv nagios-dns nagios-ntp nagios-ping nagios-ssh nat ncurses net netjack netmeeting network network-cron networkmanager nfs nfsidmap nfsv4 nfsv41 nls nntp normalize nova nptl nsplugin nspr nss ntfs ntfsprogs nuv offensive ogg ogg123 ole opcache openexr opengl openmp openssh openssl openvg openvpn opus osmesa pam pango pascal pcap pcre pda pdf pdfimport perl php physfs pixmaps pkcs11 plasma player pmu png policykit posix postfix postscript povray pptp pth pulseaudio python qemu qt3support qt4 query-browser quicktime radio rar raw rc5 rdesktop readline realmedia remix replaygain restrict-javascript rle rpc rss rtc rtmp rtsp samba sasl sbig scanner screen script sdk sdl sdl-image sdl-sound sdlaudio seamonkey search secure-delete semantic-desktop sensord server session shared-dricore shorten shout sid signatures simplexml skins smime smp smtp sndfile sockets socks5 solver songs sortrecords sound soundex sounds sox speech speedo speex spell spice sql sqlite sqlite3 sse sse2 sse3 sse4a ssl stars stats stemmer stlport stream submenu subtitles subversion suhosin svg svgz swat sylpheed sysfs syslog system-cairo system-jpeg system-libvncserver system-sqlite systray sysvipc szip t1lib taglib tagwriting tb4 tcpd teletext tetex tex texteffect textures tftp tga themes theora thesaurus threads threadsafe tidy tiff timercmd timerinfo tk tls toolbar tools transcode trayicon truetype tta ttxtsubs twolame ui unicode unlock-notify upcall usb usbredir userfiles utils uudeview uuencode v4l v4l2 vaapi valgrind vamp vcd vcdx vdpau vdr video videos vim-syntax visualization vlm vnc vncviewer voice volctrl vorbis vorbis-psy vpx wav wavpack web webdav webinterface webkit webm webp wifi winpopup wireshark wma wmf wmp wxwidgets x264 xa xanim xcb xcf xcomposite xext xface xforms xfs xft xhtml xine xinerama xml xorg xosd xplanet xpm xrandr xrender xscreensaver xsl xslt xspice xv xvfb xvid xvmc xvnc yahoo yv12 zip zlib zrtp zvbi" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 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" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" ELIBC="glibc" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 alpha arm cris i386 m68k ppc ppc64 ppcemb s390x sh4 sh4eb sparc sparc64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l vesa radeon r600" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

dev-libs/openssl-1.0.1e-r1 was built with the following:
USE="gmp kerberos (multilib) (sse2) static-libs zlib -bindist -rfc3779 -test -vanilla" ABI_X86="64" ELIBC="glibc" KERNEL="linux" USERLAND="GNU"
CFLAGS="-pipe -march=amdfam10 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer -fno-strict-aliasing -Wa,--noexecstack"
CXXFLAGS="-pipe -march=amdfam10 -O3 -fomit-frame-pointer -fweb -frename-registers -ftracer -fno-strict-aliasing -Wa,--noexecstack"


sys-fs/cryptsetup-1.6.0 was built with the following:
USE="(multilib) nls python static -reencrypt (-selinux) -static-libs -udev -urandom" ELIBC="glibc" KERNEL="linux" USERLAND="GNU"
Comment 1 Torsten Kaiser 2013-06-08 19:11:36 UTC
Created attachment 350440 [details]
build.log for failing sys-fs/cryptsetup-1.6.1
Comment 2 Torsten Kaiser 2013-06-18 19:18:50 UTC
thoregon ~ # pkg-config --libs openssl
-lssl -lcrypto 
thoregon ~ # pkg-config --static --libs openssl
-lssl -lgmp -ldl -lz -lcrypto -lgmp -ldl -lz 

But config.log says:
CRYPTO_LIBS='-lssl -lcrypto '
CRYPTO_STATIC_LIBS='-lssl -lcrypto '

It seems that the second pkg-config call with the added --static is skiped and instead the cached value from the non-static call gets reused and put into CRYPTO_STATIC_LIBS.

Googleing find this: <http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html>
cite: "prefix
Each call to PKG_CHECK_MODULES should have a different prefix value"

From cryptsetup's configure.ac:
        PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],,
                AC_MSG_ERROR([You need openssl library.]))
        CRYPTO_CFLAGS=$OPENSSL_CFLAGS
        CRYPTO_LIBS=$OPENSSL_LIBS
        use_internal_pbkdf2=0

        if test x$enable_static_cryptsetup = xyes; then
                saved_PKG_CONFIG=$PKG_CONFIG
                PKG_CONFIG="$PKG_CONFIG --static"
                PKG_CHECK_MODULES([OPENSSL], [openssl])
                CRYPTO_STATIC_LIBS=$OPENSSL_LIBS

Because of the same prefix OPENSSL the second call seems to goof up.
The gcrypt version looks different, but uses LIBGCRYPT_STATIC_LIBS for the static case, so would this fix be correct?

--- configure.ac~       2013-03-24 10:02:02.000000000 +0100
+++ configure.ac        2013-06-18 21:18:07.028682622 +0200
@@ -149,8 +149,8 @@
        if test x$enable_static_cryptsetup = xyes; then
                saved_PKG_CONFIG=$PKG_CONFIG
                PKG_CONFIG="$PKG_CONFIG --static"
-               PKG_CHECK_MODULES([OPENSSL], [openssl])
-               CRYPTO_STATIC_LIBS=$OPENSSL_LIBS
+               PKG_CHECK_MODULES([OPENSSL_STATIC], [openssl])
+               CRYPTO_STATIC_LIBS=$OPENSSL_STATIC_LIBS
                PKG_CONFIG=$saved_PKG_CONFIG
        fi
        NO_FIPS([])
Comment 3 Torsten Kaiser 2013-06-21 19:05:30 UTC
Created attachment 351590 [details, diff]
patch for cryptsetup-1.6.1.ebuild to fix the configure.ac bug

I used this patch locally and was able to successfully build a working, static cryptsetup.
It includes the change proposed in comment #2 and a new call to eautoreconf to regenerate the configure from the patched configure.ac.
Comment 4 Roc Vallès 2013-08-05 07:55:41 UTC
Why is this still unconfirmed? It affects many people and a patch has been made available.
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2013-08-06 20:15:33 UTC
(In reply to Torsten Kaiser from comment #2)
> [...]
> Because of the same prefix OPENSSL the second call seems to goof up.
> The gcrypt version looks different, but uses LIBGCRYPT_STATIC_LIBS for the
> static case, so would this fix be correct?
> 
> --- configure.ac~       2013-03-24 10:02:02.000000000 +0100
> +++ configure.ac        2013-06-18 21:18:07.028682622 +0200
> @@ -149,8 +149,8 @@
>         if test x$enable_static_cryptsetup = xyes; then
>                 saved_PKG_CONFIG=$PKG_CONFIG
>                 PKG_CONFIG="$PKG_CONFIG --static"
> -               PKG_CHECK_MODULES([OPENSSL], [openssl])
> -               CRYPTO_STATIC_LIBS=$OPENSSL_LIBS
> +               PKG_CHECK_MODULES([OPENSSL_STATIC], [openssl])
> +               CRYPTO_STATIC_LIBS=$OPENSSL_STATIC_LIBS
>                 PKG_CONFIG=$saved_PKG_CONFIG
>         fi
>         NO_FIPS([])

Looks right to me. Committing.

+  06 Aug 2013; Ian Stakenvicius <axs@gentoo.org>
+  +files/cryptsetup-1.6.1-openssl-static.patch, cryptsetup-1.6.1.ebuild:
+  fixed compilation error when USE='openssl static', bug 472692 [...]
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2013-08-08 18:21:02 UTC
Note - Upstream has committed in
http://code.google.com/p/cryptsetup/source/detail?r=31303718da9e26704d1002ae1ed50a851287891e