Build failure. Apparently gtest actually builds but libtool then tries to relink the dynamic library which causes a failure due to using weird library paths. Libtool is clearly Reproducible: Always Steps to Reproduce: 1. Set up a crossdev toolchain (I used armv7a-hardfloat-linux-gnueabi) 2. armv7a-hardfloat-linux-gnueabi-emerge dev-cpp/gtest Actual Results: emerge failed Expected Results: emerge succeeds All available versions of gtest are tried. None works. sh-4.3# armv7a-hardfloat-linux-gnueabi-emerge --info '=dev-cpp/gtest-1.7.0::gentoo' Portage 2.2.20.1 (python 3.4.3-final-0, default/linux/arm/13.0, gcc-4.9.3, unavailable, 3.19.0-25-generic x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.19.0-25-generic-x86_64-Intel-R-_Xeon-R-_CPU_E5-2630_v3_@_2.40GHz-with-gentoo-2.2 KiB Mem: 131929116 total, 47880496 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Mon, 23 Nov 2015 16:30:01 +0000 sh bash 4.3_p39 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 sys-apps/sandbox: 2.9::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 ACCEPT_KEYWORDS="arm ~arm" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O3 -pipe -fomit-frame-pointer -fPIC" CHOST="armv7a-hardfloat-linux-gnueabi" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O3 -pipe -fomit-frame-pointer -fPIC" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2" FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j32" PKGDIR="/usr/armv7a-hardfloat-linux-gnueabi/packages/" PORTAGE_CONFIGROOT="/usr/armv7a-hardfloat-linux-gnueabi/" 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" PORTAGE_TMPDIR="/usr/armv7a-hardfloat-linux-gnueabi/tmp/" USE="acl arm berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm graphite iconv ipv6 jpeg jpeg2k modules ncurses nls nptl openmp pcre png readline seccomp session ssl static-libs tcpd tiff unicode xattr zlib" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap omapfb 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" USE_PYTHON="2.7" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS tail of build log: >>> Source compiled. >>> Test phase [not enabled]: dev-cpp/gtest-1.7.0 >>> Install gtest-1.7.0 into /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image/ category dev-cpp * .arm: running multilib-minimal_abi_src_install make -j32 DESTDIR=/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image/ install mkdir -p "./fused-src" chmod -R u+w "./fused-src" rm -f "./fused-src/gtest/gtest-all.cc" rm -f "./fused-src/gtest/gtest.h" "./scripts/fuse_gtest_files.py" "./fused-src" cp -f "./src/gtest_main.cc" "./fused-src/gtest/" make[1]: Entering directory '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-.arm' /bin/mkdir -p '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib' /bin/sh ./libtool --mode=install /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c lib/libgtest.la lib/libgtest_main.la '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib' /bin/mkdir -p '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/include/gtest/internal' /bin/mkdir -p '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/share/aclocal' /bin/mkdir -p '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/include/gtest' /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 include/gtest/internal/gtest-death-test-internal.h include/gtest/internal/gtest-filepath.h include/gtest/internal/gtest-internal.h include/gtest/internal/gtest-linked_ptr.h include/gtest/internal/gtest-param-util-generated.h include/gtest/internal/gtest-param-util.h include/gtest/internal/gtest-port.h include/gtest/internal/gtest-string.h include/gtest/internal/gtest-tuple.h include/gtest/internal/gtest-type-util.h '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/include/gtest/internal' /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 m4/gtest.m4 '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/share/aclocal' /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 include/gtest/gtest-death-test.h include/gtest/gtest-message.h include/gtest/gtest-param-test.h include/gtest/gtest-printers.h include/gtest/gtest-spi.h include/gtest/gtest-test-part.h include/gtest/gtest-typed-test.h include/gtest/gtest.h include/gtest/gtest_pred_impl.h include/gtest/gtest_prod.h '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/include/gtest' libtool: install: /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c lib/.libs/libgtest.so.0.0.0 /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib/libgtest.so.0.0.0 libtool: install: (cd /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib && { ln -s -f libgtest.so.0.0.0 libgtest.so.0 || { rm -f libgtest.so.0 && ln -s libgtest.so.0.0.0 libgtest.so.0; }; }) libtool: install: (cd /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib && { ln -s -f libgtest.so.0.0.0 libgtest.so || { rm -f libgtest.so && ln -s libgtest.so.0.0.0 libgtest.so; }; }) libtool: install: /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c lib/.libs/libgtest.lai /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib/libgtest.la libtool: warning: relinking 'lib/libgtest_main.la' libtool: install: (cd /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-.arm; /bin/sh "/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-.arm/libtool" --tag CXX --mode=relink armv7a-hardfloat-linux-gnueabi-g++ -pthread -DGTEST_HAS_PTHREAD=1 -O3 -pipe -fomit-frame-pointer -fPIC -Wl,-O1 -Wl,--as-needed -o lib/libgtest_main.la -rpath /usr/lib src/gtest_main.lo lib/libgtest.la -inst-prefix-dir /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image/) libtool: relink: armv7a-hardfloat-linux-gnueabi-g++ -fPIC -DPIC -shared -nostdlib /usr/armv7a-hardfloat-linux-gnueabi/usr/lib/crti.o /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/crtbeginS.o src/.libs/gtest_main.o -Wl,-rpath -Wl,/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3 -Wl,--as-needed -L/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib -L/usr/lib -lgtest -L/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3 -lpthread -L/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/../../../../armv7a-hardfloat-linux-gnueabi/lib -L/usr/armv7a-hardfloat-linux-gnueabi/lib -L/usr/armv7a-hardfloat-linux-gnueabi/usr/lib -L/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/image//usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3 -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/crtendS.o /usr/armv7a-hardfloat-linux-gnueabi/usr/lib/crtn.o -pthread -O3 -Wl,-O1 -pthread -Wl,-soname -Wl,libgtest_main.so.0 -o lib/.libs/libgtest_main.so.0.0.0 /usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/lib/libm.so: file not recognized: File format not recognized collect2: error: ld returned 1 exit status libtool: error: error: relink 'lib/libgtest_main.la' with the above command before installing it Makefile:868: recipe for target 'install-libLTLIBRARIES' failed make[1]: *** [install-libLTLIBRARIES] Error 1 make[1]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-.arm' Makefile:1598: recipe for target 'install-am' failed make: *** [install-am] Error 2 * ERROR: dev-cpp/gtest-1.7.0::gentoo failed (install phase): * emake failed * * If you need support, post the output of `emerge --info '=dev-cpp/gtest-1.7.0::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-cpp/gtest-1.7.0::gentoo'`. * The complete build log is located at '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/temp/build.log'. * The ebuild environment file is located at '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/temp/environment'. * Working directory: '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-.arm' * S: '/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0'
I deleted all .la files I can find in the whole file system and that didn't help.
Apparently removing the bogus "-L/usr/lib" in the relink command line fixes things. I don't know how this translates to a ebuild fix though.
Created attachment 417916 [details] ebuild using cmake
A very possible workaround is to forget about libtools and instead use cmake. I created a minimal working ebuild (attached). You probably want to add back the IUSE flags support though.
FYI, the ebuild I attached was wrong (it didn't install the internal headers which are needed). The fix is straightforward though.
I'm positive regarding switching to cmake eventually, but what about multilib support? The autotools version also has some fixes for pthread linking (bug 371647). What about those? Would you be interested in working on the cmake port?
I don't know how to fix this (or even test a fix). Toolchain, can you help?
(In reply to Thomas Kahle from comment #7) try calling `elibtoolize --reverse-deps` in src_prepare
(In reply to SpanKY from comment #8) > (In reply to Thomas Kahle from comment #7) > > try calling `elibtoolize --reverse-deps` in src_prepare Thanks. I added 1.7.0-r1 with this. Yi Yang, can you test please?
A quick test (admittedly not so quick since one month has passed) seems to result in the same failure as before.