Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
uclibc using crossdev fails for ARM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
Abraxa
Apprentice
Apprentice


Joined: 14 Jun 2005
Posts: 172
Location: Germany

PostPosted: Sun Dec 31, 2006 11:32 pm    Post subject: uclibc using crossdev fails for ARM Reply with quote

I'm trying to compile the toolchain for ARM using crossdev and I can't get uclibc to compile.
If I do a crossdev armeb-softfloat-linux-uclibc it tries to emerge uclibc 0.9.28-r1 and I get this output:

Code:
armeb-softfloat-linux-uclibc-ld -EB -shared --warn-common --warn-once -z combreloc -z defs -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/4.1.1/libgcc.a
armeb-softfloat-linux-uclibc-ld: ERROR: /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.1/libgcc.a(_udivsi3.o) uses VFP instructions, whereas libuClibc-0.9.28.so does not
armeb-softfloat-linux-uclibc-ld: failed to merge target specific data of file /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.1/libgcc.a(_udivsi3.o)
armeb-softfloat-linux-uclibc-ld: ERROR: /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.1/libgcc.a(_divsi3.o) uses VFP instructions, whereas libuClibc-0.9.28.so does not
armeb-softfloat-linux-uclibc-ld: failed to merge target specific data of file /usr/lib/gcc/armeb-softfloat-linux-uclibc/4.1.1/libgcc.a(_divsi3.o)

...

make[1]: *** [shared] Error 1
make[1]: Leaving directory `/var/tmp/cross/armeb-softfloat-linux-uclibc/portage/uclibc-0.9.28-r1/work/uClibc-0.9.28/libc'
make: *** [shared] Error 2

!!! ERROR: cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28-r1 failed.


I also tried setting UCLIBC_CPU to ARM_XSCALE with the same result.
If I enable the SVN source fetching in the ebuild I get the following error, regardless of which CPU I set for UCLIBC_CPU:

Code:
  CC librt/timer_settime.os
  CC ldso/libdl/libdl.os
  AS ldso/ldso/arm/resolve.os
In file included from ./ldso/include/dl-string.h:11,
                 from ./ldso/include/ldso.h:37,
                 from ldso/libdl/libdl.c:33:
./ldso/ldso/arm/dl-sysdep.h: In function 'elf_machine_load_address':
./ldso/ldso/arm/dl-sysdep.h:110: warning: nested extern declaration of '__dl_start'
  CC libpthread/linuxthreads.old/pthread.os
  CC libc/sysdeps/linux/arm/brk.os
  CC libc/sysdeps/linux/arm/ioperm.os
  CC libc/sysdeps/linux/arm/iopl.os
  CC libc/sysdeps/linux/arm/mmap.os
  CC libc/sysdeps/linux/arm/sigaction.os
  CC libc/sysdeps/linux/arm/__syscall_error.os
  CC libc/sysdeps/linux/arm/syscall.os
libc/sysdeps/linux/arm/syscall.c:16: warning: no previous prototype for 'syscall'
libc/sysdeps/linux/arm/syscall.c: In function 'syscall':
libc/sysdeps/linux/arm/syscall.c:28: error: '__NR_syscall' undeclared (first use in this function)
libc/sysdeps/linux/arm/syscall.c:28: error: (Each undeclared identifier is reported only once
libc/sysdeps/linux/arm/syscall.c:28: error: for each function it appears in.)
  AS libc/sysdeps/linux/arm/__longjmp.os
make: *** [libc/sysdeps/linux/arm/syscall.os] Error 1
make: *** Waiting for unfinished jobs....
libc/sysdeps/linux/arm/__longjmp.S: Assembler messages:
libc/sysdeps/linux/arm/__longjmp.S:60: Error: selected processor does not support `lfmfd f4,4,[ip]!'
make: *** [libc/sysdeps/linux/arm/__longjmp.os] Error 1

!!! ERROR: cross-armeb-softfloat-linux-uclibc/uclibc-0.9.28-r1 failed.



Here's the relevant parts of the info log:

Code:
------------------------------------------------------------------------------------------------------------------------------
 * Host Portage ARCH:     x86
 * Target Portage ARCH:   arm
 * Target System:         armeb-softfloat-linux-uclibc
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               linux-headers-[latest]
 * libc:                  uclibc-[latest]

 * PORTDIR_OVERLAY:       /usr/portage/local
 * PORT_LOGDIR:           /var/log/portage
 * PKGDIR:                /usr/portage/packages/cross/armeb-softfloat-linux-uclibc
 * PORTAGE_TMPDIR:        /var/tmp/cross/armeb-softfloat-linux-uclibc
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -
Gentoo Base System version 1.12.6
Portage 2.1.1-r2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.14-suspend2-r7 i686)
=================================================================
System uname: 2.6.14-suspend2-r7 i686 AMD Athlon(tm) Processor
Last Sync: Thu, 28 Dec 2006 18:00:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
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.17-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CC="gcc"
CCACHE_DIR="/var/tmp/ccache"
CCACHE_SIZE="1G"
CFLAGS="-O2 -pipe -march=athlon-tbird"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="-O2 -pipe -march=athlon-tbird"
MAKEOPTS="-j2"


Any help would be greatly appreciated =)

-Soeren
Back to top
View user's profile Send private message
corvis
n00b
n00b


Joined: 15 Nov 2005
Posts: 16

PostPosted: Sun Jan 14, 2007 11:07 am    Post subject: Reply with quote

Hello,

I have the same problem.
Have you fix it or has anybody an idea?

corvis
Back to top
View user's profile Send private message
Abraxa
Apprentice
Apprentice


Joined: 14 Jun 2005
Posts: 172
Location: Germany

PostPosted: Tue Jan 16, 2007 11:07 pm    Post subject: Reply with quote

Nope, not fixed yet =(

-Soeren
Back to top
View user's profile Send private message
Hagra
n00b
n00b


Joined: 24 Jun 2004
Posts: 74

PostPosted: Mon Jan 22, 2007 11:21 pm    Post subject: Reply with quote

I also have the same problem. :-(

I've switched to gcc 3.4.6 which seemed to be the only way I could get it to work. I think this may be due to a problem with the ABI. From what I've read, gcc 4.1.1 now uses arm's EABI. I think this allows binaries to be created which will execute on arm CPUs with & without VFP support. Similar functionality to kernel FPU emulation but it's done entirely in user space, I guess using libgcc.

The EABI also defines a new syscall convention, implemented in later kernels which stick the syscall number in r7 (among other changes). I think LinuxDevices did an article about it fairly recently. I guess uclibc might need to be passed additional configure options to tell it to use EABI when linking to libgcc? dunno.
Back to top
View user's profile Send private message
Hagra
n00b
n00b


Joined: 24 Jun 2004
Posts: 74

PostPosted: Mon Jan 22, 2007 11:27 pm    Post subject: Reply with quote

Gumstix's buildroot manages to build uclibc using gcc 4.1.1 when eabi is enabled, so it is possible. I've looked in gumstix's fork of buildroot which contains several patches for uclibc which seem to fix eabi issues. Not sure if any of them are relevant, but they can be found at: http://svn.gumstix.com/gumstix-buildroot/trunk/toolchain/uClibc/.


Hope this helps.
Back to top
View user's profile Send private message
Hagra
n00b
n00b


Joined: 24 Jun 2004
Posts: 74

PostPosted: Tue Jan 23, 2007 11:26 pm    Post subject: Reply with quote

I've just checked and this has been reported and is marked as bug 155970: https://bugs.gentoo.org/show_bug.cgi?id=155970.

The maintainer's response seems to be to just use gcc 3.4.6.
Back to top
View user's profile Send private message
cfriedt
n00b
n00b


Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Thu May 17, 2007 7:11 am    Post subject: Reply with quote

Code:
make[4]: Entering directory `/usr/portage/local/tinygentoo/tmpdir/portage/sys-libs/uclibc-0.9.28.3/work/uClibc-0.9.28.3/libc/sysdeps/linux/arm'                 
arm-softfloat-linux-uclibc-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing  -mlittle-endian -mtune=arm9tdmi -march=armv4 -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../../../../include -I.  -fstrict-aliasing -Os -funit-at-a-time   -isystem /usr/lib/gcc/arm-softfloat-linux-uclibc/3.4.4/include -DNDEBUG -fPIC  -c __longjmp.S -o __longjmp.o __longjmp.S: Assembler messages:                                               
__longjmp.S:36: Error: selected processor does not support `lfmfd f4,4,[ip]!'


This error corresponds to the source code located in uClibc/libc/sysdeps/linux/arm/__longjmp.S and if you take a look at that, then you'll see

Code:
#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
        lfmfd   f4, 4, [ip] !   /* load the floating point regs */
#else
        add             ip, ip, #48             /* skip the FP registers */
#endif


The first condition, __UCLIBC_HAS_FLOATS__, corresponds to

Code:
Target Architecture Features and Options -->
[*] Enable floating point number support


or within the .config file UCLIBC_HAS_FLOATS=y .

The second condition corresponds to the event where gcc -msoft-floats is invoked. It is then safe to set HAS_FPU above, as long as -msoft-float is invoked with gcc.

Code:
Target Architecture Features and Options -->
[*]   Target CPU has floating point unit (FPU)


The 'Help' information for this option claims that it is OK to set HAS_FPU=y as long as you specify -msoft-float.

Code:
HAS_FPU:

If your target CPU does not have a Floating Point Unit (FPU) or a kernel FPU emulator, but you still wish to support floating point functions, then uClibc will need to be compiled with soft floating point support (-msoft-float).  If your target CPU does not have an FPU or an FPU emulator within the Linux kernel, then you should answer N.


I've enabled floating point emulation in my kernel, and so what I did, is before the emerge of uClibc, i set CFLAGS="-msoft-float". This had absolutely no effect in the emerge, even though CFLAGS="-msoft-float" appears when i do CFLAGS="-msoft-float" emerge --info. This is not a bug in gcc, but I would say that it's rather a bug in the ebuild file because it is ignoring a critical parameter.

If i set CFLAGS="-msoft-float" directly before an emerge, on the same line, I would expect that CFLAG to actually show up in the compiler. Likewise, if the option was present in make.conf.
Back to top
View user's profile Send private message
cfriedt
n00b
n00b


Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Thu May 17, 2007 7:15 am    Post subject: Reply with quote

The bug number reported in one of the posts above seems to be unrelated according to the error

Code:
./gen_wctype en_US
setlocale(LC_CTYPE,en_US) failed!
./gen_locale locales.txt@mapping: "@euro" to 'e'
error: missing or illegal UTF-8 setting
make: *** [locale_tables.h] Error 1
make: *** Waiting for unfinished jobs....
gen_collate.c: At top level:
gen_collate.c:3792: warning: 'dump_base_locale' defined but not used
gen_collate.c:3828: warning: 'dump_der_locale' defined but not used
gen_collate.c:850: warning: 'print_colnode' defined but not used
gen_collate.c:2584: warning: 'print_starter_node' defined but not used
gen_collate.c:3248: warning: 'print_starter_all_node' defined but not used
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures 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