Subject: Re: Compiling problem in lib/csu/i386_elf
To: None <>
From: David Querbach <>
List: current-users
Date: 02/29/2000 11:10:21
> I have a series of interlocking problems that are causing my compile to
> die.  I am in the midst of upgrading to -current, and going through the
> a.out to ELF transition.  System is an IBM Thinkpad 600E running
> NetBSD/i386-current (1.4T), upgraded from 1.4.1.

> So now I can't compile anything and I'm rather stuck.  Please, can someone
> help me figure this out?

To get out of your current problem, you might try unpacking some of the
snapshot tarballs again.  In that way, you might be able to overwrite your
broken compiler (and possibly header files) with a working version.

On a related topic:

I've been running into similar problems in a different context.  I'm trying
to learn how to cross-compile the NetBSD system, with the eventual goal of
building a port to a new machine (the Motorola MPC8xx series).  

My first attempt (for practice) was to compile for i386 -current using an
i386 1.4.1 system.  I put the -current source into /usr/current, then I went
into /usr/pkgsrc/cross/i386-netbsdelf and built myself a cross-compiler.  I
then made a little script I call /usr/local/bin/xmake:


  # choose target

  export MACHINE_ARCH=i386
  export MACHINE=i386

  # set up cross translators


  export AR=${XPREFIX}ar
  export RANLIB=${XPREFIX}ranlib
  export AS=${XPREFIX}as
  export "CPP=${XPREFIX}cc -E -"
  export CC=${XPREFIX}cc
  export CXX=${XPREFIX}c++
  export FC=${XPREFIX}f77
  export LD=${XPREFIX}ld
  export NM=${XPREFIX}nm

  # set up directory structure


  export DESTDIR=${BASEDIR}/dst.${MACHINE}
  export BSDSRCDIR=${BASEDIR}/src
  export BSDOBJDIR=${BASEDIR}/obj
  export OBJMACHINE=1

  # run make with include files from new source tree

  export MAKEFLAGS="-m ${BASEDIR}/src/share/mk"

  make $*

This almost does the job, but breaks here and there.  The most important
problem seems to be that /usr/pkgsrc/cross builds egcs-1.1.1, whereas
-current builds egcs-1.1.2.  This causes problems with mismatches in the
number of underscores in symbol names when debugging is enabled.

Now I'm quite new to NetBSD, so I may be way off track, but this is the best
approach I've been able to find to move from 1.4.1 to -current, due to the
a.out vs elf change.

I'd be interested in knowing if there is a standard approach for
cross-compiling the NetBSD system.  If not, is my approach reasonable?  If
so, what should be done about the compiler version mismatch between
pkgsrc/cross and src/gnu/dist?


David Querbach
Real-Time Systems Inc.