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]
Other format: [Raw text]

[RFA:] Make ix86-pc-linux-gnulibc1 buildable [fixinc fix included]


Until support for i[3456]86-pc-linux-gnulibc1 is dropped, it
should work to build it out-of-the-box, as long as other
requirements are met (i.e. binutils).  Currently, it doesn't.

This patch is for main trunk.  If it's wanted there, I can fix
the 3.2-branch too.  (Well, it's a regression.)

Once binutils-2.13 is installed (a lower version may be
sufficient) to resolve the more-program-headers-needed-than-
allocated-for issue with some old versions, these changes are
sufficient to let i[3456]86-pc-linux-gnulibc1 build again.

It's not strictly necessary to avoid building ${libgcj}, but
java doesn't really work without MD_FALLBACK_FRAME_STATE_FOR
(without other disabling changes I think); see comment.  I don't
see a point in building java libs for a system that didn't have
it in the first place.  (Languages unfortunately still can't be
default-disabled in configury.)

Bootstrapped and checked on i686-pc-linux-gnu and
i[3456]86-pc-linux-gnulibc1, test-results look comparable.

Ok to commit?

toplevel:
	* configure.in (i[3456]86-*-linux*): Add check to disable
	${libgcj} for glibc1.

gcc:
	* fixinc/inclhack.def (libc1_G_va_list): New fix.
	* fixinc/fixincl.x: Regenerate.
	* config/i386/linux.h: Move MD_FALLBACK_FRAME_STATE_FOR inside
	ifndef IN_LIBGCC2.  Wrap it together with signal.h and
	sys/ucontext.h inclusion in ifndef USE_GNULIBC_1.
	* configure.in (gcc_AC_CHECK_DECLS): Check vasprintf too.
	* config.in, configure: Regenerate.

libstdc++-v3:
	* testsuite/testsuite_hooks.cc (__set_testsuite_memlimit): Use
	__typeof__ (r.rlim_cur), not rlim_t in declaration of limit.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.188
diff -p -c -r1.188 configure.in
*** configure.in	7 Oct 2002 21:07:06 -0000	1.188
--- configure.in	24 Oct 2002 21:07:40 -0000
*************** case "${target}" in
*** 422,427 ****
--- 422,434 ----
      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
      ;;
    i[3456]86-*-linux*)
+     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
+     # not build java stuff by default.
+     case "${target}" in
+       *-*-*libc1*)
+ 	noconfigdirs="$noconfigdirs ${libgcj}";;
+     esac
+
      # This section makes it possible to build newlib natively on linux.
      # If we are using a cross compiler then don't configure newlib.
      if test x${is_cross_compiler} != xno ; then
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.619
diff -p -c -r1.619 configure.in
*** gcc/configure.in	6 Sep 2002 12:00:11 -0000	1.619
--- gcc/configure.in	24 Oct 2002 21:07:44 -0000
*************** saved_CFLAGS="$CFLAGS"
*** 697,703 ****
  CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
  gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
  	strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
!         fprintf_unlocked strstr errno \
  	malloc realloc calloc free basename getopt clock, , ,[
  #include "ansidecl.h"
  #include "system.h"])
--- 697,703 ----
  CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
  gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
  	strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
!         fprintf_unlocked strstr errno vasprintf \
  	malloc realloc calloc free basename getopt clock, , ,[
  #include "ansidecl.h"
  #include "system.h"])
Index: gcc/config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.40
diff -p -c -r1.40 linux.h
*** gcc/config/i386/linux.h	5 Jun 2002 17:01:30 -0000	1.40
--- gcc/config/i386/linux.h	24 Oct 2002 22:06:18 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 230,238 ****
     state data appropriately.  See unwind-dw2.c for the structs.  */

  #ifdef IN_LIBGCC2
  #include <signal.h>
  #include <sys/ucontext.h>
- #endif

  #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)		\
    do {									\
--- 230,242 ----
     state data appropriately.  See unwind-dw2.c for the structs.  */

  #ifdef IN_LIBGCC2
+ /* There's no sys/ucontext.h for some (all?) libc1, so no
+    signal-turned-exceptions for them.  There's also no configure-run for
+    the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H.  Using the
+    target libc1 macro should be enough.  */
+ #ifndef USE_GNULIBC_1
  #include <signal.h>
  #include <sys/ucontext.h>

  #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)		\
    do {									\
*************** Boston, MA 02111-1307, USA.  */
*** 287,289 ****
--- 291,295 ----
      (FS)->retaddr_column = 8;						\
      goto SUCCESS;							\
    } while (0)
+ #endif /* not USE_GNULIBC_1 */
+ #endif /* IN_LIBGCC2 */
Index: gcc/fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.136
diff -p -c -r1.136 inclhack.def
*** gcc/fixinc/inclhack.def	5 Oct 2002 18:21:59 -0000	1.136
--- gcc/fixinc/inclhack.def	24 Oct 2002 21:08:05 -0000
*************** fix = {
*** 1519,1524 ****
--- 1519,1539 ----


  /*
+  *  Fix libc1 _G_va_list definition, used in declarations of several
+  *  more-or-less standard functions, for example vasprintf.
+  */
+ fix = {
+     hackname = libc1_G_va_list;
+     files    = _G_config.h;
+     mach     = '*-*-linux*libc1';
+     select   = 'typedef void \* _G_va_list;';
+     c_fix     = format;
+     c_fix_arg = "typedef __builtin_va_list _G_va_list;";
+     test_text = 'typedef __builtin_va_list _G_va_list;';
+ };
+
+
+ /*
   *  In limits.h, put #ifndefs around things that are supposed to be defined
   *  in float.h to avoid redefinition errors if float.h is included first.
   *  On HP/UX this patch does not work, because on HP/UX limits.h uses
Index: libstdc++-v3/testsuite/testsuite_hooks.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/testsuite_hooks.cc,v
retrieving revision 1.3
diff -p -c -r1.3 testsuite_hooks.cc
*** libstdc++-v3/testsuite/testsuite_hooks.cc	10 Jun 2002 20:52:12 -0000	1.3
--- libstdc++-v3/testsuite/testsuite_hooks.cc	24 Oct 2002 21:08:17 -0000
*************** void
*** 38,44 ****
  __set_testsuite_memlimit(float __size)
  {
      struct rlimit r;
!     rlim_t limit = (rlim_t)(__size * 1048576);

      // Heap size, seems to be common.
  #if _GLIBCPP_HAVE_MEMLIMIT_DATA
--- 38,46 ----
  __set_testsuite_memlimit(float __size)
  {
      struct rlimit r;
!     // Cater to the absence of rlim_t.
!     __typeof__ (r.rlim_cur) limit
!       = (__typeof__ (r.rlim_cur))(__size * 1048576);

      // Heap size, seems to be common.
  #if _GLIBCPP_HAVE_MEMLIMIT_DATA

brgds, H-P


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