Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581774 - app-misc/pax-utils-1.1.6 with CHOST=x86_64-pc-linux-uclibc: /usr/x86_64-pc-linux-uclibc/usr/lib/crt1.o: In function `_start': (.text+0x25): undefined reference to `__uClibc_main'
Summary: app-misc/pax-utils-1.1.6 with CHOST=x86_64-pc-linux-uclibc: /usr/x86_64-pc-li...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-01 22:49 UTC by Sven E.
Modified: 2016-05-03 04:36 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2016-05-01 22:49:07 UTC
app-misc/pax-utils-1.1.6 fails to cross build with undefined reference to `__uClibc_main'.

Reproducible: Always

Actual Results:  
Build failure:
/usr/x86_64-pc-linux-uclibc/usr/lib/crt1.o: In function `_start':
(.text+0x25): undefined reference to `__uClibc_main'
collect2: error: ld returned 1 exit status
Makefile:117: recipe for target 'dumpelf' failed


Expected Results:  
Clean build

The failure seems to be related to libseccomp. pax-utils[-seccomp] emerges just fine.

I am not that familiar with libseccomp, but does libseccomp somehow mangle the start section? Or the libc's entry point somehow?
Comment 1 SpanKY gentoo-dev 2016-05-03 00:15:29 UTC
you must provide `emerge --info` and full build logs as attachments with every bug report.  it's pretty difficult to triage when you don't.
Comment 2 Sven E. 2016-05-03 00:32:49 UTC
Portage 2.2.28 (python 2.7.11-final-0, hardened/linux/uclibc/amd64, gcc-5.3.0, uclibc-0.9.33.2-r15, 4.4.6-hardened-r2 x86_64)
=================================================================
System uname: Linux-4.4.6-hardened-r2-x86_64-AMD_A10-5700_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.2
KiB Mem:     6104820 total,   3923880 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 02 May 2016 01:30:01 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:     4.3_p42-r2::gentoo
dev-lang/python:     2.7.11-r2::gentoo
sys-apps/baselayout: 2.2::gentoo
sys-apps/openrc:     0.20.5::gentoo
sys-libs/uclibc:     0.9.33.2-r15::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-uclibc"
CONFIG_PROTECT="/etc /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/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/x86_64-pc-linux-uclibc/packages/"
PORTAGE_CONFIGROOT="/usr/x86_64-pc-linux-uclibc/"
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="/usr/x86_64-pc-linux-uclibc/tmp/"
USE="amd64 cli cracklib crypt cxx dri fortran hardened iconv ipv6 modules ncurses nptl openmp pax_kernel pcre pic readline seccomp session ssl tcpd uclibc unicode xattr zlib" ABI_X86="64" 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" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="uclibc" 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_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="dummy fbdev 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, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 3 Sven E. 2016-05-03 00:33:58 UTC
 * Package:    app-misc/pax-utils-1.1.6
 * Repository: gentoo
 * Maintainer: vapier@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_uclibc kernel_linux seccomp uclibc userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking pax-utils-1.1.6.tar.xz to /usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work
>>> Source unpacked in /usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work
>>> Preparing source in /usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6 ...
>>> Source prepared.
>>> Configuring source in /usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6 ...
>>> Source configured.
>>> Compiling source in /usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6 ...
make -j2 USE_CAP=no USE_DEBUG=no USE_PYTHON=no USE_SECCOMP=yes 
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o paxelf.o -c paxelf.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o paxmacho.o -c paxmacho.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o paxinc.o -c paxinc.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o security.o -c security.c
security.c: In function ‘pax_seccomp_sigal’:
security.c:45:52: warning: unused parameter ‘info’ [-Wunused-parameter]
 pax_seccomp_sigal(__unused__ int signo, siginfo_t *info, __unused__ void *context)
                                                    ^
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o xfuncs.o -c xfuncs.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o scanelf.o -c scanelf.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o dumpelf.o -c dumpelf.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o pspax.o -c pspax.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DWANT_SECCOMP -DVERSION="v1.1.6" -DVCSID="" -o scanmacho.o -c scanmacho.c
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed  paxelf.o paxinc.o security.o xfuncs.o dumpelf.o -o dumpelf  -L/usr/lib -lseccomp 
/usr/x86_64-pc-linux-uclibc/usr/lib/crt1.o: In function `_start':
(.text+0x25): undefined reference to `__uClibc_main'
collect2: error: ld returned 1 exit status
Makefile:117: recipe for target 'dumpelf' failed
make: *** [dumpelf] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: app-misc/pax-utils-1.1.6::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-misc/pax-utils-1.1.6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-misc/pax-utils-1.1.6::gentoo'`.
 * The complete build log is located at '/usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/temp/build.log'.
 * The ebuild environment file is located at '/usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/temp/environment'.
 * Working directory: '/usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6'
 * S: '/usr/x86_64-pc-linux-uclibc/tmp/portage/app-misc/pax-utils-1.1.6/work/pax-utils-1.1.6'
Comment 4 Sven E. 2016-05-03 00:46:59 UTC
I think I just realized what happens:
x86_64-pc-linux-uclibc-gcc -O2 -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed  paxelf.o paxinc.o security.o xfuncs.o dumpelf.o -o dumpelf  -L/usr/lib -lseccomp 

-L/usr/lib <- Doesn't that pull in libseccomp from the host, instead of the one in the target root?
Comment 5 SpanKY gentoo-dev 2016-05-03 01:13:04 UTC
update the ebuild like so and see if it helps:
-        tc-export CC
+        tc-export CC PKG_CONFIG
Comment 6 Sven E. 2016-05-03 01:19:18 UTC
Build works fine now and execution (simple call with -h) seems to work.

Am I getting this right?: PKG_CONFIG gets exported and thus the cross toolchain's pkg-config is used instead of the host one's?
Comment 7 SpanKY gentoo-dev 2016-05-03 04:36:54 UTC
(In reply to Sven E. from comment #6)

correct.  the default is `pkg-config` which gives bad results when cross-compiling.  should be fixed by:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce30220ac33c02c8cd1e6ad87f57026e6fd4b0b0