Patch for limits.h and RTEMS

Ian Lance Taylor ian@zembu.com
Mon Mar 29 08:41:00 GMT 1999


gcc can build two different versions of limits.h.  If there is a
system limits.h, it builds a limits.h which includes the system one
and then ensures that certain values are set correctly.

gcc checks whether there is a system limits.h by looking in a specific
directory, normally /usr/include.  When building a cross compiler, it
looks in $(tooldir)/sys-include; the user is expected to preinstall
the appropriate header files in that directory.

This works fine, except for a couple of environments which are
normally build in conjunction with gcc.  For these environments,
limits.h does exist, but it is not yet installed in
$(tooldir)/sys-include; it lives in a directory parallel to the gcc
source directory.

The two environments I know of which have this problem are cygwin and
RTEMS.  For cygwin, I fixed the problem over a year ago:

Wed Jan 28 20:04:43 1998  Ian Lance Taylor  <ian@cygnus.com>

	* i386/t-cygwin32 (LIMITS_H_TEST, LIBGCC2_INCLUDES): Define.

Here is the appropriate patch for RTEMS.  Since gcc includes some
RTEMS configuration information, it should include this as well.

Ian


Mon Mar 29 11:37:49 1999  Ian Lance Taylor  <ian@zembu.com>

	* t-rtems (LIMITS_H_TEST, LIBGCC2_INCLUDES): Define.


Index: t-rtems
===================================================================
RCS file: /zembu/cvsfiles/tools/egcs/gcc/config/t-rtems,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -u -r1.1.1.2 -r1.5
--- t-rtems	1998/12/04 18:55:54	1.1.1.2
+++ t-rtems	1998/12/04 19:09:12	1.5
@@ -4,3 +4,10 @@
 # Don't install "assert.h" in gcc.  RTEMS uses the one in newlib.
 INSTALL_ASSERT_H =
 
+# RTEMS always has limits.h.
+LIMITS_H_TEST = true
+
+# If we are building next to newlib, this will let us find the RTEMS
+# limits.h when building libgcc2.  Otherwise, newlib must be installed
+# first.
+LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include


More information about the Gcc-patches mailing list