Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 555876 - sys-devel/gettext-0.19.4 fails to install when cross-emerging
Summary: sys-devel/gettext-0.19.4 fails to install when cross-emerging
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 557110 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-25 15:00 UTC by James Bates
Modified: 2016-03-11 21:20 UTC (History)
1 user (show)

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


Attachments
gettext-0.19.4-crossdev-build.log (build.log.bz2,41.26 KB, application/x-bzip)
2015-07-25 15:03 UTC, James Bates
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Bates 2015-07-25 15:00:26 UTC
crossdev version 20150602
CBUILD="x86_64-pc-linux-gnu"
CHOST="armv7a-hardfloat-linux-gnueabi"
libtool (GNU libtool) 2.4.6

The stated purpose of crossdev is to be able to cross-build a stage1 for a foreign architecture, so that it can subsequently be bootstrapped natively. I would therefore expect all stage1 requirements to cross-build cleanly.
 
While attempting to cross-emerge gettext-0.19.4, which is a required package for stage1 (it is listed in /usr/portage/profiles/default/linux/packages.build), the following error occurs:

/bin/sh ../libtool --mode=install /usr/bin/install -c urlget /usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/image//usr/lib/gettext/urlget
libtool: warning: '../gnulib-lib/libgettextlib.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/urlget /usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/image//usr/lib/gettext/urlget
/usr/bin/install -c user-email /usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/image//usr/lib/gettext/user-email
/usr/bin/install -c /usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4/gettext-tools/src/project-id /usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/image//usr/lib/gettext/project-id
libtool: relink: armv7a-hardfloat-linux-gnueabi-gcc -std=gnu99 -shared  -fPIC -DPIC  .libs/libgettextsrc_la-message.o .libs/libgettextsrc_la-po-error.o .libs/libgettextsrc_la-po-xerror.o .libs/libgettextsrc_la-read-catalog-abstract.o .libs/libgettextsrc_la-po-lex.o .libs/libgettextsrc_la-po-gram-gen.o .libs/libgettextsrc_la-po-charset.o .libs/libgettextsrc_la-read-po.o .libs/libgettextsrc_la-read-properties.o .libs/libgettextsrc_la-read-stringtable.o .libs/libgettextsrc_la-open-catalog.o .libs/libgettextsrc_la-dir-list.o .libs/libgettextsrc_la-str-list.o .libs/libgettextsrc_la-read-catalog.o .libs/libgettextsrc_la-color.o .libs/libgettextsrc_la-write-catalog.o .libs/libgettextsrc_la-write-properties.o .libs/libgettextsrc_la-write-stringtable.o .libs/libgettextsrc_la-write-po.o .libs/libgettextsrc_la-msgl-ascii.o .libs/libgettextsrc_la-msgl-iconv.o .libs/libgettextsrc_la-msgl-equal.o .libs/libgettextsrc_la-msgl-cat.o .libs/libgettextsrc_la-msgl-header.o .libs/libgettextsrc_la-msgl-english.o .libs/libgettextsrc_la-msgl-check.o .libs/libgettextsrc_la-file-list.o .libs/libgettextsrc_la-msgl-charset.o .libs/libgettextsrc_la-po-time.o .libs/libgettextsrc_la-plural-exp.o .libs/libgettextsrc_la-plural-eval.o .libs/libgettextsrc_la-plural-table.o .libs/libgettextsrc_la-format.o .libs/libgettextsrc_la-format-c.o .libs/libgettextsrc_la-format-sh.o .libs/libgettextsrc_la-format-python.o .libs/libgettextsrc_la-format-python-brace.o .libs/libgettextsrc_la-format-lisp.o .libs/libgettextsrc_la-format-elisp.o .libs/libgettextsrc_la-format-librep.o .libs/libgettextsrc_la-format-scheme.o .libs/libgettextsrc_la-format-java.o .libs/libgettextsrc_la-format-csharp.o .libs/libgettextsrc_la-format-awk.o .libs/libgettextsrc_la-format-pascal.o .libs/libgettextsrc_la-format-ycp.o .libs/libgettextsrc_la-format-tcl.o .libs/libgettextsrc_la-format-perl.o .libs/libgettextsrc_la-format-perl-brace.o .libs/libgettextsrc_la-format-php.o .libs/libgettextsrc_la-format-gcc-internal.o .libs/libgettextsrc_la-format-gfc-internal.o .libs/libgettextsrc_la-format-qt.o .libs/libgettextsrc_la-format-qt-plural.o .libs/libgettextsrc_la-format-kde.o .libs/libgettextsrc_la-format-boost.o .libs/libgettextsrc_la-format-lua.o .libs/libgettextsrc_la-format-javascript.o .libs/libgettextsrc_la-read-desktop.o   -L/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/image//usr/lib -L/usr/lib -lgettextlib -lc  -O2 -mtune=cortex-a7 -Wl,-O1 -Wl,--as-needed   -Wl,-soname -Wl,libgettextsrc-0.19.4.so -o .libs/libgettextsrc-0.19.4.so
/usr/libexec/gcc/armv7a-hardfloat-linux-gnueabi/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/lib/libc.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
libtool:   error: error: relink 'libgettextsrc.la' with the above command before installing it
Makefile:2268: recipe for target 'install-libLTLIBRARIES' failed
make[5]: *** [install-libLTLIBRARIES] Error 1
make[5]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4-.arm/gettext-tools/src'
Makefile:3256: recipe for target 'install-am' failed
make[4]: *** [install-am] Error 2
make[4]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4-.arm/gettext-tools/src'
Makefile:3250: recipe for target 'install' failed
make[3]: *** [install] Error 2
make[3]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4-.arm/gettext-tools/src'
Makefile:1721: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4-.arm/gettext-tools'
Makefile:369: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/usr/armv7a-hardfloat-linux-gnueabi/var/tmp/portage/portage/sys-devel/gettext-0.19.4/work/gettext-0.19.4-.arm'
Makefile:666: recipe for target 'install' failed
make: *** [install] Error 2


The error occurs during the "install" emerge phase. As you can see from the link command it is trying to execute, it is trying to link with libc and with libgettextlib in the buildhosts's /usr/lib, which is OBVIOUSLY wrong (causing ld to find an incomaptible arch libc.so, and, rightly, complain). As far as I can tell from the Makefile.am's in gettext, there is no explicit reference to /usr/lib in there, and the gettext ebuild does issue a libtoolize call during the "setup" phase. I therefore suspect that libtool is doing something really stupid (by adding the "-L/usr/lib" to the link command), though I don't know libtool's internals well enough to be able to fix it.

Attached is the complete build log, and below is the output from armv7a-hardfloat-linux-gnueabi-emerge --info

Portage 2.2.20 (python 2.7.9-final-0, default/linux/arm/13.0/armv7a, gcc-4.8.4, unavailable, 4.0.5-gentoo x86_64)
=================================================================
System uname: Linux-4.0.5-gentoo-x86_64-Intel-R-_Core-TM-_i5-2467M_CPU_@_1.60GHz-with-gentoo-2.2
KiB Mem:     3957792 total,    324164 free
KiB Swap:    3132412 total,   2539524 free
Timestamp of repository gentoo: Sat, 18 Jul 2015 08:30:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p33-r2::gentoo
dev-lang/python:          2.7.9-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.8.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -mtune=cortex-a7 -pipe -fomit-frame-pointer"
CHOST="armv7a-hardfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mtune=cortex-a7 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe -march=armv7-a"
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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe -march=armv7-a"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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/var/tmp/portage/"
USE="arm armv5te armv6 armv6t2 berkdb bzip2 cli cracklib crypt cxx dri gdbm iconv ipv6 modules ncurses nls nptl openmp pcre readline session ssl tcpd unicode 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 python3_3" RUBY_TARGETS="ruby19 ruby20" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 James Bates 2015-07-25 15:03:38 UTC
Created attachment 407602 [details]
gettext-0.19.4-crossdev-build.log
Comment 2 SpanKY gentoo-dev 2015-08-06 16:03:02 UTC
the stated purpose of crossdev is not to cross-build a stage1.  it's to build a cross-compiler.  you might be confusing "gcc stage1" with "gentoo stage1".
Comment 3 Pacho Ramos gentoo-dev 2015-08-13 11:11:00 UTC
*** Bug 557110 has been marked as a duplicate of this bug. ***
Comment 4 Chris Mansfield 2016-01-11 16:06:25 UTC
I'm getting the exact same error message when trying to cross-compile using armv7a-hardfloat-linux-gnueabi-emerge. It is trying to pull in /usr/lib/libm.so which is from my amd64 host system.

It looks like this same problem was fixed for an earlier version of gettext on bug #260794. Maybe the same fix just needs to be reapplied?
Comment 5 Steve Arnold gentoo-dev 2016-03-11 21:20:26 UTC
Can you apply this hack to gettext and try it with your emerge wrapper?

@@ -6,7 +6,7 @@
 
 EAPI="5"
 
-inherit eutils mono-env libtool java-pkg-opt-2 multilib-minimal
+inherit eutils flag-o-matic mono-env libtool java-pkg-opt-2 multilib-minimal toolchain-funcs
 
 DESCRIPTION="GNU locale utilities"
 HOMEPAGE="https://www.gnu.org/software/gettext/"
@@ -54,6 +54,14 @@
 }
 
 multilib_src_configure() {
+	append-libs "-lm"  # needs this on arm64 or with -flto
+
+	if tc-is-cross-compiler ; then
+	        PKG_CONFIG_LIBDIR="${SYSROOT}/usr/$(get_libdir)/pkgconfig"
+		tc-export PKG_CONFIG
+        	append-libs "-L${SYSROOT}/$(get_libdir) -L${SYSROOT}/usr/$(get_libdir)"
+	fi
+
 	local myconf=(
 		# switches common to runtime and top-level
 		--cache-file="${BUILD_DIR}"/config.cache