This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cross-compiler build failure, egcs-19990502



This fixes a Makefile bug that broke cross compilation of libgcc2.a.
Original bug report below.

	 * egcs/Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include.
	   egcs/gcc/Makefile.in: Likewise.

*** Makefile.in	1999/04/02 14:17:39	1.1
--- Makefile.in	1999/05/09 16:28:06
*************** CC_FOR_TARGET = ` \
*** 233,239 ****
  # variable is passed down to the gcc Makefile, where it is used to
  # build libgcc2.a.  We define it here so that it can itself be
  # overridden on the command line.
! GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/
  
  CHILL_FOR_TARGET = ` \
    if [ -f $$r/gcc/xgcc ] ; then \
--- 233,239 ----
  # variable is passed down to the gcc Makefile, where it is used to
  # build libgcc2.a.  We define it here so that it can itself be
  # overridden on the command line.
! GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ -B$(build_tooldir)/bin/ -I$(build_tooldir)/include
  
  CHILL_FOR_TARGET = ` \
    if [ -f $$r/gcc/xgcc ] ; then \
*** gcc/Makefile.in	1999/04/29 15:38:02	1.1
--- gcc/Makefile.in	1999/05/09 16:21:22
*************** INSTALL_ASSERT_H = install-assert-h
*** 166,172 ****
  # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
  # Usually the one we just built.
  # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
! GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/
  
  # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  # It omits XCFLAGS, and specifies -B./.
--- 166,172 ----
  # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
  # Usually the one we just built.
  # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
! GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/ -I$(build_tooldir)/include
  
  # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
  # It omits XCFLAGS, and specifies -B./.
---------------

egcs-19990502
host sparc-sun-sunos2.6
target powerpc-linux

While building libgcc2 for a cross compiler, stdlib.h and unistd.h are
sought.  Even though they exist in the usual place
(/usr/local/powerpc-linux/include), they are not found.
The build failure is apparently a regression from earlier times,
e.g. egcs-1.1.1.

The header search path, at the point of failure, is

#include "..." search starts here:
#include <...> search starts here:
 include
 .
 ../ccdir/gcc
 ../ccdir/gcc/config
 ../ccdir/gcc/../include
 /www/arc/egcs-build/gcc/include
End of search list.



ccdir/configure --srcdir=ccdir --host=sparc-sun-solaris2.6 --target=powerpc-linux
gmake
...
 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}; \
  /www/arc/egcs-build/gcc/xgcc -B/www/arc/egcs-build/gcc/ -B/usr/local/powerpc-linux/bin/ -O2  -DCROSS_COMPILE -DIN_GCC -DHAIFA  -DSVR4  -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED    -mstrict-align -I. -I../ccdir/gcc -I../ccdir/gcc/config -I../ccdir/gcc/../include -c -DL${name} \
      ../ccdir/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  powerpc-linux-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
../ccdir/gcc/libgcc2.c:41: stdlib.h: No such file or directory
../ccdir/gcc/libgcc2.c:42: unistd.h: No such file or directory
gmake[3]: *** [libgcc2.a] Error 1
gmake[3]: Leaving directory `/www/arc/egcs-build/gcc'



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]