This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GNU] [SuperH] [M32R] limits.h issue
- From: NIIBE Yutaka <gniibe at fsij dot org>
- To: Nick Clifton <nickc at redhat dot com>, Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Nov 2004 11:53:20 +0900
- Subject: [GNU] [SuperH] [M32R] limits.h issue
Here're two patches for GNU system (specifically GNU/Linux) on SuperH
and M32R. I think that this is common problem among GNU system in
general, but I report specific fixes for SuperH and M32R this time.
Background:
We're now cross-building Debian GNU/Linux for M32R (I was doing that
for SuperH around 2000). I encountered this problem around Y2K, but
at that time, I didn't able to track down what the problem is.
There is an issue that limits.h is wrongly generated when building
cross compiler. Specifically, LIMITS_H_TEST in gcc/Makefile should be
evaluated to be `true', and limits.h should be generated so that it is:
limitx.h + glimits.h + limity.h
That's needed because we have glibc's limits.h.
However, LIMITS_H_TEST will be evaluated to be `false', because it
checks the existence of $(gcc_tooldir)/sys-include.
The problem is (I think):
When building cross GCC, it assumes that the header files are
placed at $(gcc_tooldir)/sys-include. It is true for non-GNU
system, but for GNU system where we use GNU C library as
native library, it's $(gcc_tooldir)/include instead.
So, here is a fix for SuperH.
(Note: I've sent assign.futere already,so there is no leagal problem.)
Index: gcc/config/sh/t-linux
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/sh/t-linux,v
retrieving revision 1.15
diff -c -3 -p -r1.15 t-linux
*** gcc/config/sh/t-linux 17 Nov 2004 05:39:02 -0000 1.15
--- gcc/config/sh/t-linux 25 Nov 2004 02:32:48 -0000
*************** SHLIB_INSTALL = \
*** 41,43 ****
--- 41,46 ----
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(INSTALL_DATA) $(SHLIB_SOLINK) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+
+ # We're GNU system, where GNU C library is native C library.
+ CROSS_SYSTEM_HEADER_DIR = $(gcc_tooldir)/include
And for M32R, here it is.
(If it is better to file another assignment, please send me current
version of asignment paper, I'll do that.)
This is tested for build=i386-pc-linux-gnu,
target=m32r-unknown-linux-gnu,
where GNU C library is installed, and works fine.
Index: gcc/config/m32r/t-linux
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/m32r/t-linux,v
retrieving revision 1.2
diff -c -3 -p -r1.2 t-linux
*** gcc/config/m32r/t-linux 22 Nov 2004 12:34:37 -0000 1.2
--- gcc/config/m32r/t-linux 25 Nov 2004 02:32:47 -0000
*************** CROSS_LIBGCC1 =
*** 41,43 ****
--- 41,46 ----
LIBGCC1_TEST =
SHLIB_MAPFILES = $(srcdir)/config/m32r/libgcc-glibc.ver
+
+ # We're GNU system, where GNU C library is native C library.
+ CROSS_SYSTEM_HEADER_DIR = $(gcc_tooldir)/include