Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169310 - dev-util/ltrace-0.4 does not cross compile
Summary: dev-util/ltrace-0.4 does not cross compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Development Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-04 16:14 UTC by Petteri Räty (RETIRED)
Modified: 2007-03-10 00:26 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,7.13 KB, text/plain)
2007-03-04 16:14 UTC, Petteri Räty (RETIRED)
Details
0.4-cross-compile.patch (0.4-cross-compile.patch,1.84 KB, patch)
2007-03-07 23:45 UTC, Petteri Räty (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2007-03-04 16:14:18 UTC
make[2]: Entering directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/x86_64'
i686-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"  -I/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/x86_64  -c -o trace.o trace.c
i686-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"   -c -o options.o options.c
trace.c: In function 'syscall_p':
trace.c:41: error: 'ORIG_RAX' undeclared (first use in this function)
trace.c:41: error: (Each undeclared identifier is reported only once
trace.c:41: error: for each function it appears in.)
trace.c: In function 'gimme_arg32':
trace.c:59: error: 'RAX' undeclared (first use in this function)
trace.c:68: error: 'RBX' undeclared (first use in this function)
trace.c:70: error: 'RCX' undeclared (first use in this function)
trace.c:72: error: 'RDX' undeclared (first use in this function)
trace.c:74: error: 'RSI' undeclared (first use in this function)
trace.c:76: error: 'RDI' undeclared (first use in this function)
trace.c:78: error: 'RBP' undeclared (first use in this function)
trace.c: In function 'gimme_arg':
trace.c:95: error: 'RAX' undeclared (first use in this function)
trace.c:101: error: 'RDI' undeclared (first use in this function)
trace.c:103: error: 'RSI' undeclared (first use in this function)
trace.c:105: error: 'RDX' undeclared (first use in this function)
trace.c:107: error: 'RCX' undeclared (first use in this function)
trace.c:109: error: 'R8' undeclared (first use in this function)
trace.c:111: error: 'R9' undeclared (first use in this function)
trace.c:126: error: 'R10' undeclared (first use in this function)
make[2]: *** [trace.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/x86_64'
make[1]: *** [x86_64/arch.o] Error 2
make[1]: Leaving directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu'
make: *** [sysdeps/sysdep.o] Error 2
make: *** Waiting for unfinished jobs....

!!! ERROR: dev-util/ltrace-0.4 failed.
Call stack:
  ebuild.sh, line 1614:   Called dyn_compile
  ebuild.sh, line 971:   Called qa_call 'src_compile'
  environment, line 3111:   Called src_compile
  ebuild.sh, line 645:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/tmp/portage/dev-util/ltrace-0.4/temp/build.log'.

This most likely has something to do with me having a cross compiler for amd64 installed. 

Portage 2.1.2-r12 (default-linux/x86/2006.1/desktop, gcc-4.1.2, glibc-2.5-r0, 2.6.21-rc2 i686)
=================================================================
System uname: 2.6.21-rc2 i686 Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz
Gentoo Base System version 1.13.0_alpha12
Timestamp of tree: Unknown
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4, 2.5-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.20-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer"
DISTDIR="/var/distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-protect cvs distlocks fixpackages java-strict parallel-fetch sandbox sfperms sign strict userpriv usersandbox verify-rdepend"
GENTOO_MIRRORS=" http://trumpetti.atm.tut.fi/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="fi"
MAKEOPTS="-j2"
PKGDIR="/home/pkg/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-* --prune-empty-dirs"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/mnt/checkouts/overlays/betelgeuse"
SYNC="rsync://192.168.150.1:/portage"
USE="a52 aac acl acpi alsa audiofile bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo cdb cddb cdparanoia cdr cli cracklib crypt cups dbus dri dts dvd dvdr dvdread emboss esd fam ffmpeg firefox gif gstreamer hal iconv isdnlog java jpeg kde kdeenablefinal kdehiddenvisibility libg++ logitech-mouse mad mikmod mjpeg mmx mp3 mpeg ncurses network nptl nptlonly nsplugin nvidia offensive ogg opengl pam pcre png ppds pppd qt3 quicktime readline real reflection rtc samba session spell spl sse sse2 ssl startup-notification subversion svg symlink theora threads truetype truetype-fonts type1-fonts udev unicode usb userlocales vim-syntax vorbis x86 xcb xcomposite xinerama xml xorg xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fi" USERLAND="GNU" VIDEO_CARDS="none nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2007-03-04 16:14:35 UTC
Created attachment 112069 [details]
build.log
Comment 2 Josef Reidinger 2007-03-06 19:45:20 UTC
(In reply to comment #0)

All this constants is defined in /usr/include/gentoo-multilib/amd64/sys/reg.h which have glibc. Look if you have this header. This variable isn't defined in x86 multilib, so maybe bad header is taken.
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2007-03-06 20:17:34 UTC
(In reply to comment #2)
> (In reply to comment #0)
> 
> All this constants is defined in /usr/include/gentoo-multilib/amd64/sys/reg.h
> which have glibc. Look if you have this header. This variable isn't defined in
> x86 multilib, so maybe bad header is taken.
> 

Nope I don't have this one. I think multilib is something you only install on amd64 systems. I am running an x86 install here.
Comment 4 Josef Reidinger 2007-03-06 23:24:39 UTC
(In reply to comment #3)
Problem is still same, you must include 64bit header instead 32bit (I mean header for 64bit library). That header own glibc, so you must have 64bit glibc with correct header, you cannot link 64bit code with 32lib. If you have 64bit lib and correct header, then you must include correct header.
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 11:21:36 UTC
(In reply to comment #4)
> (In reply to comment #3)
> Problem is still same, you must include 64bit header instead 32bit (I mean
> header for 64bit library). That header own glibc, so you must have 64bit glibc
> with correct header, you cannot link 64bit code with 32lib. If you have 64bit
> lib and correct header, then you must include correct header.
> 

Please try to understand that I am not cross compiling. I just have a cross compiler installed. I just want it to build a regular 32 bit install.
Comment 6 Josef Reidinger 2007-03-07 11:57:02 UTC
(In reply to comment #5)
So if you want 32bit code, you must set 32bit march (prescott isntead nocona) also -m32 say that you want 32bit code.
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 12:05:58 UTC
(In reply to comment #6)
> (In reply to comment #5)
> So if you want 32bit code, you must set 32bit march (prescott isntead nocona)
> also -m32 say that you want 32bit code.
> 

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

-march=nocona is valid for i686-pc-linux-gnu and that compiler does not need -m32 because 32 bit code is the only one it knows to generate. If you actually take the time to read the bug description, you will see that it's not using x86_64-pc-linux-gnu as the compiler.
Comment 8 Josef Reidinger 2007-03-07 12:23:00 UTC
(In reply to comment #7)

> http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
> 
> -march=nocona is valid for i686-pc-linux-gnu and that compiler does not need
> -m32 because 32 bit code is the only one it knows to generate. If you actually
> take the time to read the bug description, you will see that it's not using
> x86_64-pc-linux-gnu as the compiler.
> 

OK, I don't know it...So when I go home, I look on what depend selecting architecture at ltrace.
Comment 9 Josef Reidinger 2007-03-07 21:09:47 UTC
(In reply to comment #8)
OK, I found what switch architecture:
ARCH    :=  $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
      -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)

so that mean, that your uname must return x86_64...I don't know if this is standard value for your system, if you know better switch mechanism, you can try it.
Comment 10 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 21:20:55 UTC
(In reply to comment #9)
> (In reply to comment #8)
> OK, I found what switch architecture:
> ARCH    :=  $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
>       -e s/arm.*/arm/ -e s/sa110/arm/ -e s/ppc64/ppc/ -e s/s390x/s390/)
> 
> so that mean, that your uname must return x86_64...I don't know if this is
> standard value for your system, if you know better switch mechanism, you can
> try it.
> 

My uname -m is just fine 

betelgeuse@pena /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu $ uname -m
i686

But I did find this:

betelgeuse@pena /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu $ cat README

<snip first two entries>

* NOTE: This does not currently work for cross-compilers; Maybe
  I should guess the architecture using `gcc -print-libgcc-file-name'
  instead of `uname -m' (or even better, use the value returned by autoconf)


Comment 11 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 21:38:20 UTC
Hmm. Weird it builds just fine when I manually build under my own account. Let's see if some funky env vars effect this.
Comment 12 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 23:02:51 UTC
(In reply to comment #11)
> Hmm. Weird it builds just fine when I manually build under my own account.
> Let's see if some funky env vars effect this.
> 

Ok. I had some broken emake magic that defined ARCH. It emerges just fine when I removed that one. Well it is not cross compilable so changing the title.

x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"  -I/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386  -c -o trace.o trace.c
x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"  -I/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386  -c -o proc.o proc.c
x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"   -c -o options.o options.c
x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"  -I/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386  -c -o breakpoint.o breakpoint.c
make -C i386
make[2]: Entering directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386'
x86_64-pc-linux-gnu-gcc -Wall -O2 -march=nocona -pipe -fomit-frame-pointer -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4 -iquote /var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc\"  -I/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386  -c -o trace.o trace.c
trace.c: In function 'syscall_p':
trace.c:32: error: 'ORIG_EAX' undeclared (first use in this function)
trace.c:32: error: (Each undeclared identifier is reported only once
trace.c:32: error: for each function it appears in.)
trace.c: In function 'gimme_arg':
trace.c:49: error: 'EAX' undeclared (first use in this function)
make[2]: *** [trace.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu/i386'
make[1]: *** [i386/arch.o] Error 2
make[1]: Leaving directory `/var/tmp/portage/dev-util/ltrace-0.4/work/ltrace-0.4/sysdeps/linux-gnu'
make: *** [sysdeps/sysdep.o] Error 2
make: *** Waiting for unfinished jobs....
Comment 13 Josef Reidinger 2007-03-07 23:12:16 UTC
(In reply to comment #12)
Interesting, in  /usr/include/sys/reg.h is defined this constant for 32bit computers (or 64bit), can you please attach this file?
Comment 14 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 23:45:19 UTC
Created attachment 112499 [details, diff]
0.4-cross-compile.patch

This patch should fix it by taking advantage of autotools.
Comment 15 Petteri Räty (RETIRED) gentoo-dev 2007-03-07 23:47:05 UTC
Can someone from base-system review my patch as you probably know a lot more about  autotools than I do.
https://bugs.gentoo.org/attachment.cgi?id=112499
Comment 16 Petteri Räty (RETIRED) gentoo-dev 2007-03-10 00:26:32 UTC
vapier said the patch is ok so the patch committed and submitted to upstream.