Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 566876 - dev-cpp/gtest fails the install step in cross-complation
Summary: dev-cpp/gtest fails the install step in cross-complation
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Kahle (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-26 05:26 UTC by Yi Yang
Modified: 2016-01-30 09:04 UTC (History)
1 user (show)

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


Attachments
ebuild using cmake (gtest-1.7.0-r1.ebuild,789 bytes, text/plain)
2015-11-26 08:11 UTC, Yi Yang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Yang 2015-11-26 05:26:06 UTC
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'
Comment 1 Yi Yang 2015-11-26 05:29:46 UTC
I deleted all .la files I can find in the whole file system and that didn't help.
Comment 2 Yi Yang 2015-11-26 05:31:33 UTC
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.
Comment 3 Yi Yang 2015-11-26 08:11:13 UTC
Created attachment 417916 [details]
ebuild using cmake
Comment 4 Yi Yang 2015-11-26 08:11:37 UTC
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.
Comment 5 Yi Yang 2015-11-26 08:18:04 UTC
FYI, the ebuild I attached was wrong (it didn't install the internal headers which are needed). The fix is straightforward though.
Comment 6 Thomas Kahle (RETIRED) gentoo-dev 2015-12-11 08:45:09 UTC
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?
Comment 7 Thomas Kahle (RETIRED) gentoo-dev 2015-12-21 10:18:28 UTC
I don't know how to fix this (or even test a fix).  Toolchain, can you help?
Comment 8 SpanKY gentoo-dev 2015-12-21 19:04:56 UTC
(In reply to Thomas Kahle from comment #7)

try calling `elibtoolize --reverse-deps` in src_prepare
Comment 9 Thomas Kahle (RETIRED) gentoo-dev 2015-12-22 08:59:22 UTC
(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?
Comment 10 Yi Yang 2016-01-30 09:04:54 UTC
A quick test (admittedly not so quick since one month has passed) seems to result in the same failure as before.