|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
cross compiling ARM ramdisk kernel on x86 host failsi tied to cross compile a ARM ramdisk kernel on x86 and am somewhat
stuck what i did: rm -rf /usr/cross/armish /usr/obj/* cd /usr/src/distrib/crunch make make install cd /usr/src make obj make cross-tools TARGET=armish make cross-distrib TARGET=armish export DESTDIR=/usr/cross/armish export AS=/usr/cross/armish/usr/bin/as export CC=/usr/cross/armish/usr/bin/gcc export GCC=/usr/cross/armish/usr/bin/gcc export CPP=/usr/cross/armish/usr/bin/cpp export LD=/usr/cross/armish/usr/bin/ld export STRIP=/usr/cross/armish/usr/bin/strip cd /usr/src/distrib/special make TARGET=armish cd /usr/src/distrib/armish make TARGET=armish everything works until executing the last command /usr/src/distrib/armish/ramdisk/obj/rdsetroot bsd.rd < mr.fs bsd.rd: no rd_root_image symbols? *** Error code 1 Stop in /usr/src/distrib/armish/ramdisk (line 41 of /usr/src/distrib/armish/ramdisk/Makefile). *** Error code 1 Stop in /usr/src/distrib/armish (line 48 of /usr/share/mk/bsd.subdir.mk). this seems to be related to the fact that rdsetroot will check for the machine arch to the the same as the host arch which is not the case - we are cross compiling for armish uncommenting the 'exit(1);' on line 217 of elfrdsetroot.c will help but gives another error: /usr/src/distrib/armish/ramdisk/obj/rdsetroot bsd.rd < mr.fs bsd.rd: no rd_root_image symbols? segment 0 rd_root_size_off = 0xffe00000 rd_root_image_off = 0xffe00000 bsd.rd: no rd_root_image symbols? segment 1 rd_root_size_off = 0x3fdfff3c root_off v c02000c4 p 2000c4, diff c0000000 altered 7fdfff3c rd_root_image_off = 0x3fdfff3c bsd.rd: no rd_root_image symbols? segment 2 rd_root_size_off = 0x3fc18000 root_off v c03e8000 p 3e8000, diff c0000000 altered 7fc18000 rd_root_image_off = 0x3fc18000 bsd.rd: no rd_root_image symbols? segment 3 rd_root_size_off = 0x3f98de9c rd_root_image_off = 0x3f98de9c bsd.rd: can't locate space for rd_root_image! *** Error code 1 Stop in /usr/src/distrib/armish/ramdisk (line 41 of /usr/src/distrib/armish/ramdisk/Makefile). *** Error code 1 Stop in /usr/src/distrib/armish (line 48 of /usr/share/mk/bsd.subdir.mk). - any idea/hints on how to cross compile a arm release or ramdisk kernel on a x86 host? - how is the openbsd release being compiled... also cross on a x86 host or native on a arm host? many thanks /pat |
|
|
Re: cross compiling ARM ramdisk kernel on x86 host failsOn Thu, Apr 09, 2009 at 10:05:03PM +0200, Patrick Oeschger wrote:
> i tied to cross compile a ARM ramdisk kernel on x86 and am somewhat > stuck > what i did: > [snip] > > - any idea/hints on how to cross compile a arm release or ramdisk > kernel on a x86 host? > - how is the openbsd release being compiled... > also cross on a x86 host or native on a arm host? First, cross build is not officially supported by OpenBSD, all releases are built natively. However some support for cross builds exist in the tree primarily for intial bringup effort for a platform. > > many thanks > /pat > I have a diff that I have been sitting on for some time that works around this. It adds an ifdef to the libc code and then compiles it into the binary so the arch check is disabled. I also have another useful 'environment' script that I use, below. Index: distrib/armish/ramdisk/Makefile =================================================================== RCS file: /cvs/src/distrib/armish/ramdisk/Makefile,v retrieving revision 1.6 diff -u -u -r1.6 Makefile --- distrib/armish/ramdisk/Makefile 2 Dec 2008 03:20:57 -0000 1.6 +++ distrib/armish/ramdisk/Makefile 23 Jan 2009 21:46:38 -0000 @@ -3,6 +3,7 @@ REV= ${OSrev} TOP= ${.CURDIR}/.. +LIBC= ${TOP}/../../lib/libc BSD_RD= bsd.rd IMAGE= mr.fs @@ -71,7 +72,7 @@ -vnconfig -u ${VND} rdsetroot: ${TOP}/../common/elfrdsetroot.c - ${HOSTCC} -o rdsetroot ${TOP}/../common/elfrdsetroot.c + ${HOSTCC} -DSKIP_ARCH_CHECK -o rdsetroot ${TOP}/../common/elfrdsetroot.c ${LIBC}/gen/nlist.c unconfig: -umount -f ${MOUNT_POINT} Index: lib/libc/gen/nlist.c =================================================================== RCS file: /cvs/src/lib/libc/gen/nlist.c,v retrieving revision 1.53 diff -u -u -r1.53 nlist.c --- lib/libc/gen/nlist.c 4 Jun 2008 21:12:50 -0000 1.53 +++ lib/libc/gen/nlist.c 23 Nov 2008 19:00:51 -0000 @@ -286,9 +286,11 @@ ehdr->e_ident[EI_DATA] == ELF_TARG_DATA && ehdr->e_ident[EI_VERSION] == ELF_TARG_VER) { +#ifndef SKIP_ARCH_CHECK /* Now check the machine dependant header */ if (ehdr->e_machine == ELF_TARG_MACH && ehdr->e_version == ELF_TARG_VER) +#endif retval = 1; } save the following into a file called armmake and make it executeable It sets up the environment for each invocation of 'armmake' There is a problem that 'armmake obj' doesn't work as desired, but generally those are set up by the initial Makefile.cross build of the tools. ---- #! /bin/ksh HOST=$(uname -m) MACHINE=armish MACHINE_ARCH=arm VERSION=4.5 export MAKEOBJDIR=obj.${HOST}.${MACHINE} TARGET_CANON=${MACHINE_ARCH}-unknown-openbsd${VERSION} CROSSDIR=/usr/cross/${MACHINE} PATH=$PATH:${CROSSDIR}/usr/${TARGET_CANON}/bin MACHINE=${MACHINE} \ MACHINE_ARCH=${MACHINE_ARCH} \ CROSSDIR=${CROSSDIR} \ CC=${TARGET_CANON}-cc \ CXX=${TARGET_CANON}-c++ \ CPP=${TARGET_CANON}-cpp \ AS=${TARGET_CANON}-as \ LD=${TARGET_CANON}-ld \ SIZE=size \ STRIP=${TARGET_CANON}-strip \ OBJDUMP=${TARGET_CANON}-objdump \ OBJCOPY=${TARGET_CANON}-objcopy \ make \ MACHINE=${MACHINE} \ MACHINE_ARCH=${MACHINE_ARCH} \ MAKEOBJDIR=obj.${HOST}.${MACHINE} \ "$@" #OBJMACHINE=${MACHINE_ARCH} \ ---- Dale Rahn drahn@... |
| Free embeddable forum powered by Nabble | Forum Help |