View previous topic :: View next topic |
Author |
Message |
ipif n00b
Joined: 05 Mar 2009 Posts: 6
|
Posted: Fri Mar 06, 2009 9:43 am Post subject: gentoo on leon3 (SPARC V8), loading shared libraries fails |
|
|
Hi,
I'm trying to get Gentoo working on my embedded system. The toolchain I use has been created with crossdev: sparc-softfloat-linux-uclibc.
Following versions are used:
uclibc-0.9.30 (with UCLIBC_CPU=SPARC_V8)
binutils-2.18-r3
linux-headers-2.6.27-r2
gcc-4.1.2 (slightly patched to generate math emulation)
My make.conf:
Code: |
ACCEPT_KEYWORDS="sparc"
ARCH="sparc"
CHOST="sparc-softfloat-linux-uclibc"
CFLAGS="-O2 -pipe -msoft-float -mtune=v8 -mcpu=v8"
CXXFLAGS="${CFLAGS}"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo/"
INPUT_DEVICES="keyboard"
MAKEOPTS="-j2"
USE="-* minimal zlib"
UCLIBC_CPU=SPARC_V8
|
To get a shell after booting the kernel I use a static compiled busybox.
But when I try to start any dynamic linked executable I get something similar to the following:
Code: |
# bash
bash: '/lib/libncurses.so.5' is not an ELF executable for sparc
bash: '/lib/libncurses.so.5' is not an ELF executable for sparc
bash: '/lib/libncurses.so.5' is not an ELF executable for sparc
bash: can't load library 'libncurses.so.5'
#
|
According to readelf the magics are the same:
Code: |
# sparc-softfloat-linux-uclibc-readelf -h bin/bash
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Sparc
Version: 0x1
Entry point address: 0x254dc
Start of program headers: 52 (bytes into file)
Start of section headers: 675176 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 23
Section header string table index: 22
# sparc-softfloat-linux-uclibc-readelf -h lib/libncurses.so.5
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Sparc
Version: 0x1
Entry point address: 0x13084
Start of program headers: 52 (bytes into file)
Start of section headers: 310168 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 22
Section header string table index: 21
#
|
My xemerge script:
Code: |
#!/bin/sh
export SYSROOT=/usr/sparc-softfloat-linux-uclibc
export CBUILD=$(portageq envvar CHOST)
export PORTAGE_CONFIGROOT=${SYSROOT}
export PORTDIR_OVERLAY="/usr/local/portage"
export ac_cv_func_calloc_0_nonnull=yes
export ac_cv_func_malloc_0_nonnull=yes
export gl_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
export ac_cv_func_memcmp_working=yes
export ac_cv_func_strnlen_working=yes
export ac_tool_prefix=sparc-softfloat-linux-uclinux-
#coreutils: http://bugs.gentoo.org/224685
export gl_cv_func_stdin=yes
export gl_cv_func_wcwidth_works=yes
if [ "$1" = "--root" ] ; then
export ROOT=$2
shift 2
else
export ROOT=${SYSROOT}
fi
exec emerge "$@"
|
Any help appreciated! Thank you very much in advance!
-jan |
|
Back to top |
|
|
ipif n00b
Joined: 05 Mar 2009 Posts: 6
|
Posted: Tue Mar 17, 2009 1:51 pm Post subject: loading shared libraries [solved] |
|
|
This is just a sparc related bug in uclibc. Has been solved on their list years ago.
-jan |
|
Back to top |
|
|
ierton n00b
Joined: 09 Sep 2009 Posts: 6
|
Posted: Wed Sep 09, 2009 1:22 pm Post subject: Re: gentoo on leon3 (SPARC V8), loading shared libraries fai |
|
|
ipif wrote: |
Hi,
I'm trying to get Gentoo working on my embedded system. The toolchain I use has been created with crossdev: sparc-softfloat-linux-uclibc.
Following versions are used:
uclibc-0.9.30 (with UCLIBC_CPU=SPARC_V8)
binutils-2.18-r3
linux-headers-2.6.27-r2
gcc-4.1.2 (slightly patched to generate math emulation)
|
Hello. I am trying to build exactly same thing with default gcc, but without luck. Could you post the math-emulation patch for gcc?
Thank you! |
|
Back to top |
|
|
|