Error building linux-hosted compiler for solaris: "sed: option re quires an argument"

Hamilton Chris-cham chris.hamilton@freescale.com
Fri Jul 16 18:34:00 GMT 2004


Hi,

I'm trying to build a gcc 3.4.1 cross-compiler that is hosted on i686-pc-linux and generates
binaries for sparc-sun-solaris2.8.  During the build, I'm new seeing errors involving "sed"
in the step that fixes up headers.

This is what I've done (all on the linux host):

INSTALL_PREFIX=/_TOOLS_/dist/gnu-gcc-3.4.1-binutils-2.15-sparc64-elf/i686-pc-linux2.4

1. Configure/build/install binutils:
    --prefix=$INSTALL_PREFIX
    --disable-nls
    --enable-64-bit-bfd
    --target=sparc64-elf

2. On Solaris machine, create tarball of /usr/include/* (recursive); then on linux
   box, unpack tarball to /home/cham/sparc-sun-solaris2.8-sys-include/usr/include

3. Configure/build gcc:
    --prefix=$INSTALL_PREFIX
    --with-headers=/home/cham/sparc-sun-solaris2.8-sys-include/usr/include
    --enable-threads
    --enable-shared
    --with-ld=${INSTALL_PREFIX}/bin/sparc64-elf-ld
    --with-as=${INSTALL_PREFIX}/bin/sparc64-elf-as
    --with-nm=${INSTALL_PREFIX}/bin/sparc64-elf-nm
    --enable-languages=c,c++
    --disable-nls
    --target=sparc64-elf

This is the result (truncated):

-------------------------------- OUTPUT BEGINS ----------------------------------------
rm -rf ./libgcc.a
` if [ -f /proj/ppctools/new_space/cham/gcc-3.4.1-cross/gcc-3.4.1/_build/gcc/../binutil
s/ar ] ; then echo /proj/ppctools/new_space/cham/gcc-3.4.1-cross/gcc-3.4.1/_build/gcc/.
./binutils/ar ; else if [ "i686-pc-linux-gnu" = "sparc64-sun-solaris2.8" ] ; then echo 
ar; else t='s,^,sparc64-sun-solaris2.8-,;'; echo ar | sed -e  ; fi; fi`  rc ./libgcc.a 
libgcc/./_muldi3.oS libgcc/./_negdi2.oS libgcc/./_lshrdi3.oS libgcc/./_ashldi3.oS libgc
c/./_ashrdi3.oS libgcc/./_cmpdi2.oS libgcc/./_ucmpdi2.oS libgcc/./_floatdidf.oS libgcc/
./_floatdisf.oS libgcc/./_fixunsdfsi.oS libgcc/./_fixunssfsi.oS libgcc/./_fixunsdfdi.oS
 libgcc/./_fixdfdi.oS libgcc/./_fixunssfdi.oS libgcc/./_fixsfdi.oS libgcc/./_fixxfdi.oS
 libgcc/./_fixunsxfdi.oS libgcc/./_floatdixf.oS libgcc/./_fixunsxfsi.oS libgcc/./_fixtf
di.oS libgcc/./_fixunstfdi.oS libgcc/./_floatditf.oS libgcc/./_clear_cache.oS libgcc/./
_trampoline.oS libgcc/./__main.oS libgcc/./_absvsi2.oS libgcc/./_absvdi2.oS libgcc/./_a
ddvsi3.oS libgcc/./_addvdi3.oS libgcc/./_subvsi3.oS libgcc/./_subvdi3.oS libgcc/./_mulv
si3.oS libgcc/./_mulvdi3.oS libgcc/./_negvsi2.oS libgcc/./_negvdi2.oS libgcc/./_ctors.o
S libgcc/./_ffssi2.oS libgcc/./_ffsdi2.oS libgcc/./_clz.oS libgcc/./_clzsi2.oS libgcc/.
/_clzdi2.oS libgcc/./_ctzsi2.oS libgcc/./_ctzdi2.oS libgcc/./_popcount_tab.oS libgcc/./
_popcountsi2.oS libgcc/./_popcountdi2.oS libgcc/./_paritysi2.oS libgcc/./_paritydi2.oS 
libgcc/./_divdi3.oS libgcc/./_moddi3.oS libgcc/./_udivdi3.oS libgcc/./_umoddi3.oS libgc
c/./_udiv_w_sdiv.oS libgcc/./_udivmoddi4.oS libgcc/./_eprintf.oS libgcc/./__gcc_bcmp.oS
sed: option requires an argument -- e

Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

  -n, --quiet, --silent
                 suppress automatic printing of pattern space
  -e script, --expression=script
                 add the script to the commands to be executed
  -f script-file, --file=script-file
                 add the contents of script-file to the commands to be executed
      --help     display this help and exit
  -V, --version  output version information and exit

If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret.  All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.

E-mail bug reports to: bug-gnu-utils@gnu.org .
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.
/bin/sh: rc: command not found
make[3]: *** [libgcc.a] Error 127
make[3]: Leaving directory `/proj/.ppc_22/cham/gcc-3.4.1-cross/gcc-3.4.1/_build/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/proj/.ppc_22/cham/gcc-3.4.1-cross/gcc-3.4.1/_build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/proj/.ppc_22/cham/gcc-3.4.1-cross/gcc-3.4.1/_build/gcc'
make: *** [bootstrap] Error 2
--------------------------------- OUTPUT ENDS ------------------------------------------

There are actually quite a few of these errors that occur back to back just before
the build attempt dies with the error exit.  Searching the digital hairball above for
'sed', I see the broken command embedded in the middle of a backquoted 'if' block:  

   "echo ar | sed -e    ;"
                     ^^
                     Shouldn't there be something useful here?

Can anyone help me figure out what I've done wrong?  Has anyone seen this kind of 
error before?   Is there a workaround?  

Desperate for a hint...
Chris



More information about the Gcc-help mailing list