Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
port gentoo to new board: ppc-crossdev has issues
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
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Thu Nov 29, 2007 10:32 pm    Post subject: port gentoo to new board: ppc-crossdev has issues Reply with quote

hi,
i've bought a board equipped with a mipsR4000 little endian
i'm experienced with the gentoo-mips (i run it on sgi octane), and i know it is for big-endian cpus

this board is supported by debian, and the cpu has the mmu, so a 2.4 kernel is not a problem
the real problem is: how to port all the stages (1,2,3) to this board ?

i'd like to run gentoo on this board, i'd like to have gcc aboard
i don't like debian, and i don't like to have no gcc&C running on the board


so the question is: how to port gentoo to a new board ?
how to make stage3 ?

is there documentation ?

regards


Last edited by ddc on Fri Nov 30, 2007 11:42 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4255
Location: USA

PostPosted: Thu Nov 29, 2007 11:32 pm    Post subject: Reply with quote

If there's no stage3 build, you will need to start from scratch with a stage1.

Probably the best way to start is install portage for a host system (even better if already use gentoo on another system, don't forget cross compile builds), and use portage to build a stage1 for the system in a chroot. Then copy it over to the machine for boot.

As long as you can build a kernel for it... I wish my DECstation 3100 could run Linux (and support console, disk, etc.)
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Fri Nov 30, 2007 12:42 am    Post subject: Reply with quote

first step: have the crossdev toolchain

Code:

#Supported Architectures:
#   - mips / mipsel / mips64 / mips64el
#Supported C Libraries:
#   - glibc (gnu)
#   - klibc       [prob wont work]
#   - newlib      [bare metal/no operating system]
#   - uclibc      [not all arches are ported]


so

Code:
crossdev --stable --target mipsel-linux-uclibc


should compile the crosscompiler&clib (binutils,gcc,uclibc)
unfortunately it fails with errors at the uclibc stage

i'm running crossdev on a ppc machine

Quote:

make[1]: Entering directory `/var/tmp/cross/mipsel-linux-uclibc/portage/cross-mipsel-linux-uclibc/uclibc-0.9.27-r1/work/uClibc-0.9.27/ldso'
echo "const char *_dl_progname=\""ld-uClibc.so.0"\";" \
> include/dl-progname.h
echo "#include \"mips/elfinterp.c\"" \
>> include/dl-progname.h
ln -fs ../../include/elf.h include/
ln -fs ../ldso/mips/dl-startup.h include/
ln -fs ../ldso/mips/dl-syscalls.h include/
ln -fs ../ldso/mips/dl-sysdep.h include/
make -C ldso;
make[2]: Entering directory `/var/tmp/cross/mipsel-linux-uclibc/portage/cross-mipsel-linux-uclibc/uclibc-0.9.27-r1/work/uClibc-0.9.27/ldso/ldso'
mipsel-linux-uclibc-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-stack-protector -Os -mno-split-addresses -mips1 -fPIC -DUCLIBC_RUNTIME_PREFIX=\"/\" -fno-builtin -nostdinc -D_LIBC -I../../ldso/include -I. -I../../include -isystem /usr/lib/gcc/mipsel-linux-uclibc/4.1.1/include -D__SUPPORT_LD_DEBUG__ -I../libdl -c mips/resolve.S -o mips/resolve.o
true -Since_we_are_debugging -x -R .note -R .comment mips/resolve.o
mipsel-linux-uclibc-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-stack-protector -Os -mno-split-addresses -mips1 -fPIC -DUCLIBC_RUNTIME_PREFIX=\"/\" -fno-builtin -nostdinc -D_LIBC -I../../ldso/include -I. -I../../include -isystem /usr/lib/gcc/mipsel-linux-uclibc/4.1.1/include -D__SUPPORT_LD_DEBUG__ -I../libdl -c ldso.c -o ldso.o
ldso.c:74: error: static declaration of '_dl_malloc_addr' follows non-static declaration
../../ldso/include/ldso.h:45: error: previous declaration of '_dl_malloc_addr' was here
ldso.c:75: error: static declaration of '_dl_mmap_zero' follows non-static declaration
../../ldso/include/ldso.h:46: error: previous declaration of '_dl_mmap_zero' was here
In file included from ldso.c:935:
dl-hash.c: In function '_dl_find_hash':
dl-hash.c:150: warning: pointer targets in passing argument 1 of '_dl_elf_hash' differ in signedness
make[2]: *** [ldso.o] Error 1
make[2]: Leaving directory `/var/tmp/cross/mipsel-linux-uclibc/portage/cross-mipsel-linux-uclibc/uclibc-0.9.27-r1/work/uClibc-0.9.27/ldso/ldso'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/cross/mipsel-linux-uclibc/portage/cross-mipsel-linux-uclibc/uclibc-0.9.27-r1/work/uClibc-0.9.27/ldso'
make: *** [_dir_ldso] Error 2

!!! ERROR: cross-mipsel-linux-uclibc/uclibc-0.9.27-r1 failed.
Call stack:
ebuild.sh, line 1614: Called dyn_compile
ebuild.sh, line 971: Called qa_call 'src_compile'
environment, line 3413: Called src_compile
uclibc-0.9.27-r1.ebuild, line 326: Called die

!!! could not make
!!! 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/mipsel-linux-uclibc/portage/cross-mipsel-linux-uclibc/uclibc-0.9.27-r1/temp/build.log'.

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




ummm
Quote:
ldso.c:74: error: static declaration of '_dl_malloc_addr' follows non-static declaration
../../ldso/include/ldso.h:45: error: previous declaration of '_dl_malloc_addr' was here
ldso.c:75: error: static declaration of '_dl_mmap_zero' follows non-static declaration
../../ldso/include/ldso.h:46: error: previous declaration of '_dl_mmap_zero' was here


what does it mean ?
"error: static declaration of '_dl_mmap_zero' follows non-static declaration"

any idea ?
Back to top
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Fri Nov 30, 2007 11:44 am    Post subject: Reply with quote

Code:

crossdev --stable --target mipsel-unknown-linux-gnu


gcc-stage1 fails cause unrecognized option -EL somewhere
understanding what this log error messaged means
-EL tells the compiler to build in little-endian mode
Not sure if that's implemented for PowerPC (which is big-endian)
It sounds like a flag that should be used with the cross-compiler being built, got passed to the host's compiler.
Thus the host compiler rightfully said WTF?! and chucked a wobbly, killing the build.

clearly there is a bug in the build system here
Back to top
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Sat Dec 01, 2007 9:49 pm    Post subject: Reply with quote

about uclibc this is causing issues on host=bigendian

uclibc.ebuild wrote:

uclibc_endian() {
# XXX: this wont work for a toolchain which is bi-endian, but we
# dont have any such thing at the moment, so not a big deal
touch "${T}"/endian.s
$(tc-getAS) "${T}"/endian.s -o "${T}"/endian.o
case $(file "${T}"/endian.o) in
*" MSB "*) echo "big";;
*" LSB "*) echo "little";;
*) echo "NFC";;
esac
rm -f "${T}"/endian.{s,o}
Back to top
View user's profile Send private message
ddc
Guru
Guru


Joined: 29 Aug 2006
Posts: 527

PostPosted: Sat Dec 01, 2007 10:22 pm    Post subject: Reply with quote

useful link http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO
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