Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171849 - crossdev for arm works but link fails for armeb whilst linking uclibc
Summary: crossdev for arm works but link fails for armeb whilst linking uclibc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: ARM Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-22 20:51 UTC by H4rvy
Modified: 2007-06-30 12:11 UTC (History)
2 users (show)

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


Attachments
cross-armeb-softfloat-linux-uclibc-uclibc.log (cross-armeb-softfloat-linux-uclibc-uclibc.log,668.02 KB, text/plain)
2007-03-23 16:07 UTC, Karl H
Details
cross-armeb-softfloat-linux-uclibc-info.log (cross-armeb-softfloat-linux-uclibc-info.log,8.71 KB, text/plain)
2007-03-23 16:08 UTC, Karl H
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H4rvy 2007-03-22 20:51:56 UTC
I have tried with gcc 3.x 4.x and kernel from 2.11 to 2.20 and different binutils   however uclib always fails for armeb (works arm arm tho)

Reproducible: Always

Steps to Reproduce:
crossdev-stable -b 2.x -k 2.6.11-20 -g 3.x-4.x -l 0.28 -t armeb-softfloat-linux-uclibc
Actual Results:  
armeb-softfloat-linux-uclibc-ar cr libc.a misc/internals/static.o
armeb-softfloat-linux-uclibc-ranlib libc.a
armeb-softfloat-linux-uclibc-ld -EL -shared --warn-common --warn-once -z combreloc -z defs -s -z relro  -soname=libc.so.0 -o libuClibc-0.9.28.so \
                --whole-archive shared_libc.a \
                ../libc/misc/internals/interp.o --no-whole-archive \
                -init __uClibc_init ../lib/ld-uClibc.so.0 /usr/lib/gcc/armeb-softfloat-linux-uclibc/3.4.6/libgcc.a
armeb-softfloat-linux-uclibc-ld: /usr/lib/gcc/armeb-softfloat-linux-uclibc/3.4.6/libgcc.a(_udivsi3.o): compiled for a big endian system and target is little endian
armeb-softfloat-linux-uclibc-ld: failed to merge target specific data of file /usr/lib/gcc/armeb-softfloat-linux-uclibc/3.4.6/libgcc.a(_udivsi3.o)
armeb-softfloat-linux-uclibc-ld: /usr/lib/gcc/armeb-softfloat-linux-uclibc/3.4.6/libgcc.a(_divsi3.o): compiled for a big endian system and target is little endian
armeb-softfloat-linux-uclibc-ld: failed to merge target specific data of file /usr/lib/gcc/armeb-softfloat-linux-uclibc/3.4.6/libgcc.a(_divsi3.o)


Expected Results:  
working x-toolchain

Portage 2.1.2.2 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.4-r4, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 Processor 3400+
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 22 Mar 2007 01:00:01 +0000
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
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.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-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/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
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-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 berkdb bitmap-fonts cli cracklib crypt cups dri fortran gdbm gpm isdnlog libg++ midi ncurses nptl nptlonly pam pcre perl ppds pppd python readline reflection session spl ssl tcpd truetype-fonts type1-fonts unicode 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 mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark ati chips cirrus cyrix dummy fbdev glint i128 i810 mga neomagic nv rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 H4rvy 2007-03-22 21:21:04 UTC
from log

These are the packages that would be merged, in order:

[ebuild  N    ] cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1  USE="-build -debug -hardened -iconv -ipv6 -minimal -nls -pregen -savedconfig -uclibc-compat -userlocales -wordexp" 0 kB [1]

Total: 1 package (1 new), Size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/portage


>>> Emerging (1 of 1) cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1 to /
 * uClibc-0.9.28.1-patches-1.0.tar.bz2 RMD160 ;-) ...                                                                [ ok ]
 * uClibc-0.9.28.1-patches-1.0.tar.bz2 SHA1 ;-) ...                                                                  [ ok ]
 * uClibc-0.9.28.1-patches-1.0.tar.bz2 SHA256 ;-) ...                                                                [ ok ]
 * uClibc-0.9.28.1-patches-1.0.tar.bz2 size ;-) ...                                                                  [ ok ]
 * uClibc-0.9.28.1.tar.bz2 RMD160 ;-) ...                                                                            [ ok ]
 * uClibc-0.9.28.1.tar.bz2 SHA1 ;-) ...                                                                              [ ok ]
 * uClibc-0.9.28.1.tar.bz2 SHA256 ;-) ...                                                                            [ ok ]
 * uClibc-0.9.28.1.tar.bz2 size ;-) ...                                                                              [ ok ]
 * checking ebuild checksums ;-) ...                                                                                 [ ok ]
 * checking auxfile checksums ;-) ...                                                                                [ ok ]
 * checking miscfile checksums ;-) ...                                                                               [ ok ]
 * checking uClibc-0.9.28.1.tar.bz2 ;-) ...                                                                          [ ok ]
 * checking uClibc-0.9.28.1-patches-1.0.tar.bz2 ;-) ...                                                              [ ok ]
 * QA Notice: USE Flag 'crosscompile_opts_headers-only' not in IUSE for cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1
>>> Unpacking source...
>>> Unpacking uClibc-0.9.28.1.tar.bz2 to /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1/work
>>> Unpacking uClibc-0.9.28.1-patches-1.0.tar.bz2 to /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1/work
 * You really should consider setting UCLIBC_CPU
 * Otherwise, the build will be generic (read: slow).
 * Available CPU options:
GENERIC_ARM ARM610 ARM710 ARM720T ARM920T ARM922T ARM926T ARM_SA110 ARM_SA1100 ARM_XSCALE

 * Runtime Prefix: /
 * Devel Prefix:   /usr
 * Kernel Prefix:  /usr/armeb-softfloat-linux-uclibc/usr
 * CBUILD:         x86_64-pc-linux-gnu
 * CHOST:          x86_64-pc-linux-gnu
 * CTARGET:        armeb-softfloat-linux-uclibc
 * CPU:            GENERIC_ARM
<stdin>:1:20: error: endian.h: No such file or directory
 * ENDIAN:         little

>>> Unpacking uClibc-0.9.28.1-patches-1.0.tar.bz2 to /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.1/work/uClibc-0.9.28.1
 * Applying various patches (bugfixes/updates) ...
 *   34_all_uClibc-mips-sigaction.patch ...
  [ ok ]
 * Done with patching
 * Applying various patches (bugfixes/updates) ...
Comment 2 Karl H 2007-03-23 16:07:01 UTC
Created attachment 114144 [details]
cross-armeb-softfloat-linux-uclibc-uclibc.log

crossdev command line:

UCLIBC_CPU="ARM_XSCALE" USE="-*" crossdev -v \
--binutils 2.17 \
--gcc 3.4.6-r2 \
--kernel 2.6.19.7 \
--libc 0.9.28.1 \
--ex-gdb \
--target armeb-softfloat-linux-uclibc
Comment 3 Karl H 2007-03-23 16:08:16 UTC
Created attachment 114145 [details]
cross-armeb-softfloat-linux-uclibc-info.log
Comment 4 Karl H 2007-03-23 16:09:59 UTC
I have the same issue.. I used sys-devel/crossdev-0.9.18   Above i attached the build errors.
Comment 5 Karl H 2007-03-25 14:25:36 UTC
This looks like a problem with the uclibc ebuild not correctly configuring endianness.

> 1. Little Endian (ARCH_LITTLE_ENDIAN)
  2. Big Endian (ARCH_BIG_ENDIAN)

I hardcoded the uclibc ebuild to:
echo "ARCH_BIG_ENDIAN=y" >> .config

And now crossdev will build my armeb-softfloat-linux-uclibc toolchain.

in the uclibc ebuild there is a function that looks broken:

uclibc_endian() {
        printf "#include <endian.h>\n#if __BYTE_ORDER == __LITTLE_ENDIAN\nlittle\n#else\nbig\n#endif\n" \
                | $(tc-getCPP ${CTARGET}) - \
                | tail -n 1
}

Comment 6 H4rvy 2007-03-26 19:32:43 UTC
or the xx-cpp not being able to locate the endian.h header in its search path
Comment 7 Karl H 2007-04-01 13:41:57 UTC
(In reply to comment #6)
> or the xx-cpp not being able to locate the endian.h header in its search path
> 

Yes, in this case it is not finding/searching /usr/armeb-softfloat-linux-uclibc/usr/include/endian.h
Comment 8 eightdot 2007-05-17 18:47:24 UTC
(In reply to comment #6)
> or the xx-cpp not being able to locate the endian.h header in its search path
> 

copying /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/include/endian.h 
to
/usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.2/include/endian.h
and
/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/include/bits/endian.h
to
/usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.2/include/bits/endian.h

solves the problem on my box.

but maybe it is better to fix uclibc_endian() to give a -I argument to cpp
in /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/build-info/uclibc-0.9.28.3.ebuild
and some more files

but i stiil get a error futher on...


Comment 9 Laurynas Ruskys 2007-06-02 14:58:55 UTC
(In reply to comment #8)
> but maybe it is better to fix uclibc_endian() to give a -I argument to cpp
> in
> /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/build-info/uclibc-0.9.28.3.ebuild
> and some more files

I have tried adding -I argument pointing to portage working directory, but that did not work - uclibc needs to be configured before it can tell you what is it's endianness.

I guess the only suitable way for this to be solved is to add an option to crossdev to explicitly specify the target endianness..
Comment 10 kc 2007-06-06 01:54:59 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > or the xx-cpp not being able to locate the endian.h header in its search path
> > 
> 
> copying
> /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/include/endian.h 
> to
> /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.2/include/endian.h
> and
> /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/include/bits/endian.h
> to
> /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.2/include/bits/endian.h
> 
> solves the problem on my box.
> 
> but maybe it is better to fix uclibc_endian() to give a -I argument to cpp
> in
> /var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/build-info/uclibc-0.9.28.3.ebuild
> and some more files
> 
> but i stiil get a error futher on...
> 

I also get an error further on; asm/page.h is missing. I'm not sure where to find that. 
ioperm.c:47:22: error: asm/page.h: No such file or directory
make[4]: *** [ioperm.o] Error 1
make[4]: *** Waiting for unfinished jobs....
armeb-softfloat-linux-uclibc-strip -x -R .note -R .comment syscall.o
make[4]: Leaving directory `/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/libc/sysdeps/linux/arm'
make[3]: *** [arm] Error 2
make[3]: Leaving directory `/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/libc/sysdeps/linux'
make[2]: *** [_dir_linux] Error 2
make[2]: Leaving directory `/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/libc/sysdeps'
make[1]: *** [_dir_sysdeps] Error 2
make[1]: Leaving directory `/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/work/uClibc-0.9.28.3/libc'
make: *** [_dir_libc] Error 2

!!! ERROR: cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3 failed.
Call stack:
  ebuild.sh, line 1615:   Called dyn_compile
  ebuild.sh, line 972:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  uclibc-0.9.28.3.ebuild, line 387:   Called die

!!! make 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/cross/armeb-softfloat-linux-uclibc/portage/cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28.3/temp/build.log'.

!!! This ebuild is from an overlay: '/usr/local/portage'



Comment 11 SpanKY gentoo-dev 2007-06-30 12:11:41 UTC
fixed in cvs