NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cross-compiling 5.0.1



I'm attempting to cross-compile NetBSD 5.0.1 alpha using
a FreeBSD 7.1 amd64 compile host.

Building the cross tools fails with:

cc   -O -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros 
-Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. 
-I/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc 
-I/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/. 
-I/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/../include 
-I/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/../libcpp/include
  -DNETBSD_TOOLS   \
-DBASEVER="\"4.1.3\"" -DDATESTAMP="\" 20080704\"" \
-DDEVPHASE="\" (prerelease)\"" -c 
/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/version.c -o 
version.o
cc: 20080704": No such file or directory
cc: (prerelease)": No such file or directory
<command-line>: warning: missing terminating " character
<command-line>: warning: missing terminating " character
/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/version.c:25: 
error: missing terminating " character
/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/version.c:25: 
error: missing terminating " character
/ro/build_netbsd/5.0.1/usr/src/tools/gcc/../../gnu/dist/gcc4/gcc/version.c:25: 
error: expected ',' or ';' before string constant
nbgmake[1]: *** [version.o] Error 1
nbgmake[1]: Leaving directory 
`/ro/build_netbsd/5.0.1/MY_alpha_obj/ro/build_netbsd/5.0.1/usr/src/tools/gcc/build/gcc'
nbgmake: *** [all-gcc] Error 2

This argument parsing problem can be "fixed" by removing spaces in
gnu/dist/gcc4/gcc/Makefile.in

< DEVPHASE_s  := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
< DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
---
> DEVPHASE_s  := "\"$(if $(DEVPHASE_c),($(DEVPHASE_c)))\""
> DATESTAMP_s := "\"$(if $(DEVPHASE_c),$(DATESTAMP_c))\""

BUT!  The comment says NOT to remove the spaces:

# For use in version.c - double quoted strings, with appropriate
# surrounding punctuation and spaces, and with the datestamp and
# development phase collapsed to the empty string in release mode
# (i.e. if DEVPHASE_c is empty).  The space immediately after the
# comma in the $(if ...) constructs is significant - do not remove it.

Sure enough, with the spaces the resulting compiler fails with:

<built-in>:0: internal compiler error: in define__GNUC__, at c-cppbuiltin.c:296

I tried adding
  export HOST_SH=/bin/sh
in case bash was doing something wierd, but it didn't help.

So, what is the correct way to fix this?


Home | Main Index | Thread Index | Old Index