[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Crosscompiling works!



Hi,
I finally was able to crosscompile programms on OpenBSD-i386 for OpenBSD-amiga.
The error messages when configuring binutils did not prevent it from working.
For the gcc build i only needed to change bison to yacc and use
gnu make. I dont know if it is neccessary therefore but for me it
succeeded first when i used it.
My installation now is not nice (/usr/local/m68k-unknown-openbsd2.0 instead of 
/usr/bin and /usr/lib/gcc-lib) but seems to work. I tested a few tiny 
applications and many of them compile and work!

At the moment only static bins can be compiled it seems.

My aim was to crosscompile a amiga kernel on a pc.
I did the following modifications to be able to do so to
a certain extend,
this is in src/sys/arch/amiga/conf/Makefile.amiga:

# DEBUG is set to -g if debugging.
# PROF is set to -pg if profiling.

AS?=    as
AS=     m68k-unknown-openbsd2.0-as
CC?=    cc
CCN=    cc
CC=     m68k-unknown-openbsd2.0-gcc
CPP?=   cpp
CPP=    m68k-unknown-openbsd2.0-cpp
LD?=    ld
LD=     m68k-unknown-openbsd2.0-ld
STRIP?= strip -d
STRIP=  m68k-unknown-openbsd2.0-strip -d
TOUCH?= touch -f -c
AR=     m68k-unknown-openbsd2.0-ar
NM=     m68k-unknown-openbsd2.0-nm

MACHINE_ARCH=m68k
MACHINE=m68k
CROSS_COMPILING=YES

# source tree is located via $S relative to the compilation directory
S=      ../../../..
AMIGA=  ../..


and this is in /usr/share/mk/bsd.lib.mk:

lib${LIB}.a:: ${OBJS}
        @echo building standard ${LIB} library
        @rm -f lib${LIB}.a
.if defined(CROSS_COMPILING)
        @${AR} cq lib${LIB}.a ${OBJS}
.else
        @${AR} cq lib${LIB}.a `lorder ${OBJS} | tsort -q`
.endif
        ${RANLIB} lib${LIB}.a

POBJS+= ${OBJS:.o=.po}
lib${LIB}_p.a:: ${POBJS}

with these modifications a make now fails with:

bash# make
making sure the kern library is up to date...
`libkern.o' is up to date.
making sure the compat library is up to date...
`libcompat.a' is up to date.
sh ../../../../conf/newvers.sh
m68k-unknown-openbsd2.0-gcc  -O2 -Werror -Wall -Wstrict-prototypes
-Wno-uninitialized  -Wno-format -m68020 -msoft-float  -I.
-I../../../../arch -I../../../.. -DTIMEZONE="0" -DDST="0" -DSWAPPAGER
-DDEVPAGER -DDDB -DDIAGNOSTIC -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM
-DCOMPAT_NOMID -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_43 -DLKM -DFFS
-DQUOTA -DMFS -DNFSCLIENT -DNFSSERVER -DCD9660 -DMSDOSFS -DFDESC -DFIFO
-DKERNFS -DNULLFS -DPORTAL -DPROCFS -DUMAPFS -DUNION -DINET -DIPFILTER
-DBOOT_CONFIG -DM68030 -DFPCOPROC -DVNODEPAGER -DGATEWAY -DNTP
-DCOMPAT_SUNOS -DTCP_COMPAT_42 -DGENERIC -DNKMEMCLUSTERS=256
-DMACHINE_NONCONTIG -DSERIBUF_SIZE=4096 -DSEROBUF_SIZE=32 -DLEV6_DEFER
-DCV64CONSOLE -DCV_AGGRESSIVE_TIMING -DIPL_REMAP_1 -D_KERNEL -Dmc68020
-Damiga  -c vers.c
m68k-unknown-openbsd2.0-ld -n -Ttext 0 -e start -x -o netbsd ${SYSTEM_OBJ}
vers.o
locore.o(.data+0x70): undefined reference to `lev4intr'
com.o(.text+0x1e4): undefined reference to `strcmp'
com.o(.text+0x266): undefined reference to `strcmp'
....
and lots further undefined references
to `MD5Init' `MD5Transform' `__ashldi3' `__ashrdi3' `__divdi3' `__moddi3'
`__udivdi3' `bcmp' `bzero' `ffs' `getsn' `scanc' `skpc' `strcat' `strcmp'
`strcpy' `strlen' `strncasecmp' `strncmp' `strncpy'

I would really like to be able to crosscompile.
What can i do to make this work?
ciao 
Carsten

PS: you compile on a Amiga with 030/68881/25? Ever tried crosscompiling
on a P133? Can you spell 'fast'?:)


Visit your host, monkey.org