This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs-20000228 problem building cross compile without a target include tree
- To: gcc-bugs at gcc dot gnu dot org
- Subject: egcs-20000228 problem building cross compile without a target include tree
- From: Tim Shepard <shep at lcs dot mit dot edu>
- Date: Thu, 02 Mar 2000 17:40:15 -0500
Dear gcc-bugs@gcc.gnu.org,
My config.status contains:
--------------------------
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
./configure --with-gcc-version-trigger=/home/shep/alpha/egcs-20000228/gcc/version.c --host=i686-pc-linux-gnu --target=alphaev6-debian-linux-gnu --norecursion
# using "mt-frag"
--------------------------
After untaring egcs-core-20000228.tar.gz and doing
"./configure --target=alphaev6-debian-linux-gnu" and then
running "make", the build had the following trouble while trying to
compile the routines in gcc/libgcc2.c:
--------------------------
make[2]: Entering directory `/home/shep/alpha/egcs-20000228/gcc'
rm -f libgcc2.a
if [ -d . ]; then \
cd .; \
rm -f libgcc.a ; \
else true; \
fi
make GCC_FOR_TARGET="/home/shep/alpha/egcs-20000228/gcc/xgcc -B/home/shep/alpha/egcs-20000228/gcc/ -B/usr/local/alphaev6-debian-linux-gnu/bin/ -I/usr/local/alphaev6-debian-linux-gnu/include" \
AR_FOR_TARGET="alphaev6-debian-linux-gnu-ar" \
AR_FLAGS_FOR_TARGET="rc" \
CC="gcc" CFLAGS="-g -O2" \
HOST_PREFIX="" HOST_PREFIX_1="loser-" \
LANGUAGES="c gcov " \
LIBGCC2_CFLAGS="-O2 -DCROSS_COMPILE -DIN_GCC -g -O2 -I./include -fPIC -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED " libgcc2.a
make[3]: Entering directory `/home/shep/alpha/egcs-20000228/gcc'
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}; \
/home/shep/alpha/egcs-20000228/gcc/xgcc -B/home/shep/alpha/egcs-20000228/gcc/ -B/usr/local/alphaev6-debian-linux-gnu/bin/ -I/usr/local/alphaev6-debian-linux-gnu/include -O2 -DCROSS_COMPILE -DIN_GCC -g -O2 -I./include -fPIC -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I./config -I./../include -c -DL${name} \
./libgcc2.c -o ${name}.o; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
alphaev6-debian-linux-gnu-ar rc tmplibgcc2.a ${name}.o; \
rm -f ${name}.o; \
done
_muldi3
In file included from ./libgcc2.c:35:
tsystem.h:52:18: stdio.h: No such file or directory
tsystem.h:55:22: sys/types.h: No such file or directory
tsystem.h:58:18: errno.h: No such file or directory
tsystem.h:65:19: string.h: No such file or directory
tsystem.h:69:19: stdlib.h: No such file or directory
tsystem.h:70:19: unistd.h: No such file or directory
In file included from ./libgcc2.c:35:
tsystem.h:76:17: time.h: No such file or directory
make[3]: *** [libgcc2.a] Error 1
make[3]: Leaving directory `/home/shep/alpha/egcs-20000228/gcc'
make[2]: *** [stmp-multilib-sub] Error 2
make[2]: Leaving directory `/home/shep/alpha/egcs-20000228/gcc'
make[1]: *** [stmp-multilib] Error 1
make[1]: Leaving directory `/home/shep/alpha/egcs-20000228/gcc'
make: *** [all-gcc] Error 2
--------------------------
A similar problem exists with frame.c.
My patch is included below. It allowed me to succesfully complete the
build. I just moved the "#if defined" stuff a little bit earlier in
libgcc2.c so that it would have its effect before the include of
tsystem.h, and copied the same stuff into frame.c. I believe this is
the right thing in my case, but if the target libc-related include
tree was actually available, then it seems that it would be better to
include the target libc-related header files. Perhaps egcs's or gcc's
./configure should automatically test to see if the header files are
available and turn on inhibit_libc if they are not.
-Tim Shepard
shep@lcs.mit.edu
===================================================================
RCS file: egcs-20000228/gcc/libgcc2.c,v
retrieving revision 1.1
diff -u10 -r1.1 egcs-20000228/gcc/libgcc2.c
--- egcs-20000228/gcc/libgcc2.c 2000/03/02 21:59:47 1.1
+++ egcs-20000228/gcc/libgcc2.c 2000/03/02 22:04:17
@@ -24,36 +24,36 @@
some of which are compiled with GCC, to produce an executable,
this library does not by itself cause the resulting executable
to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/* It is incorrect to include config.h here, because this file is being
compiled for the target, and hence definitions concerning only the host
do not apply. */
+/* In a cross-compilation situation, default to inhibiting compilation
+ of routines that use libc. */
+
+#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
+#define inhibit_libc
+#endif
+
#include "tconfig.h"
#include "tsystem.h"
#include "machmode.h"
#include "defaults.h"
/* Don't use `fancy_abort' here even if config.h says to use it. */
#ifdef abort
#undef abort
-#endif
-
-/* In a cross-compilation situation, default to inhibiting compilation
- of routines that use libc. */
-
-#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
-#define inhibit_libc
#endif
/* Permit the tm.h file to select the endianness to use just for this
file. This is used when the endianness is determined when the
compiler is run. */
#ifndef LIBGCC2_WORDS_BIG_ENDIAN
#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
#endif
===================================================================
RCS file: egcs-20000228/gcc/frame.c,v
retrieving revision 1.1
diff -u10 -r1.1 egcs-20000228/gcc/frame.c
--- egcs-20000228/gcc/frame.c 2000/03/02 22:06:20 1.1
+++ egcs-20000228/gcc/frame.c 2000/03/02 22:06:22
@@ -20,20 +20,27 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with other files,
some of which are compiled with GCC, to produce an executable,
this library does not by itself cause the resulting executable
to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
+/* In a cross-compilation situation, default to inhibiting compilation
+ of routines that use libc. */
+
+#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
+#define inhibit_libc
+#endif
+
/* It is incorrect to include config.h here, because this file is being
compiled for the target, and hence definitions concerning only the host
do not apply. */
#include "tconfig.h"
#include "tsystem.h"
#include "defaults.h"
#ifdef DWARF2_UNWIND_INFO