Subject: Cross-compiling using the cross-packages
To: None <current-users@netbsd.org>
From: David Forbes <david@flossy.u-net.com>
List: current-users
Date: 03/05/2000 16:49:57
Summary:  I'm trying to cross compile an i386 kernel on an arm32 box,
using the cross-i386-netbsdelf-1.3.0.0 package, with no luck.

In detail:  I'm using a source tree from about 1.4K - the one that
accompanied the 19990906 i386 snapshot.  I have built the kernel that I'm
trying to compile natively on an i386 box and it works fine, but
attempting to cross-compile doesn't.  I get the following:

---------------------------------------------------------------------------

crowley:build$ ../bin/cross-build 
+ exec make
/usr/pkg/cross/bin/i386-netbsdelf-gcc -x assembler-with-cpp
-traditional-cpp -D_LOCORE -I.
-I/usr/home/kernmake/src/netbsd-1.4K/sys/arch
-I/usr/home/kernmake/src/netbsd-1.4K/sys -nostdinc -DDIAGNOSTIC
-DCONSDEVNAME=\"com\" -DCONADDR="0x3f8" -DCONSPEED="0x2580" -DMAXUSERS=32
-D_KERNEL -Di386 -c
/usr/home/kernmake/src/netbsd-1.4K/sys/arch/i386/i386/locore.s
/tmp/ccVqj96S.s: Assembler messages:
/tmp/ccVqj96S.s:4758: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4759: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4760: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4761: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4762: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4763: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4764: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4765: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4766: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4767: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4768: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4769: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4770: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4771: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4772: Error: unbalanced parenthesis in first operand.
/tmp/ccVqj96S.s:4773: Error: unbalanced parenthesis in first operand.
*** Error code 1

Stop.

----------------------------------------------------------------------------

The cross-build packages I'm using were rebuilt fresh from an rsync of
pkgsrc yesterday morning.  I'm using the script that was posted to this
list a little while back, but modified for i386 (my apologies, but I
forget who posted it).  it goes something like this:

----------------------------------------------------------------------------

crowley:build$ cat ../bin/cross-build
#! /bin/sh
#DESTDIR=/export/NetBSD/news68k/root export DESTDIR
MACHINE=i386 export MACHINE
MACHINE_ARCH=i386 export MACHINE_ARCH
WHICH=i386-netbsdelf

LOCAL=/usr/pkg
BINDIR=$LOCAL/cross/bin
PATH=$BINDIR:$LOCAL/cross/$WHICH/bin:$PATH:$LOCAL/cross/bin:$PATH export
PATH

GCC_EXEC_PREFIX=$WHICH

AR=$BINDIR/$WHICH-ar export AR
AS=$BINDIR/$WHICH-as export AS
CC=$BINDIR/$WHICH-gcc export CC
CPP=`$CC -print-prog-name=cpp` export CPP
CXX=$BINDIR/$WHICH-c++ export CXX
FC=$BINDIR/$WHICH-f77 export FC
LD=$BINDIR/$WHICH-ld export LD
NM=$BINDIR/$WHICH-nm export NM
RANLIB=$BINDIR/$WHICH-ranlib export RANLIB
SIZE=$BINDIR/$WHICH-size export SIZE
ADDR2LINE=$BINDIR/$WHICH-addr2line export ADDR2LINE
GASP=$BINDIR/$WHICH-gasp export GASP
OBJCOPY=$BINDIR/$WHICH-objcopy export OBJCOPY
OBJDUMP=$BINDIR/$WHICH-objdump export OBJDUMP
STRINGS=$BINDIR/$WHICH-strings export STRINGS
STRIP=$BINDIR/$WHICH-strip export STRIP

HOSTED_CC=cc export HOSTED_CC

MKSHARE=no
MKMAN=no
MKINFO=no

MAKE=make export MAKE

set -x
exec $MAKE "$@"

crowley:build$ 
-----------------------------------------------------------------------------

Does anyone know what the vital incantation is to get this to roll? 

Thanks,

David.