Subject: Re: NetBSD/arm26 cross-compilation kit
To: Leo Smiers <L.Smiers@cable.A2000.nl>
From: Ben Harris <bjh21@netbsd.org>
List: port-arm26
Date: 07/21/2000 21:57:25
On Fri, 21 Jul 2000, Leo Smiers wrote:

> BTW Is there any official way to set the correct path for a cross-compiler.
> Now I append the path /usr/pkg/cross/armv2-netbsd/bin in front of my standard
> path before I do a kernel build. It works but I was just wondering if this
> is the correct way.

Erm, I don't know of an official way.  For kernel builds your technique
will work fine.  For user programs, it's necessary for the makefiles to be
able to find both the host and the target C compilers.  I use the
following script, called arm26make, which works for me, but is a bit of a
kludge:

--------8<--------
#! /bin/sh

vars="\
 ADDR2LINE=/opt/pkg/cross/armv2-netbsd/bin/addr2line \
 AR=/opt/pkg/cross/armv2-netbsd/bin/ar \
 AS=/opt/pkg/cross/armv2-netbsd/bin/as \
 CC=/opt/pkg/cross/armv2-netbsd/bin/cc \
 CPP=/opt/pkg/cross/armv2-netbsd/bin/cpp \
 CXX=/opt/pkg/cross/armv2-netbsd/bin/c++ \
 CXXFILT=/opt/pkg/cross/armv2-netbsd/bin/cxxfilt \
 LD=/opt/pkg/cross/armv2-netbsd/bin/ld \
 MAKE=arm26make \
 NM=/opt/pkg/cross/armv2-netbsd/bin/nm \
 OBJCOPY=/opt/pkg/cross/armv2-netbsd/bin/objcopy \
 RANLIB=/opt/pkg/cross/armv2-netbsd/bin/ranlib \
 SIZE=/opt/pkg/cross/armv2-netbsd/bin/size \
 STRIP=/opt/pkg/cross/armv2-netbsd/bin/strip \
 MACHINE=arm26 MACHINE_ARCH=arm26 \
 DESTDIR=${DESTDIR:-/export/arm26/root} \
 MKLINT=no MKPIC=no MKPROFILE=no OBJECT_FMT=ELF "

env $vars make -m /export/arm26/root/usr/share/mk $vars "$@"
-------->8--------

Obviously, some of the paths will need changing for other people.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>