Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631778 - net-misc/curl-7.55.1: does not respect prefix library paths when linking; fails to build
Summary: net-misc/curl-7.55.1: does not respect prefix library paths when linking; fai...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-22 22:10 UTC by Benjamin Block
Modified: 2017-10-01 23:53 UTC (History)
0 users

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


Attachments
Complete Emerge Log (emerge.log,231.32 KB, text/plain)
2017-09-22 22:11 UTC, Benjamin Block
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Block 2017-09-22 22:10:12 UTC
On my prefix-system (base is Ubuntu 14.04.x), I can not build curl right now, because the final linking step does not use the library paths of the prefix, but some (not even all) from my base ubuntu. This is so far the only build I have had this kind of problem.

It complains about missing ssl. But it also uses libexpat and libmetalink form the base ubuntu, which is also wrong, because it should use them from the prefix.

Reproducible: Always

Steps to Reproduce:
1. emerge net-misc/curl
2. wait
Actual Results:  
Build breaks at (what seems to be) the last linking step of the curl binary with the following command and error message:

/home/bblock/local/portage-tree/bin/bash ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -O2 -pipe -march=native -mtune=native -O2 -ggdb -pipe -fstack-check -Werror-implicit-function-declaration -pthread    -Wl,-O1 -Wl,--hash-style=gnu -Wl,-z,relro -o curl curl
-slist_wc.o curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_f
ormparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o curl-tool_mfiles.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool
_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-nonblock.o ../lib/curl-warnless.o  .
./lib/libcurl.la -lmetalink -lidn2 -lrtmp -lz -lssl -lcrypto -lssh2 -lssh2 -lssl -lcrypto -lssl -lcrypto -lz
libtool: link: x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -mtune=native -O2 -ggdb -pipe -fstack-check -Werror-implicit-function-declaration -pthread -Wl,-O1 -Wl,--hash-style=gnu -Wl,-z -Wl,relro -o .libs/curl curl-slist_wc.o curl-tool_binmode.o curl-tool_bname.o curl-
tool_cb_dbg.o curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o cur
l-tool_help.o curl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o curl-tool_mfiles.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o cu
rl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-nonblock.o ../lib/curl-warnless.o  ../lib/.libs/libcurl.so /home/bblock/local/portage-tree/
usr/lib/libmetalink.so -L/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libexpat.so -lidn2 -lrtmp -lssh2 -lssl -lcrypto -lz -pthread -Wl,-rpath -Wl,/home/bblock/local/portage-tree/usr/lib
ld: warning: librtmp.so.1, needed by ../lib/.libs/libcurl.so, may conflict with librtmp.so.0
../lib/.libs/libcurl.so: undefined reference to `SSL_CTX_set_alpn_protos'
../lib/.libs/libcurl.so: undefined reference to `libssh2_scp_recv2'
../lib/.libs/libcurl.so: undefined reference to `SSL_COMP_free_compression_methods'
../lib/.libs/libcurl.so: undefined reference to `SSL_get0_alpn_selected'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:824: curl] Error 1


Expected Results:  
Package builds and installs successfully.

Portage 2.3.8-prefix (python 3.5.2-final-0, prefix/linux/amd64, gcc-5.3.0, unavailable, 4.4.0-93-generic x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.4.0-93-generic-x86_64-Intel-R-_Core-TM-_i7-3740QM_CPU_@_2.70GHz-with-debian-jessie-sid
KiB Mem:    16043660 total,   1440152 free
KiB Swap:   16777212 total,  16346396 free
Timestamp of repository gentoo_prefix: Thu, 21 Sep 2017 13:57:04 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo_prefix
dev-lang/perl:            5.24.2::gentoo_prefix
dev-lang/python:          2.7.12::gentoo_prefix, 3.5.2::gentoo_prefix
dev-util/pkgconfig:       0.29.1::gentoo_prefix
sys-devel/autoconf:       2.69-r4::gentoo_prefix
sys-devel/automake:       1.14.1-r1::gentoo_prefix, 1.15.1-r1::gentoo_prefix
sys-devel/binutils:       2.28.1::gentoo_prefix
sys-devel/gcc:            5.3.0::gentoo_prefix
sys-devel/gcc-config:     1.8-r01.1::gentoo_prefix
sys-devel/libtool:        2.4.6-r4::gentoo_prefix
sys-devel/make:           4.2.1-r1::gentoo_prefix
sys-kernel/linux-headers: 4.13::gentoo_prefix (virtual/os-headers)
Repositories:

gentoo_prefix
    location: /home/bblock/local/portage-tree/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix
    priority: -1000

ACCEPT_KEYWORDS="~amd64-linux"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native -O2 -ggdb -pipe -fstack-check"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -O2 -ggdb -pipe -fstack-check"
DISTDIR="/home/bblock/local/portage-tree/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix installsources merge-sync news parallel-fetch preserve-libs protect-owned sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,-z,relro"
MAKEOPTS="-j17 -l9"
PKGDIR="/home/bblock/local/portage-tree/usr/portage/packages"
PORTAGE_CONFIGROOT="/home/bblock/local/portage-tree/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/home/bblock/local/portage-tree/var/tmp"
USE="amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm hardened iconv icu ipv6 jemalloc modules ncurses nls nptl openmp pcre pic pie prefix prefix-guest readline seccomp session ssl ssp tcpd unicode vim-syntax zlib" ABI_X86="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 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 sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="de en en-US en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en en_US en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Benjamin Block 2017-09-22 22:11:26 UTC
Created attachment 496110 [details]
Complete Emerge Log

This is the complete log from the emerge-attempt.
Comment 2 Benjamin Block 2017-09-22 22:17:24 UTC
During the configure step it seems to respect the whole prefix settings. It only sees prefix-paths and even the autotools check for openssl shows the openssl-version from the prefix (my ubuntu 14.04 has 1.0.1f, not 1.0.2 as it discovers.. so configure must see the prefix one).

But during the libtool call that leads to the broken link-command it seems to find/give no prefix-paths at all to the gcc/linker. It also appends strange arguments like /usr/lib/x86_64-linux-gnu/libexpat.so, which is from the base system, and should not appear there.

Not sure how I can debug this further.
Comment 3 Benjamin Block 2017-09-25 16:22:59 UTC
So, metalink is what breaks this. By doing some trial and error, I figured that once I disable the metalink useflag, it does successfully compile.

What I noticed is, when linking, there is never a -lmetalink, which I would expect, but rather explicit library files. In the 'curl-config' file that is created once the configure step was done I also notice that while there is all the other expected linker-flags such as -lssl, -lcrypto, -lidn2, ..; there is no -lmetalink.
Comment 4 Benjamin Block 2017-10-01 14:16:23 UTC
I looked into this a bit more and noticed that for some reason the libtool script used during build of curl does not search for libraries in ${EPREFIX}/usr/lib, but in ${EPREFIX}/usr/lib64; which seems odd, because as far as I understood, gentoo-prefix is not multilib.

Anyway, as a work-around I created ${EPREFIX}/usr/lib64 and made symlinks to libmetalink.so and libexpat.so. Thereafter it worked fine. Both files are still in ${EPREFIX}/usr/lib, so the rpath during curl runtime should also work fine AFAIK.
Comment 5 Fabian Groffen gentoo-dev 2017-10-01 14:37:46 UTC
correct, prefix doesn't do multilib, just to check, libtool /does/ come from the Prefix does it?
Comment 6 Benjamin Block 2017-10-01 23:53:15 UTC
(In reply to Fabian Groffen from comment #5)
> correct, prefix doesn't do multilib, just to check, libtool /does/ come from
> the Prefix does it?

Hmm. The prefix has libtool installed (plus autoconf, automake and all that). When configure is run during the curl-build it creates/copies the libtool script into the work-directory. I don't know enough about the internals to know where it pulls the base for this script that ends up in .../work/curl-7.55.1-abi_x86_64.amd64/libtool.

Anyway. I just rerun the configure step and typically it now created the correct search paths in ${sys_lib_search_path_spec} in libtool ("/home/bblock/local/portage-tree/lib /home/bblock/local/portage-tree/usr/lib /home/bblock/local/portage-tree/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0 /lib/x86_64-linux-gnu /lib64 /usr/lib/x86_64-linux-gnu /usr/lib64 /home/bblock/local/portage-tree/usr/x86_64-pc-linux-gnu/lib /home/bblock/local/portage-tree/usr/lib /lib /usr/lib "). With this it will find libmetalink.so in /home/bblock/local/portage-tree/usr/lib w/o any workaround necessary (confirmed just now by doing the compile step w/o the symlinks I created before).

I am not sure what changed about the system/installation.. I didn't do anything obvious to me (I just installed some other unrelated things in the meantime). But as it is now I can not reproduce the previous situation.

I set this to Resolved then.