This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Patches to support libio default, V3 testsuite results, on FreeBSD 3.4
- To: libstdc++ at sources dot redhat dot com
- Subject: Patches to support libio default, V3 testsuite results, on FreeBSD 3.4
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Tue, 14 Nov 2000 06:32:48 -0600 (CST)
- CC: pfeifer at dbai dot tuwien dot ac dot at, obrien at freebsd dot org, espie at cvs dot openbsd dot org
- Reply-to: rittle at rsch dot comm dot mot dot com
WARNING: This posting is for comments only. It is incomplete (and
probably wrong) at this point.
These first two patches are hacks to allow testing when libstdc++-v3
was built in a tree configured with --enable-threads\=posix on a
FreeBSD machine (at least until we make libstdc++-v3 multilib'd on
this platform). I believe that the first patch is legitimate since
(as far as I know) we don't like shared libraries to have a dependency
on libc on this platform. The second patch should not be needed once
I enable weak symbol support ala gcc/gthr-posix.h (in fact, I think I
may directly use gcc's configuration of mutex primitives as found in
$obj/gcc/gthr-default.h instead of the technique used below).
Next, the patch to os_defines.h (basically a new file) for BSD hosts.
I attempt to handle the fact that _IO_lock_* macros must be provided
if --enable-threads\=posix was provided. I think the file as shown
will now only configure with --enable-threads\=posix. Unfortunately,
it appears that os_defines.h is included very early; too early to
see include/bits/c++config.h and include/bits/c++threads.h (given
the machinery of gcc/gthr-default.h exists, the latter seems rather
pointless).
The final patch protects some symbols in libio/libio.h from macro
substitution using the standard technique. I want to provide a macro
to provide those symbols not a function (since it is quite unclear how
I might go about adding a platform-specific function that must be
bound into libstdc++-v3). Now, I see why libio wants me to provide a
real function for those entry points (since libio believes they will
be used as a callback), but (as far as I know) I don't need to do that
for my platform since I also null out the entry point that would of
taken those symbols...
If I have gotten too tricky, I will need more guidance on the use of
those _IO_* macros that must be provided externally by a platform
that wants to use libio and --enable-threads\=posix.
After the patches (remember, none of which are to be applied) are the
testsuite results. Configured with libio looks as good as or better
than with --enable-cstdio=stdio. Less run-time failures were seen.
For static, only 3 build-time and 2 run-time failures remain.
For dynamic, I don't know what the problem is yet. Here is a sample
failure:
/var/tmp/ccm41993.o: In function `__static_initialization_and_destruction_0':
[...]/egcs/libstdc++-v3/include/bits/concept_checks.h:55:
undefined reference to `std::ios_base::Init::Init(void)'
[...]/egcs/libstdc++-v3/include/bits/concept_checks.h:55:
undefined reference to `std::ios_base::Init::~Init(void)'
These also seemed to be common errors:
[...]: undefined reference to `std::__length_error(char const *)'
[...]: undefined reference to `std::locale::_S_classic'
[...]: undefined reference to `std::locale::_S_global'
[...]: undefined reference to `std::locale::classic(void)'
[...]: undefined reference to `std::cout'
Thanks to Gaby for inspiring me to go on. He may regret it after
seeing what I have come up with. ;-)
Regards,
Loren
Index: ltconfig
===================================================================
RCS file: /cvs/gcc/egcs/ltconfig,v
retrieving revision 1.11
diff -c -r1.11 ltconfig
*** ltconfig 2000/11/09 21:41:11 1.11
--- ltconfig 2000/11/14 11:26:46
***************
*** 1012,1017 ****
--- 1012,1018 ----
freebsd-elf*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
need_version=no
+ need_lc=no
need_lib_prefix=no
;;
freebsd-*)
Index: libstdc++-v3/mkcheck.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mkcheck.in,v
retrieving revision 1.32
diff -c -r1.32 mkcheck.in
*** mkcheck.in 2000/11/13 23:49:41 1.32
--- mkcheck.in 2000/11/14 11:26:55
***************
*** 125,131 ****
$LIB_PATH/../libsupc++/libsupc++.la $LIB_PATH/libstdc++.la \
-no-install"
LTEXE="$LIBTOOL --mode=execute"
! LIBS="-nodefaultlibs -lc -lgcc -lc"
elif [ $WHICH -eq 1 ]; then
# For the installed version, we really only need to use libtool and
# the .la file to get correct rpaths.
--- 125,131 ----
$LIB_PATH/../libsupc++/libsupc++.la $LIB_PATH/libstdc++.la \
-no-install"
LTEXE="$LIBTOOL --mode=execute"
! LIBS="-nodefaultlibs -lc_r -lgcc -lc_r"
elif [ $WHICH -eq 1 ]; then
# For the installed version, we really only need to use libtool and
# the .la file to get correct rpaths.
Index: libstdc++-v3/config/os/bsd/bits/os_defines.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/os/bsd/bits/os_defines.h,v
retrieving revision 1.3
diff -c -r1.3 os_defines.h
*** os_defines.h 2000/10/25 12:50:05 1.3
--- os_defines.h 2000/11/14 11:26:55
***************
*** 35,41 ****
--- 35,88 ----
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
+ #include <sys/types.h>
+ #include <pthread.h>
+ /* BSD system headers traditionally define the __P macro (luckily, for
+ a similar purpose, however libio/libio.h's exact definition breaks
+ our system headers), thus we need to resolve any conflicts between
+ libio/libio.h and our system headers. We also need to define the
+ other macros defined in libio/libio.h since they won't be defined
+ when __P is already defined. */
+ #undef __P
+ #define __P(p) p
+ #define __PMT(p) p
+ #ifdef __cplusplus
+ # define __THROW throw ()
+ #else
+ # define __THROW
#endif
+ /* The following supports --enable-threads\=posix (some code taken
+ from /usr/include/bits/stdio-lock.h). */
+ typedef pthread_mutex_t _IO_lock_t;
+ /* We need recursive (counting) mutexes. Thus _IO_lock_initializer
+ and _IO_lock_init are currently wrong. */
+ #define _IO_lock_initializer PTHREAD_MUTEX_INITIALIZER
+
+ #define _IO_lock_init(_name) pthread_mutex_init (&_name, NULL)
+ #define _IO_lock_fini(_name) pthread_mutex_destroy (&_name)
+ #define _IO_lock_lock(_name) pthread_mutex_lock (&_name)
+ #define _IO_lock_unlock(_name) pthread_mutex_unlock (&_name)
+
+ #define _IO_flockfile(_fp)
+ #define _IO_funlockfile(_fp)
+ #define _IO_cleanup_region_start(_fct, _fp)
+ #define _IO_cleanup_region_end(_doit)
+
+ #ifdef __FreeBSD__
+ /* Warning to other BSD maintainers: GCC *does* use thunks on FreeBSD;
+ it probably doesn't on your BSD. */
+ #undef _G_USING_THUNKS
+ #define _G_USING_THUNKS 1
+
+ typedef off_t __off_t;
+ typedef off_t __off64_t;
+ typedef ssize_t __ssize_t;
+ #define stat64 stat
+ #else
+ #error Must add support for your BSD box here.
+ #endif
+
+ #endif
Index: libstdc++-v3/libio/libio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libio/libio.h,v
retrieving revision 1.11
diff -c -r1.11 libio.h
*** libio.h 2000/10/29 21:52:54 1.11
--- libio.h 2000/11/14 11:26:55
***************
*** 438,445 ****
#define _IO_PENDING_OUTPUT_COUNT(_fp) \
((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
! extern void _IO_flockfile (_IO_FILE *) __THROW;
! extern void _IO_funlockfile (_IO_FILE *) __THROW;
extern int _IO_ftrylockfile (_IO_FILE *) __THROW;
#ifdef _IO_MTSAFE_IO
--- 438,445 ----
#define _IO_PENDING_OUTPUT_COUNT(_fp) \
((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
! extern void (_IO_flockfile) (_IO_FILE *) __THROW;
! extern void (_IO_funlockfile) (_IO_FILE *) __THROW;
extern int _IO_ftrylockfile (_IO_FILE *) __THROW;
#ifdef _IO_MTSAFE_IO
host: FreeBSD 3.4-STABLE FreeBSD 3.4-STABLE #1: Tue Mar 7 20:58:44 CST 2000 root@latour.rsch.comm.mot.com:/usr/src/sys/compile/LATOUR i386
compiler: g++: No input files
Configured with: /usr/users/rittle/outside-cvs-src/egcs/configure --enable-shared --enable-threads=posix --enable-cstdio=stdio --prefix=/usr/local/beta-gcc --with-gnu-as --with-as=/usr/local/beta-gcc/bin/as --with-gnu-ld --with-ld=/usr/local/beta-gcc/bin/ld i686-unknown-freebsd3.4
compiler flags: -ggdb3 -DDEBUG_ASSERT -ffunction-sections -fdata-sections
date: 20001114
pass/fail results: 109/73
p == pass/fail execution test
+: pass, -b: build failure, -r: run failure, x: disabled
ctime == time to compile and link
etime == time for executable to run
text == size of the executable text section
data == size of the executable data section
total == size of the executable
(First static, then shared.)
p ctime etime text data total name
+ 1 0.097 66947 4060 109722 17_intro/header_ciso646.cc
+ 2 0.116 873 16 18350 17_intro/header_ciso646.cc
+ 7 0.097 66484 4072 257392 17_intro/header_fstream.cc
+ 6 0.101 426 28 165588 17_intro/header_fstream.cc
+ 5 0.098 66484 4060 205877 17_intro/header_iomanip.cc
+ 5 0.103 426 16 114073 17_intro/header_iomanip.cc
+ 4 0.097 66484 4060 174943 17_intro/header_ios.cc
+ 4 0.103 426 16 83139 17_intro/header_ios.cc
+ 1 0.099 66484 4060 104951 17_intro/header_iosfwd.cc
+ 1 0.103 426 16 13144 17_intro/header_iosfwd.cc
+ 5 0.098 251543 9400 1800244 17_intro/header_iostream.cc
-b 4 0.098 0 0 0 17_intro/header_iostream.cc
+ 5 0.098 66484 4060 203397 17_intro/header_istream.cc
+ 5 0.103 426 16 111593 17_intro/header_istream.cc
+ 4 0.100 66484 4060 174951 17_intro/header_ostream.cc
+ 4 0.130 426 16 83147 17_intro/header_ostream.cc
+ 5 0.097 66484 4060 203397 17_intro/header_sstream.cc
+ 5 0.104 426 16 111593 17_intro/header_sstream.cc
+ 4 0.099 66484 4060 174930 17_intro/header_streambuf.cc
+ 4 0.102 426 16 83126 17_intro/header_streambuf.cc
+ 13 0.115 251895 9912 1885853 17_intro/headers.cc
-b 11 0.115 0 0 0 17_intro/headers.cc
+ 2 0.098 91159 4588 264598 18_support/numeric_limits.cc
+ 2 0.102 16317 500 134173 18_support/numeric_limits.cc
-b 3 0.102 0 0 0 20_util/auto_ptr.cc
-b 3 0.102 0 0 0 20_util/auto_ptr.cc
+ 8 0.100 118978 4740 686315 21_strings/append.cc
-b 8 0.100 0 0 0 21_strings/append.cc
+ 9 0.097 118973 4748 613351 21_strings/capacity.cc
-b 9 0.097 0 0 0 21_strings/capacity.cc
+ 5 0.097 97965 4740 401580 21_strings/char_traits.cc
-b 5 0.097 0 0 0 21_strings/char_traits.cc
+ 5 0.097 101965 4740 414174 21_strings/compare.cc
-b 5 0.097 0 0 0 21_strings/compare.cc
+ 7 0.099 107389 4740 508409 21_strings/ctor_copy_dtor.cc
-b 6 0.099 0 0 0 21_strings/ctor_copy_dtor.cc
+ 5 0.098 98877 4740 406402 21_strings/element_access.cc
-b 5 0.098 0 0 0 21_strings/element_access.cc
+ 8 0.235 119404 4740 570921 21_strings/find.cc
-b 8 0.235 0 0 0 21_strings/find.cc
+ 8 0.099 110253 4740 513869 21_strings/insert.cc
-b 7 0.099 0 0 0 21_strings/insert.cc
+ 12 0.335 258855 9368 1964173 21_strings/inserters_extractors.cc
-b 15 0.335 0 0 0 21_strings/inserters_extractors.cc
+ 6 0.098 106685 4740 447265 21_strings/invariants.cc
-b 7 0.098 0 0 0 21_strings/invariants.cc
+ 7 0.097 113341 4740 480806 21_strings/nonmember.cc
-b 7 0.097 0 0 0 21_strings/nonmember.cc
+ 6 0.098 99725 4740 408313 21_strings/operations.cc
-b 5 0.098 0 0 0 21_strings/operations.cc
+ 8 0.098 109645 4740 521853 21_strings/replace.cc
-b 7 0.098 0 0 0 21_strings/replace.cc
+ 5 0.106 98925 4740 404978 21_strings/rfind.cc
-b 5 0.106 0 0 0 21_strings/rfind.cc
+ 6 0.098 102509 4740 454693 21_strings/substr.cc
-b 6 0.098 0 0 0 21_strings/substr.cc
+ 8 0.099 252426 9368 1889964 22_locale/codecvt_char_char.cc
-b 7 0.099 0 0 0 22_locale/codecvt_char_char.cc
+ 7 0.099 66484 4072 257285 22_locale/codecvt_unicode_char.cc
+ 6 0.109 426 28 165481 22_locale/codecvt_unicode_char.cc
+ 6 0.098 66484 4072 257291 22_locale/codecvt_unicode_wchar_t.cc
+ 6 0.104 426 28 165487 22_locale/codecvt_unicode_wchar_t.cc
-r 8 0.107 253194 9368 1892637 22_locale/codecvt_wchar_t_char.cc
-b 7 0.107 0 0 0 22_locale/codecvt_wchar_t_char.cc
+ 7 0.101 66484 4072 257273 22_locale/ctor_copy_dtor.cc
+ 7 0.104 426 28 165469 22_locale/ctor_copy_dtor.cc
+ 8 0.098 252474 9624 1869091 22_locale/ctype.cc
-b 7 0.098 0 0 0 22_locale/ctype.cc
+ 8 0.098 253114 9432 1867198 22_locale/ctype_char_members.cc
-b 7 0.098 0 0 0 22_locale/ctype_char_members.cc
+ 7 0.098 66484 4072 257287 22_locale/ctype_wchar_t_members.cc
+ 6 0.104 426 28 165483 22_locale/ctype_wchar_t_members.cc
+ 12 0.099 259431 10936 2052690 22_locale/facet.cc
-b 12 0.099 0 0 0 22_locale/facet.cc
+ 8 0.099 253050 9400 1911290 22_locale/global_templates.cc
-b 8 0.099 0 0 0 22_locale/global_templates.cc
+ 9 0.099 252586 9400 1913548 22_locale/operators.cc
-b 8 0.099 0 0 0 22_locale/operators.cc
+ 8 0.100 253018 9400 1889091 22_locale/static_members.cc
-b 8 0.100 0 0 0 22_locale/static_members.cc
+ 9 0.153 257975 9880 1921637 23_containers/bitset_ctor.cc
-b 8 0.153 0 0 0 23_containers/bitset_ctor.cc
+ 10 0.731 272631 9880 1949512 23_containers/bitset_shift.cc
-b 10 0.731 0 0 0 23_containers/bitset_shift.cc
-b 6 0.731 0 0 0 23_containers/map_operators.cc
-b 6 0.731 0 0 0 23_containers/map_operators.cc
+ 9 0.000 259143 9368 1907769 23_containers/multiset.cc
-b 9 0.000 0 0 0 23_containers/multiset.cc
-b 6 0.000 0 0 0 23_containers/set_operators.cc
-b 6 0.000 0 0 0 23_containers/set_operators.cc
+ 5 0.100 99223 4592 356424 23_containers/vector_capacity.cc
+ 6 0.103 24381 512 226165 23_containers/vector_capacity.cc
+ 12 0.098 284612 9356 2035946 23_containers/vector_ctor.cc
-b 13 0.098 0 0 0 23_containers/vector_ctor.cc
+ 4 0.101 253844 9356 1778531 23_containers/vector_element_access.cc
-b 4 0.101 0 0 0 23_containers/vector_element_access.cc
+ 7 0.098 108151 4592 476261 23_containers/vector_modifiers.cc
+ 7 0.102 33309 512 346038 23_containers/vector_modifiers.cc
+ 8 0.266 255511 9336 1889460 24_iterators/istreambuf_iterator.cc
-b 8 0.266 0 0 0 24_iterators/istreambuf_iterator.cc
+ 11 0.097 124493 4740 707035 24_iterators/iterator.cc
-b 11 0.097 0 0 0 24_iterators/iterator.cc
+ 3 0.098 68383 4060 169944 25_algorithms/lower_bound.cc
+ 3 0.102 2309 16 78574 25_algorithms/lower_bound.cc
+ 3 0.097 67087 4060 145686 25_algorithms/min_max.cc
+ 3 0.102 1013 16 54312 25_algorithms/min_max.cc
+ 10 0.000 255879 9368 1935798 26_numerics/binary_closure.cc
-b 8 0.000 0 0 0 26_numerics/binary_closure.cc
+ 2 0.098 66877 4060 109767 26_numerics/buggy_complex.cc
+ 2 0.105 819 16 17960 26_numerics/buggy_complex.cc
+ 2 0.107 71505 4796 139462 26_numerics/c_math.cc
-b 1 0.107 0 0 0 26_numerics/c_math.cc
+ 9 0.101 262791 9336 1914487 26_numerics/complex_inserters_extractors.cc
-b 8 0.101 0 0 0 26_numerics/complex_inserters_extractors.cc
+ 6 0.098 92055 4588 323562 26_numerics/valarray.cc
+ 6 0.103 17213 500 180886 26_numerics/valarray.cc
+ 10 0.104 261588 9856 1925012 27_io/filebuf.cc
-b 10 0.104 0 0 0 27_io/filebuf.cc
+ 8 0.099 252004 9312 1896292 27_io/filebuf_members.cc
-b 8 0.099 0 0 0 27_io/filebuf_members.cc
+ 4 0.098 68584 4060 194885 27_io/fpos.cc
+ 4 0.103 2510 16 103511 27_io/fpos.cc
+ 9 0.791 252404 9312 1894006 27_io/ifstream_members.cc
-b 8 0.791 0 0 0 27_io/ifstream_members.cc
+ 7 0.103 252647 9304 1872966 27_io/ios_base_callbacks.cc
-b 7 0.103 0 0 0 27_io/ios_base_callbacks.cc
+ 7 0.105 252423 9336 1866670 27_io/ios_base_members_static.cc
-b 6 0.105 0 0 0 27_io/ios_base_members_static.cc
+ 8 0.099 253703 9304 1870006 27_io/ios_ctor.cc
-b 7 0.099 0 0 0 27_io/ios_ctor.cc
+ 11 777.000 255303 9400 1949716 27_io/ios_manip_basefield.cc
-b 10 777.000 0 0 0 27_io/ios_manip_basefield.cc
+ 11 0.000 256055 9400 1953445 27_io/ios_manip_fmtflags.cc
-b 10 0.000 0 0 0 27_io/ios_manip_fmtflags.cc
+ 6 0.100 253463 9304 1825184 27_io/ios_members.cc
-b 5 0.100 0 0 0 27_io/ios_members.cc
+ 5 0.099 66484 4060 203377 27_io/istream.cc
+ 5 0.102 426 16 111573 27_io/istream.cc
+ 12 1.000 267783 10680 1961499 27_io/istream_extractor_arith.cc
-b 11 1.000 0 0 0 27_io/istream_extractor_arith.cc
+ 9 0.106 257591 9336 1885394 27_io/istream_extractor_char.cc
-b 7 0.106 0 0 0 27_io/istream_extractor_char.cc
+ 10 0.101 257172 9344 1939188 27_io/istream_extractor_other.cc
-b 9 0.101 0 0 0 27_io/istream_extractor_other.cc
+ 8 0.099 253511 9336 1878696 27_io/istream_manip.cc
-b 7 0.099 0 0 0 27_io/istream_manip.cc
+ 11 0.102 260215 9368 1946612 27_io/istream_seeks.cc
-b 10 0.102 0 0 0 27_io/istream_seeks.cc
+ 7 0.100 252583 9336 1873327 27_io/istream_sentry.cc
-b 6 0.100 0 0 0 27_io/istream_sentry.cc
+ 11 0.158 264583 9368 1961676 27_io/istream_unformatted.cc
-b 11 0.158 0 0 0 27_io/istream_unformatted.cc
+ 8 0.100 252679 9336 1899403 27_io/istringstream_members.cc
-b 8 0.100 0 0 0 27_io/istringstream_members.cc
+ 12 0.000 252263 9912 1914342 27_io/narrow_stream_objects.cc
-b 12 0.000 0 0 0 27_io/narrow_stream_objects.cc
+ 9 0.853 252436 9312 1892642 27_io/ofstream_members.cc
-b 9 0.853 0 0 0 27_io/ofstream_members.cc
+ 4 0.099 66484 4060 174931 27_io/ostream.cc
+ 5 0.104 426 16 83127 27_io/ostream.cc
-r 12 0.130 262247 9368 1961662 27_io/ostream_inserter_arith.cc
-b 11 0.130 0 0 0 27_io/ostream_inserter_arith.cc
+ 11 0.260 260167 9368 1954408 27_io/ostream_inserter_char.cc
-b 10 0.260 0 0 0 27_io/ostream_inserter_char.cc
+ 10 0.383 254215 9368 1921838 27_io/ostream_inserter_other.cc
-b 10 0.383 0 0 0 27_io/ostream_inserter_other.cc
+ 9 0.099 254999 9336 1901530 27_io/ostream_manip.cc
-b 7 0.099 0 0 0 27_io/ostream_manip.cc
+ 10 0.101 252631 9368 1913865 27_io/ostream_seeks.cc
-b 9 0.101 0 0 0 27_io/ostream_seeks.cc
+ 8 0.101 252311 9336 1872496 27_io/ostream_unformatted.cc
-b 7 0.101 0 0 0 27_io/ostream_unformatted.cc
+ 7 0.100 257127 9464 1856196 27_io/streambuf.cc
-b 7 0.100 0 0 0 27_io/streambuf.cc
+ 9 0.100 265946 9688 1910237 27_io/stringbuf.cc
-b 9 0.100 0 0 0 27_io/stringbuf.cc
+ 9 0.106 255767 9432 1920884 27_io/stringstream.cc
-b 9 0.106 0 0 0 27_io/stringstream.cc
+ 12 0.100 251943 9912 1886088 27_io/wide_stream_objects.cc
-b 12 0.100 0 0 0 27_io/wide_stream_objects.cc
+ 10 0.104 251543 9400 1897991 ext/headers.cc
-b 8 0.104 0 0 0 ext/headers.cc
testrun == 1358 seconds