solaris patch

Phil Edwards pedwards@disaster.jaj.com
Thu Oct 26 12:48:00 GMT 2000


On Thu, Oct 26, 2000 at 10:37:33AM -0700, Benjamin Kosnik wrote:
> > I've tweaked that like I mentioned (merging the need_xtra stuff).  No build
> > problems so far (except for that freaky modff thing), but I won't be able
> > to test the changes on Linux until this afternoon.
> 
> hmm. If you post your patch I can test on linux.

The patch is below.  The Linux build went well and the testsuite results
are 168/14.


> > Static executables often fail to link:
> > 
> > /tec/build/Ebuild/bin/g++ -g3 -DDEBUG_ASSERT -ffunction-sections
> >   -fdata-sections  -static -I../../../unified/libstdc++-v3/testsuite
> >   -L/tec/build/Ebuild/lib          -Wl,--rpath -Wl,/tec/build/Ebuild/lib
> >   ../../../unified/libstdc++-v3/testsuite/17_intro/header_iostream.cc -o
> >   /tec/build/3test/sparc-sun-solaris2.8/libstdc++-v3/testsuite/header_iostream.st-exe
> > collect2: ld terminated with signal 10 [Bus Error]
> > /usr/lib/libc.a(iconv.o): In function `iconv_open_private':
> > iconv.o(.text+0x
> 
> Hmm. Wow. The wide character stuff compiled on solaris? I'm not quite 

I'll try a couple different linkers and see what happens.  A bus error inside
the system C library is usually a horked-up pointer being passed in, IME.

Phil
P.S.- I'm making many changes to mkcheck to help in the diagnosis.
      Will post a patch once I get something useful.


2000-10-26  David Edelsohn  <dje@watson.ibm.com>
            Phil Edwards  <pme@sources.redhat.com>

	* acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES):  Comment out
	  --gc-sections stuff entirely to avoid misleading people.
	  (GLIBCPP_ENABLE_CSTDIO):  Merge need_libio and need_xtra_libio.
	* libio/Makefile.am (LIBIO_SRCS,LIBIO_WSRCS,LIBIO_XTRA_SRCS):
	  Rearrange and merge.
	* libio/libio.h:  Simplify, make fewer assumptions.  Define those
	  macros which must be defined.
	* config/os/solaris/solaris2.7/bits/os_defines.h:  Simplify as
      a result.


Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.72
diff -u -3 -r1.72 acinclude.m4
--- acinclude.m4	2000/10/26 14:56:03	1.72
+++ acinclude.m4	2000/10/26 19:35:47
@@ -276,22 +276,22 @@
     # --gc-sections doesn't really work at the moment (keeps on discarding
     # used sections, first .eh_frame and now some of the glibc sections for
     # iconv). Bzzzzt. Thanks for playing, maybe next time.
-    AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
-    AC_TRY_RUN([
-     int main(void) 
-     {
-       try { throw 1; }
-       catch (...) { };
-       return 0;
-     }
-    ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
-    if test "$ac_test_CFLAGS" = set; then
-      CFLAGS="$ac_save_CFLAGS"
-    else
-      # this is the suspicious part
-      CFLAGS=''
-    fi
-    if test "$ac_sectionLDflags" = "yes"; then
+#    AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
+#    AC_TRY_RUN([
+#     int main(void) 
+#     {
+#       try { throw 1; }
+#       catch (...) { };
+#       return 0;
+#     }
+#    ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
+#    if test "$ac_test_CFLAGS" = set; then
+#      CFLAGS="$ac_save_CFLAGS"
+#    else
+#      # this is the suspicious part
+#      CFLAGS=''
+#    fi
+#    if test "$ac_sectionLDflags" = "yes"; then
 #      SECTION_LDFLAGS='-Wl,--gc-sections'
 #XXX
       SECTION_LDFLAGS=''
@@ -1247,11 +1247,9 @@
 
         if test x$glibc_satisfactory = x"yes"; then
            need_libio=no
-           need_xtra_libio=no
            need_wlibio=no        
         else
            need_libio=yes
-           need_xtra_libio=yes
            # bkoz XXX need to add checks to enable this
            # pme XXX here's a first pass at such a check
            if test x$enable_c_mbchar != xno; then
@@ -1261,10 +1259,9 @@
            fi
         fi
 
-      # Using libio, but <libio.h> doesn't exist on the target system. . .
       else
+         # Using libio, but <libio.h> doesn't exist on the target system. . .
          need_libio=yes
-         need_xtra_libio=no
          # bkoz XXX need to add checks to enable this
          # pme XXX here's a first pass at such a check
          if test x$enable_c_mbchar != xno; then
@@ -1296,7 +1293,6 @@
   # 2000-08-04 bkoz hack
 
   AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
-  AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
   AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
 ])
 
Index: config/os/solaris/solaris2.7/bits/os_defines.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h,v
retrieving revision 1.2
diff -u -3 -r1.2 os_defines.h
--- os_defines.h	2000/10/09 03:35:36	1.2
+++ os_defines.h	2000/10/26 19:35:47
@@ -28,9 +28,20 @@
 // the GNU General Public License.
 
 
-#ifndef __P
-#  define __P(p) p
-#  define __PMT(p) p
-#endif
+#ifndef _GLIBCPP_OS_DEFINES
+#  define _GLIBCPP_OS_DEFINES
+
+// Need these to get sane definitions, esp. of 64-bit types and typedefs.
+#define _XOPEN_SOURCE        500
+#define _LARGEFILE64_SOURCE  1
+
+// These are typedefs which libio assumes are already in place (because
+// they really are, under Linux).
+#define __off_t     off_t
+#define __off64_t   off64_t
+#define __ssize_t   ssize_t
 
+
+
+#endif
 
Index: libio/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libio/Makefile.am,v
retrieving revision 1.15
diff -u -3 -r1.15 Makefile.am
--- Makefile.am	2000/10/12 11:45:22	1.15
+++ Makefile.am	2000/10/26 19:35:47
@@ -44,28 +44,23 @@
 
 if GLIBCPP_NEED_LIBIO
 LIBIO_SRCS = \
-	filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c
+	filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c iofclose.c \
+    iofopen.c stdio.c
 else
 LIBIO_SRCS =
 endif
 
 if GLIBCPP_NEED_WLIBIO
 LIBIO_WSRCS = \
-	wfiledoalloc.c wfileops.c wgenops.c
+	wfiledoalloc.c wfileops.c wgenops.c iofwide.c
 else
 LIBIO_WSRCS =
 endif
 
-if GLIBCPP_NEED_XTRA_LIBIO
-LIBIO_XTRASRCS = \
-	iofwide.c iofclose.c iofopen.c stdio.c
-else
-LIBIO_XTRASRCS =
-endif
 
 EXTRA_DIST = iostreamP.h
 
-libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS) $(LIBIO_XTRASRCS)
+libio_la_SOURCES = $(LIBIO_SRCS) $(LIBIO_WSRCS)
 
 
 AM_CFLAGS = -D_GNU_SOURCE @DEBUG_FLAGS@ 
Index: libio/libio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libio/libio.h,v
retrieving revision 1.9
diff -u -3 -r1.9 libio.h
--- libio.h	2000/10/25 16:54:47	1.9
+++ libio.h	2000/10/26 19:35:47
@@ -56,17 +56,13 @@
 #endif
 
 #ifndef __P
-# if _G_HAVE_SYS_CDEFS
-#  include <sys/cdefs.h>
+# ifdef __cplusplus
+#  define __THROW throw ()
 # else
-#  ifdef __STDC__
-#   define __P(p) p
-#   define __PMT(p) p
-#  else
-#   define __P(p) ()
-#   define __PMT(p) ()
-#  endif
+#  define __THROW
 # endif
+# define __P(p) p __THROW
+# define __PMT(p) p
 #endif /*!__P*/
 
 /* For backward compatibility */




More information about the Libstdc++ mailing list