PATCH: V3/AIX

Mark Mitchell mark@codesourcery.com
Tue Jan 23 10:10:00 GMT 2001


Here's the draft patch that allows AIX to "just build".

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Index: ltconfig
===================================================================
RCS file: /cvs/gcc/egcs/ltconfig,v
retrieving revision 1.13
diff -c -p -r1.13 ltconfig
*** ltconfig	2001/01/02 15:55:07	1.13
--- ltconfig	2001/01/23 18:02:53
*************** enable_shared=yes
*** 195,200 ****
--- 195,201 ----
  # All known linkers require a `.a' archive for static linking (except M$VC,
  # which needs '.lib').
  enable_static=yes
+ both_libs=yes 
  enable_fast_install=yes
  enable_dlopen=unknown
  enable_win32_dll=no
*************** test "$can_build_shared" = "no" && enabl
*** 1425,1439 ****
  # are all built from PIC.
  case "$host_os" in
  aix3*)
-   test "$enable_shared" = yes && enable_static=no
    if test -n "$RANLIB"; then
      archive_cmds="$archive_cmds~\$RANLIB \$lib"
      postinstall_cmds='$RANLIB $lib'
    fi
    ;;
  
  aix4*)
!   test "$enable_shared" = yes && enable_static=no
    ;;
  esac
  
--- 1426,1440 ----
  # are all built from PIC.
  case "$host_os" in
  aix3*)
    if test -n "$RANLIB"; then
      archive_cmds="$archive_cmds~\$RANLIB \$lib"
      postinstall_cmds='$RANLIB $lib'
    fi
+   both_libs=no
    ;;
  
  aix4*)
!   both_libs=no
    ;;
  esac
  
*************** build_libtool_need_lc=$need_lc
*** 2115,2120 ****
--- 2116,2125 ----
  
  # Whether or not to build static libraries.
  build_old_libs=$enable_static
+ 
+ # Whether to build shared libraries and static libraries at the same 
+ # time.
+ build_both_libs=$both_libs
  
  # Whether or not to optimize for fast installation.
  fast_install=$enable_fast_install
Index: ltmain.sh
===================================================================
RCS file: /cvs/gcc/egcs/ltmain.sh,v
retrieving revision 1.10
diff -c -p -r1.10 ltmain.sh
*** ltmain.sh	2000/09/30 06:02:57	1.10
--- ltmain.sh	2001/01/23 18:02:57
*************** if test "$LTCONFIG_VERSION" != "$VERSION
*** 89,100 ****
    exit 1
  fi
  
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-   echo "$modename: not configured to build any kind of library" 1>&2
-   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-   exit 1
- fi
- 
  # Global variables.
  mode=$default_mode
  nonopt=
--- 89,94 ----
*************** done
*** 234,239 ****
--- 228,254 ----
  if test -n "$prevopt"; then
    $echo "$modename: option \`$prevopt' requires an argument" 1>&2
    $echo "$help" 1>&2
+   exit 1
+ fi
+ 
+ # If it doesn't make sense to build both shared and static libraries
+ # on this target because they're actually the same thing, and both
+ # are enabled, turn one off.
+ if test "$build_both_libs" = no; then
+   if test "$build_libtool_libs" = yes && test "$build_old_libs" = yes; then
+     build_old_libs=no 
+   fi
+ fi
+ 
+ # Check to see that we're able to build some kind of library.  We do
+ # this check after processing our command-line arguments because
+ # --disable-shared and --disable-static turn off libtool libs and
+ # old libs, respectively.  If there's nothing left, then we're
+ # in trouble.
+ 
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+   echo "$modename: not configured to build any kind of library" 1>&2
+   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    exit 1
  fi
  
Index: gcc/acconfig.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/acconfig.h,v
retrieving revision 1.49
diff -c -p -r1.49 acconfig.h
*** acconfig.h	2000/05/27 22:05:01	1.49
--- acconfig.h	2001/01/23 18:03:11
***************
*** 25,27 ****
--- 25,41 ----
  
  /* Define to `int' if <sys/types.h> doesn't define.  */
  #undef ssize_t
+ 
+ @BOTTOM@
+ 
+ /* Bison unconditionally undefines `const' if neither `__STDC__' nor
+    __cplusplus are defined.  That's a problem since we use `const' in
+    the GCC headers, and the resulting bison code is therefore type
+    unsafe.  Thus, we must match the bison behavior here.  */
+ 
+ #ifndef __STDC__
+ #ifndef __cplusplus
+ #undef const
+ #define const
+ #endif
+ #endif
Index: gcc/config.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.in,v
retrieving revision 1.93
diff -c -p -r1.93 config.in
*** config.in	2001/01/21 01:51:41	1.93
--- config.in	2001/01/23 18:03:11
***************
*** 452,454 ****
--- 452,466 ----
  /* Define to 1 if you want to enable namespaces (-fhonor-std) by default. */
  #undef ENABLE_STD_NAMESPACE
  
+ 
+ /* Bison unconditionally undefines `const' if neither `__STDC__' nor
+    __cplusplus are defined.  That's a problem since we use `const' in
+    the GCC headers, and the resulting bison code is therefore type
+    unsafe.  Thus, we must match the bison behavior here.  */
+ 
+ #ifndef __STDC__
+ #ifndef __cplusplus
+ #undef const
+ #define const
+ #endif
+ #endif
Index: libstdc++-v3/config/cpu/generic/bits/atomicity.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/cpu/generic/bits/atomicity.h,v
retrieving revision 1.2
diff -c -p -r1.2 atomicity.h
*** atomicity.h	2000/08/22 18:24:16	1.2
--- atomicity.h	2001/01/23 18:03:37
***************
*** 1,5 ****
  /* Low-level functions for atomic operations.  Stub version.
!    Copyright (C) 1997 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
--- 1,5 ----
  /* Low-level functions for atomic operations.  Stub version.
!    Copyright (C) 1997, 2001 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
*************** __attribute__ ((__unused__))
*** 36,52 ****
  __atomic_add (_Atomic_word* __mem, int __val)
  {
    *__mem += __val;
- }
- 
- static inline int
- __attribute__ ((__unused__))
- __compare_and_swap (long *__p, long __oldval, long __newval)
- {
-   if (*__p != __oldval)
-     return 0;
- 
-   *__p = __newval;
-   return 1;
  }
  
  #endif /* atomicity.h */
--- 36,41 ----
Index: libstdc++-v3/config/os/aix/bits/atomicity.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/aix/bits/atomicity.h,v
retrieving revision 1.1
diff -c -p -r1.1 atomicity.h
*** atomicity.h	2000/10/07 18:39:05	1.1
--- atomicity.h	2001/01/23 18:03:37
***************
*** 1,5 ****
  /* Low-level functions for atomic operations.  AIX version.
!    Copyright (C) 2000 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
--- 1,5 ----
  /* Low-level functions for atomic operations.  AIX version.
!    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
***************
*** 20,26 ****
  #ifndef _BITS_ATOMICITY_H
  #define _BITS_ATOMICITY_H       1
  
! /* Should this be type long so 64-bit word in 64-bit mode?  */
  typedef int _Atomic_word;
  
  #include <sys/atomic_op.h>
--- 20,33 ----
  #ifndef _BITS_ATOMICITY_H
  #define _BITS_ATOMICITY_H       1
  
! /* We cannot use the cpu/powerpc/bits/atomicity.h inline assembly
!    definitions for these operations since they depend on operations
!    that are not available on the original POWER architecture.  AIX
!    still runs on the POWER architecture, so it would be incorrect to
!    assume the existence of these instructions.  */
! 
! /* This should match the type pointed to by atomic_p in
!    <sys/atomic_op.h>.  */
  typedef int _Atomic_word;
  
  #include <sys/atomic_op.h>
*************** __attribute__ ((unused))
*** 37,72 ****
  __atomic_add (atomic_p __mem, int __val)
  {
    (void) fetch_and_add (__mem, __val);
- }
- 
- static inline int
- __attribute__ ((unused))
- __compare_and_swap (atomic_l __p, long int __oldval, long int __newval)
- {
-   return compare_and_swaplp (__p, &__oldval, __newval);
- }
- 
- static inline long
- __attribute__ ((unused))
- __always_swap (atomic_l __p, long int __newval)
- {
-   long __val = *__p;
- 
-   while (! compare_and_swaplp (__p, &__val, __newval))
-     /* EMPTY */;
- 
-   return __val;
- }
- 
- static inline int
- __attribute__ ((unused))
- __test_and_set (atomic_l __p, long int __newval)
- {
-   long __val = 0;
- 
-   (void) compare_and_swaplp (__p, &__val, __newval);
- 
-   return __val;
  }
  
  #endif /* atomicity.h */
--- 44,49 ----


More information about the Gcc-patches mailing list