x86-linux -> x86-pc cross

Stephen Smith ischis2@home.com
Thu Jun 14 00:01:00 GMT 2001


Stephen Smith wrote:

> I am trying to build a x86-linux hosted x86-pe targeted cross compiler. This is for an embedded application so I don't
> need the windows code.
>
> When building, I am getting an error stating that I am missing windows.h.  Do I need to compile in a windows support
> package?  Should  I compile it before or after I compile newlib 1.9?
>
> Stephen Smith

Someone else wrote:
>Please send us the script and the log file:

The error is occurring when the minimalist gcc is being compiled.  Run the script with "debug" as the one option.

------------------------------ Script --------------------------------------------------
#! /bin/bash

# set some convenience variables (modify them to suit your taste):

if [ "x$target" = "x" ]
then
   export target=i486-pc-pe
fi

if [ "x$prefix" = "x" ]
then
   export prefix=/usr/local/cross-compilers/intel
fi

if [ "x$gcc_version" = "x" ]
then
   export gcc_version=2.95.2-6
fi

if [ "x$binutils_version" = "x" ]
then
   export binutils_version=2.10.1
fi
if [ "x$newlib_version" = "x" ]
then
   export newlib_version=1.9.0
fi

export  languages="c,c++"
export  curdir=`pwd`
export  tarfiles=tars


##################################################################################
#
#  Don't modify below this point
#
##################################################################################


export  PATH=$prefix/bin:$PATH

set -e

# get the source
if [ ! -d gcc-${gcc_version} ]
then
    tar -xzf $tarfiles/gcc-${gcc_version}*.tar.gz
fi
if [ ! -d newlib-${newlib_version} ]
then
    tar -xzf $tarfiles/newlib-${newlib_version}*.tar.gz
fi
if [ ! -d binutils-${binutils_version} ]
then
    tar -xzf $tarfiles/binutils-${binutils_version}*.tar.gz
fi


# config.guess is part of the gcc, binutils, and newlib distributions.
if [ -x $curdir/newlib-${newlib_version}/config.guess ]
then

   export  host=`$curdir/newlib-${newlib_version}/config.guess`
   export  build=`$curdir/newlib-${newlib_version}/config.guess`
else
   export  host=i686-pc-cygwin
   export  build=i686-pc-cygwin
fi

# Create build directories
mkdir -p build-binutils build-gcc build-newlib

# Build the binary utilities
echo "building binary utilities"
cd $curdir/build-binutils
../binutils-${binutils_version}/configure --prefix=$prefix --target=$target --host=$host --build=$build \
  --with-included-gettext
make 2>&1 | tee make.log
make install 2>&1 | tee install.log

# Build and install "just the C" portion of gcc (feel free to change
#   the arguments to --enable-languages to suit your needs):

echo "building gcc - C only"
cd $curdir/build-gcc
../gcc-${gcc_version}/configure --prefix=$prefix --target=$target --host=$host --build=$build \
  --with-newlib --enable-languages=$languages \
  --with-included-gettext --enable-shared --enable-threads
make LANGUAGES=c all-gcc 2>&1 | tee make.log
if [ "x$1" = "xdebug" ]
then
    exit 0
fi
make LANGUAGES=c install-gcc 2>&1 | tee install.log

# Clean out the target area just in case (may not needs this):
# rm -rf $prefix/$target

# Build and install newlib
echo "building newlib library"
cd $curdir/build-newlib
../newlib-${newlib_version}/configure --prefix=$prefix --target=$target --host=$host --build=$build
make 2>&1 | tee make.log
make install 2>&1 | tee install.log

# Make the sys-include link (may not need this, but why not):
(cd $prefix/$target; ln -s include sys-include)

# Build the rest of gcc
echo "building rest of gcc"
cd $curdir/build-gcc
make 2>&1 | tee make_full.log
make install 2>&1 | tee install_full.log

echo "$0: finished `date`"
------------------------------ Log file --------------------------------------------------
make[1]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/libiberty'
make[2]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/libiberty/testsuite'
make[1]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/libiberty'
make[1]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo'
make all-recursive
make[2]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo'
Making all in intl
make[3]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/intl'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/intl'
Making all in lib
make[3]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/lib'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/lib'
Making all in makeinfo
make[3]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/makeinfo'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo/makeinfo'
make[2]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo'
make[1]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/texinfo'
make[1]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/gcc'
(cd intl && make all)
make[2]: Entering directory `/usr/local/cross-compilers/cross-source/build-gcc/gcc/intl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/gcc/intl'
rm -f tmplibgcc2.a
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4
_cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi
_fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab
_clear_cache _trampoline __main _exit _ctors _pure; \
do \
  echo ${name}; \
  /usr/local/cross-compilers/cross-source/build-gcc/gcc/xgcc -B/usr/local/cross-compilers/cross-source/build-gcc/gcc/
-B/usr/local/cross-compilers/intel/i486-pc-pe/bin/ -I/usr/local/cross-compilers/intel/i486-pc-pe/include -O2
-I../../gcc-2.95.2-6/gcc/../winsup/include -DCROSS_COMPILE -DIN_GCC     -g -O2 -I./include   -g1 -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -I. -I../../gcc-2.95.2-6/gcc -I../../gcc-2.95.2-6/gcc/config
-I../../gcc-2.95.2-6/gcc/../include -c -DL${name} \
       ../../gcc-2.95.2-6/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  i486-pc-pe-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
_divdi3
_moddi3
_udivdi3
_umoddi3
_negdi2
_lshrdi3
_ashldi3
_ashrdi3
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
_floatdisf
_fixunsdfsi
_fixunssfsi
_fixunsdfdi
_fixdfdi
_fixunssfdi
_fixsfdi
_fixxfdi
_fixunsxfdi
_floatdixf
_fixunsxfsi
_fixtfdi
_fixunstfdi
_floatditf
__gcc_bcmp
_varargs
__dummy
_eprintf
_bb
_shtab
_clear_cache
_trampoline
__main
_exit
_ctors
_pure
for name in _eh; \
do \
  echo ${name}; \
  /usr/local/cross-compilers/cross-source/build-gcc/gcc/xgcc -B/usr/local/cross-compilers/cross-source/build-gcc/gcc/
-B/usr/local/cross-compilers/intel/i486-pc-pe/bin/ -I/usr/local/cross-compilers/intel/i486-pc-pe/include -O2
-I../../gcc-2.95.2-6/gcc/../winsup/include -DCROSS_COMPILE -DIN_GCC     -g -O2 -I./include   -g1 -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -fexceptions -I. -I../../gcc-2.95.2-6/gcc
-I../../gcc-2.95.2-6/gcc/config -I../../gcc-2.95.2-6/gcc/../include -c \
      -DL${name} ../../gcc-2.95.2-6/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  i486-pc-pe-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_eh
In file included from gthr-default.h:1,
                 from ../../gcc-2.95.2-6/gcc/gthr.h:98,
                 from ../../gcc-2.95.2-6/gcc/libgcc2.c:3039:
../../gcc-2.95.2-6/gcc/gthr-win32.h:67: windows.h: No such file or directory
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory `/usr/local/cross-compilers/cross-source/build-gcc/gcc'
make: *** [all-gcc] Error 2



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list