This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: documentation for cross compiling.
On Mon, Jul 02, 2001 at 07:09:15PM +0100, Joseph S. Myers wrote:
>
> It should go in doc/install.texi, along with the existing installation
> documentation. Ideally, it should cover everything the documentation in
> doc/install-old.texi does, so the cross compilation documentation there
> can go away; and it should cover enough of what the crossgcc FAQ covers
> that there is no need for users to refer to that either.
While looking at the documentation, I realized that the gcc cross
compiling has been broken for years. See
http://gcc.gnu.org/ml/gcc/2001-06/msg00486.html
http://gcc.gnu.org/ml/gcc/2001-06/msg00499.html
I don't want to write a docummentation for a configuration which
is known not working. I also have different ways to deal with cross
compiling to Linux. I am enclosing my patch here for reference. Let me
warn you first, not everyone agrees my patcch is the right way to go.
But it is the right way for me to build cross compilers for Linux.
Before I update the cross compile docummentation, let's fix gcc first.
H.J.
----
2001-05-10 H.J. Lu (hjl@gnu.org)
* gcc/Makefile.in (LIMITS_H_TEST): Also check
$(tooldir)/include and $(gcc_tooldir)/include for limits.h.
(tooldir): Set to @tooldir@.
2001-04-20 H.J. Lu (hjl@gnu.org)
* gcc/configure.in (inhibit_libc): Don't define for Linux.
* gcc/java/Make-lang.in (jcf-dump$(exeext)): Depend on errors.o
(gcjh$(exeext)): Likewise.
* Makefile.in (BASE_FLAGS_TO_PASS): Remove
"includedir=$(includedir)" \
for canadian cross compile.
--- gcc-2.96-20000731/gcc/configure.in.cross Fri Apr 20 10:06:36 2001
+++ gcc-2.96-20000731/gcc/configure.in Fri Apr 20 10:06:47 2001
@@ -4299,7 +4299,14 @@ fi
# assert.h.
inhibit_libc=
if [test x$host != x$target] && [test x$with_headers = x]; then
- inhibit_libc=-Dinhibit_libc
+ case "${target}" in
+ *linux*)
+ # Linux targets have the C library header files.
+ ;;
+ *)
+ inhibit_libc=-Dinhibit_libc
+ ;;
+ esac
else
if [test x$with_newlib = xyes]; then
inhibit_libc=-Dinhibit_libc
--- gcc-2.96-20000731/gcc/java/Make-lang.in.cross Fri Jul 7 12:40:14 2000
+++ gcc-2.96-20000731/gcc/java/Make-lang.in Fri Apr 20 10:06:47 2001
@@ -59,7 +59,12 @@ GCJ = gcj
# Define the names for selecting java in LANGUAGES.
java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext)
-# Define the name of target independant tools to be installed in $(bindir)
+# errors.o may not be always built for canadian cross compile. Make
+# sure it is built for java.
+jcf-dump$(exeext): errors.o
+gcjh$(exeext): errors.o
+
+# Defin the name of target independant tools to be installed in $(bindir)
# Names are subject to changes
JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
--- gcc-2.96-20000731/gcc/Makefile.in.cross Thu May 10 23:19:54 2001
+++ gcc-2.96-20000731/gcc/Makefile.in Thu May 10 23:23:05 2001
@@ -235,7 +235,10 @@ STMP_FIXPROTO = stmp-fixproto
STMP_FIXINC = stmp-fixinc
# Test to see whether <limits.h> exists in the system header files.
-LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+LIMITS_H_TEST = \
+ [ -f $(SYSTEM_HEADER_DIR)/limits.h ] \
+ || [ -f $(tooldir)/include/limits.h ] \
+ || [ -f $(gcc_tooldir)/include/limits.h ]
target=@target@
target_alias=@target_alias@
@@ -279,6 +282,8 @@ libsubdir = $(libdir)/gcc-lib/$(target_a
unlibsubdir = ../../..
# Directory in which to find other cross-compilation tools and headers.
dollar = @dollar@
+# Used to check limits.h for cross-compiler.
+tooldir = @tooldir@
# Used in install-cross.
gcc_tooldir = @gcc_tooldir@
# Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
--- gcc-2.96-20000731/Makefile.in.cross Fri Apr 20 10:06:58 2001
+++ gcc-2.96-20000731/Makefile.in Fri Apr 20 10:07:03 2001
@@ -360,7 +360,6 @@ BASE_FLAGS_TO_PASS = \
"bindir=$(bindir)" \
"datadir=$(datadir)" \
"exec_prefix=$(exec_prefix)" \
- "includedir=$(includedir)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"libexecdir=$(libexecdir)" \