Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sys-libs/glibc-2.13-r4 - cannot execute binary file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
djmitche
n00b
n00b


Joined: 12 Dec 2011
Posts: 7

PostPosted: Mon Dec 12, 2011 5:03 am    Post subject: sys-libs/glibc-2.13-r4 - cannot execute binary file Reply with quote

My glibc-2.1-r4 build fails repeatably with an inability to execute a binary it has just created.

I'm not sure where to look, here. An interesting datapoint is that the already-installed 32-bit ld.so doesn't execute, either:

galois ~ # /lib32/ld-2.12.2.so
-bash: /lib32/ld-2.12.2.so: cannot execute binary file

I'm missing the background on the glibc build process and why it would be trying to build and run 32-bit binaries, if they don't run on this hardware anyway. And, while I'm at it, why don't these files run on this hardware? Could this be a kernel configuration error?

Here's the necessary data:

x86_64-pc-linux-gnu-gcc -m32 -nostdlib -nostartfiles -o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcgen -Wl,-dynamic-linker=/lib32/ld-linux.so.2 -Wl,--as-needed -Wl,-z,combreloc -Wl,-z,relro /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crt1.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crti.o `x86_64-pc-linux-gnu-gcc -m32 --print-file-name=crtbegin.o` /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_main.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_hout.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_cout.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_parse.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_scan.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_util.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_svcout.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_clntout.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_tblout.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpc_sample.o -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so.6 /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_nonshared.a -Wl,--as-needed /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed `x86_64-pc-linux-gnu-gcc -m32 --print-file-name=crtend.o` /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crtn.o
x86_64-pc-linux-gnu-gcc -m32 rpcinfo.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fno-strict-aliasing -march=core2 -pipe -Wstrict-prototypes -mpreferred-stack-boundary=2 -Wa,-mtune=i686 -I../include -I/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc -I/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DNOT_IN_libc=1 -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -D_RPC_THREAD_SAFE_ -o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcinfo.o -MD -MP -MF /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcinfo.o.dt -MT /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcinfo.o
x86_64-pc-linux-gnu-gcc -m32 -nostdlib -nostartfiles -o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcinfo -Wl,-dynamic-linker=/lib32/ld-linux.so.2 -Wl,--as-needed -Wl,-z,combreloc -Wl,-z,relro /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crt1.o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crti.o `x86_64-pc-linux-gnu-gcc -m32 --print-file-name=crtbegin.o` /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcinfo.o -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so.6 /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_nonshared.a -Wl,--as-needed /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so -Wl,--no-as-needed -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed `x86_64-pc-linux-gnu-gcc -m32 --print-file-name=crtend.o` /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/crtn.o
CPP='x86_64-pc-linux-gnu-gcc -m32 -E -x c-header' /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld-linux.so.2 --library-path /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.T
/bin/sh: /var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld-linux.so.2: cannot execute binary file
make[2]: *** [/var/tmp/portage/sys-libs/glibc-2.13-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sunrpc/xbootparam_prot.stmp] Error 126
make[2]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.13-r4/work/glibc-2.13/sunrpc'
make[1]: *** [sunrpc/others] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.13-r4/work/glibc-2.13'
make: *** [all] Error 2
emake failed
* ERROR: sys-libs/glibc-2.13-r4 failed (compile phase):
* make for x86 failed
*
* Call stack:
* ebuild.sh, line 56: Called src_compile
* environment, line 3750: Called eblit-run 'src_compile'
* environment, line 1211: Called eblit-glibc-src_compile
* src_compile.eblit, line 209: Called src_compile
* environment, line 3750: Called eblit-run 'src_compile'
* environment, line 1211: Called eblit-glibc-src_compile
* src_compile.eblit, line 217: Called toolchain-glibc_src_compile
* src_compile.eblit, line 129: Called die
* The specific snippet of code:
* emake || die "make for ${ABI} failed"
*
* If you need support, post the output of 'emerge --info =sys-libs/glibc-2.13-r4',
* the complete build log and the output of 'emerge -pqv =sys-libs/glibc-2.13-r4'.
* The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.13-r4/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.13-r4/temp/environment'.
* S: '/var/tmp/portage/sys-libs/glibc-2.13-r4/work/glibc-2.13'

galois ~ # cat /proc/cpuinfo | grep model\ name
model name : Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz
model name : Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz

galois ~ # emerge --info
Portage 2.1.10.11 (default/linux/amd64/10.0, gcc-4.4.5, glibc-2.12.2-r0, 2.6.39-gentoo-r3-2011111501 x86_64)
=================================================================
System uname: Linux-2.6.39-gentoo-r3-2011111501-x86_64-Intel-R-_Core-TM-2_CPU_T5600_@_1.83GHz-with-gentoo-2.0.3
Timestamp of tree: Mon, 05 Dec 2011 05:45:01 +0000
app-shells/bash: 4.1_p9
dev-lang/python: 2.7.2-r3, 3.1.4-r3
dev-util/pkgconfig: 0.26
sys-apps/baselayout: 2.0.3
sys-apps/openrc: 0.8.3-r1
sys-apps/sandbox: 2.4
sys-devel/autoconf: 2.68
sys-devel/automake: 1.11.1
sys-devel/binutils: 2.21.1-r1
sys-devel/gcc: 4.4.5, 4.5.3-r1
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool: 2.4-r1
sys-devel/make: 3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc: 2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://www.cyberuse.com/gentoo/ http://mirror.mcs.anl.gov/pub/gentoo/"
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre pppd readline session sse sse2 ssl sysfs tcpd threads unicode xml xml2 xorg zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 stage tables krita karbon braindump" 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 ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware 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, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Back to top
View user's profile Send private message
Aquous
l33t
l33t


Joined: 08 Jan 2011
Posts: 700

PostPosted: Mon Dec 12, 2011 7:42 am    Post subject: Reply with quote

Did you enable x86 binary support in your kernel .config?
Back to top
View user's profile Send private message
djmitche
n00b
n00b


Joined: 12 Dec 2011
Posts: 7

PostPosted: Mon Dec 12, 2011 3:33 pm    Post subject: Reply with quote

I'm having a hard time figuring out what option that translates to. I have ELF binary support enabled. What's the config symbol I should look for to check?
Back to top
View user's profile Send private message
palmer
Guru
Guru


Joined: 17 Nov 2004
Posts: 322
Location: Berkeley, CA

PostPosted: Mon Dec 12, 2011 11:17 pm    Post subject: Reply with quote

djmitche wrote:
I'm missing the background on the glibc build process and why it would be trying to build and run 32-bit binaries, if they don't run on this hardware anyway. And, while I'm at it, why don't these files run on this hardware?

I'm assuming you're running an amd64 (aka x86_64) machine, in which case the hardware is backwards compatible with x86 (which is 32-bit). Some programs are 32-bit only (usually they're proprietary), and these 32-bit programs require 32-bit libraries to work. Gentoo builds both 32-bit and 64-bit libraries so all code works. This process is known as "multilib", there's probably many descriptions that are better than mine on the internet.

djmitche wrote:
I'm having a hard time figuring out what option that translates to. I have ELF binary support enabled. What's the config symbol I should look for to check?


On my amd64 machine (which can execute 32-bit x86 binaries), I have (via "make menuconfig")
Code:
Executable file formats / Emulations  --->
    [*] Kernel support for ELF binaries
    [*] Write ELF core dumps with partial segments
    <*> Kernel support for MISC binaries
    [*] IA32 Emulation
    <*>   IA32 a.out support


If you're new te building kernels, Pappy's Kernel Seeds is a great resource.
http://kernel-seeds.org/
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21494

PostPosted: Tue Dec 13, 2011 3:00 am    Post subject: Reply with quote

To extend on the information that palmer provided, the Kconfig name you need to enable is CONFIG_IA32_EMULATION, which corresponds to the "IA32 Emulation" menu entry. You do not need IA32 a.out support to build/use multilib glibc. In my opinion, it is very unlikely that you would have an a.out executable and not know it. You also do not need Kernel support for MISC binaries to solve the problem in this thread. However, it is possible that your usage will require that for other purposes.
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Tue Dec 13, 2011 6:12 pm    Post subject: Reply with quote

If there are some kernel config options that if not set cause glibc not to compile, the ebuild should check for them (ideally at pkg_pretend time). Please consider filing a bug about that and posting the link to it here.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21494

PostPosted: Wed Dec 14, 2011 2:34 am    Post subject: Reply with quote

When use amd64 && use multilib, then IA32_EMULATION=y is required. However, please be careful with this check. I really hate ebuilds that demand a configured kernel just to build a non-kernel component. I have systems where the only reason to install a kernel source package is to deal with braindead ebuilds that needlessly die when they do not find kernel sources.
Back to top
View user's profile Send private message
djmitche
n00b
n00b


Joined: 12 Dec 2011
Posts: 7

PostPosted: Sun Jan 01, 2012 7:47 pm    Post subject: Reply with quote

Thanks! Adding that flag fixed the ebuild. I filed https://bugs.gentoo.org/show_bug.cgi?id=380903.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21494

PostPosted: Sun Jan 01, 2012 7:56 pm    Post subject: Reply with quote

Are you sure about that bug number? Even after adjusting for the unwanted dot in the URL, that takes me to sys-libs/glibc: Retain old versions of glibc for crossdev, which was filed several months ago and does not seem at all related to the problem at hand. I think you meant glibc ebuild should check for CONFIG_IA32_EMULATION in running kernel before building multilib, where you misattributed my concerns to phajdan.jr and you misunderstood them. My issue is that ebuilds which check the kernel configuration have a nasty tendency to fail to build when they either cannot find the kernel sources or cannot find configured kernel sources. I frequently have neither of those on an otherwise fully functional system, since I distribute kernel builds out from a single master machine, but let individual machines build their respective packages. This is a fairly common pattern in larger deployments. Kernels can be conveniently managed from a central point because of their relatively light build dependency list. Other packages often need to be built on the specific box to avoid polluting a build host with dozens of locally unnecessary support packages.

If you absolutely must test before building, test whether a 32-bit do-nothing program can be built and run. That both catches IA32_EMULATION=n and catches broken 32-bit environments, which a simple kernel configuration check will miss.
Back to top
View user's profile Send private message
djmitche
n00b
n00b


Joined: 12 Dec 2011
Posts: 7

PostPosted: Sun Jan 01, 2012 8:01 pm    Post subject: Reply with quote

Yah, sorry, I got that wrong on a few levels. Fixed in the bug, I hope.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21494

PostPosted: Sun Jan 01, 2012 9:38 pm    Post subject: Reply with quote

Much better, thanks. (I would chime in directly, but I do not maintain a bugzilla account.)

Your suggestion of /proc/config.gz is better than requiring kernel sources, but there is a problem with it. It is possible to exclude config.gz when building the kernel. I have had a few people on the forums fail to provide requested information because I assumed they would have it, but they did not. For interactive use, I can just tell them to go read their .config file in the kernel build tree. For automated use, that does not work. What I suggested above is that there be a new function, similar to the below, which would be called during early setup by ebuilds which know they must run 32-bit code on an amd64 system before the build completes.
Code:
# Untested
check_ia32_emulation_works() {
   use amd64 || return 0
   echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c"
   "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"
   "${T}/check-ia32-emulation.elf32" || die "IA32 emulation is broken.  Check your kernel and C library."
   rm -f "${T}/check-ia32-emulation.elf32"
}
This could optionally include regular $CFLAGS and $LDFLAGS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum