This is the mail archive of the gcc@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]

Porting libstdc++-v3 to cygwin


I have started to port libstdc++-v3 to cygwin.  I am not sure how far I will
get, so here is a short status report.  There are a number of hacks in
search of better solutions.  Suggestions welcome.



I have started with the config/os/newlib configuration files, and modified
config.target to use them.

===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.target,v
retrieving revision 1.2
diff -u -r1.2 configure.target
--- configure.target    2000/11/17 20:35:06     1.2
+++ configure.target    2000/11/23 05:01:53
@@ -84,6 +84,9 @@
   bsd* | freebsd*)
     os_include_dir="config/os/bsd"
     ;;
+  cygwin*)
+    os_include_dir="config/os/newlib"
+    ;;
   linux*)
     os_include_dir="config/os/gnu-linux"
     ;;



Next, a configure test for <ctest> succeded for newlib and which resulted in
the problem  

linking /usr/local/src/gcc/libstdc++-v3/config/newlib/bits/ctype_base.h to
include/bits/ctype_base.h
configure: error:
/usr/local/src/gcc/libstdc++-v3/config/newlib/bits/ctype_base.h: File not
found

Worked around this by
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure,v
retrieving revision 1.104
diff -u -r1.104 configure
--- configure   2000/11/21 20:53:35     1.104
+++ configure   2000/11/23 05:09:54
@@ -18064,7 +18064,7 @@
 rm -f conftest*
     echo "$ac_t""$ctype_newlib" 1>&6
     if test $ctype_newlib = "yes"; then
-      ctype_include_dir="config/newlib"
+      ctype_include_dir="config/os/newlib"
       ctype_default=no
     fi
     fi



With this change, the library complied.  There were many warnings od the
type

/usr/local/src/gcc/libstdc++-v3/libsupc++/new: In method `const char*
std::bad_alloc::what() const':
/usr/local/src/gcc/libstdc++-v3/libsupc++/new:43: warning: function using
setjmp cannot be inline
/usr/local/src/gcc/libstdc++-v3/libsupc++/new: In function `void* operator
new(unsigned int, void*)':
/usr/local/src/gcc/libstdc++-v3/libsupc++/new:64: warning: function using
setjmp cannot be inline
/usr/local/src/gcc/libstdc++-v3/libsupc++/new: In function `void* operator
new   [](unsigned int, void*)':
/usr/local/src/gcc/libstdc++-v3/libsupc++/new:65: warning: function using
setjmp cannot be inline




The file mkcheck required a couple of changes to run
 * put back libraries knocked out by -nodefaultlibs
 * add .exe to executable
Don't know how to solve the first problem, but the second can be fixed in
mkcheck.in

--- mkcheck.orig        Thu Nov 23 13:30:33 2000
+++ mkcheck.works       Thu Nov 23 15:17:17 2000
@@ -122,7 +122,7 @@
           $CXX $CXX_FLAG $INC_PATH   \
           $LIB_PATH/../libsupc++/libsupc++.la  $LIB_PATH/libstdc++.la   \
           -no-install"
-  LIBS="-nodefaultlibs -lc -lgcc -lc"
+  LIBS="-nodefaultlibs -lc -lgcc -lc -lcygwin -luser32 -lkernel32
-ladvapi32 -lshell32 -lgcc"
 elif [ $WHICH -eq 1 ]; then
   # For the installed version, we really only need to use libtool and
   # the .la file to get correct rpaths.
@@ -178,15 +178,16 @@
     done
 fi

+# Remove old executables.
+rm -rf "$TEST_DIR"/*exe
+
 # Nasty solution to replace GNU date(1)'s %s time_t output function.
-if [ ! -x "$TEST_DIR/printnow" ]; then
+if [ ! -x "$TEST_DIR/printnow.exe" ]; then
     echo "making utility $TEST_DIR/printnow"
-    gcc -o "$TEST_DIR/printnow" "$SRC_DIR/testsuite/printnow.c"
-    strip "$TEST_DIR/printnow"
+    gcc -o "$TEST_DIR/printnow.exe" "$SRC_DIR/testsuite/printnow.c"
+    strip "$TEST_DIR/printnow.exe"
 fi

-# Remove old executables.
-rm -rf "$TEST_DIR"/*exe

 # Remove old core files (which now get left in cwd, not $TEST_DIR).
 rm -rf ./*core*




The testsuite now runs, and some tests pass

host: CYGWIN_NT-4.0 1.1.5(0.30/3/2) 2000-11-11 01:49 i686
compiler: Reading specs from
/usr/local/obj/gcc/i686-pc-cygwin/libstdc++-v3/../../gcc/specs
Configured with: /usr/local/src/gcc/configure --with-included-gettext
--enable-languages=c++,f,objc
gcc version 2.97 20001121 (experimental)
g++: No input files
compiler flags: -ggdb3 -DDEBUG_ASSERT -ffunction-sections -fdata-sections 
date: 20001123
pass/fail results:  74/110

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	
+  8	0.000	1536	512	18956	17_intro/header_ciso646.cc
+  10	0.000	1536	512	18956	17_intro/header_ciso646.cc

+  15	0.000	1024	512	199708	17_intro/header_fstream.cc
+  16	0.000	1024	512	199708	17_intro/header_fstream.cc

+  13	0.000	1024	512	143884	17_intro/header_iomanip.cc
+  13	0.000	1024	512	143884	17_intro/header_iomanip.cc

+  12	0.000	1024	512	107532	17_intro/header_ios.cc
+  12	0.000	1024	512	107532	17_intro/header_ios.cc

+  8	0.000	1024	512	27148	17_intro/header_iosfwd.cc
+  9	0.000	1024	512	27148	17_intro/header_iosfwd.cc

-b 32	0.000	0	0	0	17_intro/header_iostream.cc
-b 19	0.000	0	0	0	17_intro/header_iostream.cc

+  12	0.000	1024	512	138764	17_intro/header_istream.cc
+  12	0.000	1024	512	138764	17_intro/header_istream.cc

+  12	0.000	1024	512	107532	17_intro/header_ostream.cc
+  13	0.000	1024	512	107532	17_intro/header_ostream.cc

+  12	0.000	1024	512	139276	17_intro/header_sstream.cc
+  12	0.000	1024	512	139276	17_intro/header_sstream.cc

+  12	0.000	1024	512	107532	17_intro/header_streambuf.cc
+  11	0.000	1024	512	107532	17_intro/header_streambuf.cc

-b 42	0.000	0	0	0	17_intro/headers.cc
-b 32	0.000	0	0	0	17_intro/headers.cc

+  9	0.000	22528	2048	171852	18_support/numeric_limits.cc
+  9	0.000	22528	2048	171852	18_support/numeric_limits.cc

-b 11	0.000	0	0	0	20_util/auto_ptr.cc
-b 11	0.000	0	0	0	20_util/auto_ptr.cc

-b 17	0.000	0	0	0	21_strings/append.cc
-b 20	0.000	0	0	0	21_strings/append.cc

+  20	0.000	82944	2048	484748	21_strings/capacity.cc
+  20	0.000	82944	2048	484748	21_strings/capacity.cc

+  14	0.000	51712	2048	299868	21_strings/char_traits.cc
+  14	0.000	51712	2048	299868	21_strings/char_traits.cc

+  14	0.000	57856	2048	311132	21_strings/compare.cc
+  13	0.000	57856	2048	311132	21_strings/compare.cc

+  18	0.000	67584	2048	379228	21_strings/ctor_copy_dtor.cc
+  16	0.000	67584	2048	379228	21_strings/ctor_copy_dtor.cc

+  14	0.000	54784	2048	304988	21_strings/element_access.cc
+  14	0.000	54784	2048	304988	21_strings/element_access.cc

-b 15	0.000	0	0	0	21_strings/find.cc
-b 15	0.000	0	0	0	21_strings/find.cc

+  16	0.000	68608	2048	380764	21_strings/insert.cc
+  18	0.000	68608	2048	380764	21_strings/insert.cc

-b 33	0.000	0	0	0	21_strings/inserters_extractors.cc
-b 32	0.000	0	0	0	21_strings/inserters_extractors.cc

+  23	0.000	65024	2048	345948	21_strings/invariants.cc
+  17	0.000	65024	2048	345948	21_strings/invariants.cc

+  21	0.000	75776	2048	361820	21_strings/nonmember.cc
+  20	0.000	75776	2048	361820	21_strings/nonmember.cc

+  15	0.000	56320	2048	307036	21_strings/operations.cc
+  13	0.000	56320	2048	307036	21_strings/operations.cc

+  16	0.000	67072	2048	397660	21_strings/replace.cc
+  18	0.000	67072	2048	397660	21_strings/replace.cc

+  13	0.000	53248	2048	302940	21_strings/rfind.cc
+  13	0.000	53248	2048	302940	21_strings/rfind.cc

+  15	0.000	58880	2048	338780	21_strings/substr.cc
+  14	0.000	58880	2048	338780	21_strings/substr.cc

-b 22	0.000	0	0	0	22_locale/codecvt_char_char.cc
-b 24	0.000	0	0	0	22_locale/codecvt_char_char.cc

+  15	0.000	1024	512	199196	22_locale/codecvt_unicode_char.cc
+  15	0.000	1024	512	199196	22_locale/codecvt_unicode_char.cc

+  18	0.000	1024	512	199196	22_locale/codecvt_unicode_wchar_t.cc
+  16	0.000	1024	512	199196	22_locale/codecvt_unicode_wchar_t.cc

-b 26	0.000	0	0	0	22_locale/codecvt_wchar_t_char.cc
-b 21	0.000	0	0	0	22_locale/codecvt_wchar_t_char.cc

+  16	0.000	1024	512	199708	22_locale/ctor_copy_dtor.cc
+  15	0.000	1024	512	199708	22_locale/ctor_copy_dtor.cc

-b 23	0.000	0	0	0	22_locale/ctype.cc
-b 29	0.000	0	0	0	22_locale/ctype.cc

-b 24	0.000	0	0	0	22_locale/ctype_char_members.cc
-b 21	0.000	0	0	0	22_locale/ctype_char_members.cc

+  15	0.000	1024	512	199196	22_locale/ctype_wchar_t_members.cc
+  15	0.000	1024	512	199196	22_locale/ctype_wchar_t_members.cc

-b 31	0.000	0	0	0	22_locale/facet.cc
-b 33	0.000	0	0	0	22_locale/facet.cc

-b 23	0.000	0	0	0	22_locale/global_templates.cc
-b 23	0.000	0	0	0	22_locale/global_templates.cc

-b 22	0.000	0	0	0	22_locale/operators.cc
-b 23	0.000	0	0	0	22_locale/operators.cc

-b 22	0.000	0	0	0	22_locale/static_members.cc
-b 22	0.000	0	0	0	22_locale/static_members.cc

-b 22	0.000	0	0	0	23_containers/bitset_ctor.cc
-b 21	0.000	0	0	0	23_containers/bitset_ctor.cc

-b 25	0.000	0	0	0	23_containers/bitset_shift.cc
-b 27	0.000	0	0	0	23_containers/bitset_shift.cc

-b 17	0.000	0	0	0	23_containers/map_operators.cc
-b 17	0.000	0	0	0	23_containers/map_operators.cc

-b 22	0.000	0	0	0	23_containers/multiset.cc
-b 22	0.000	0	0	0	23_containers/multiset.cc

-b 14	0.000	0	0	0	23_containers/set_operators.cc
-b 14	0.000	0	0	0	23_containers/set_operators.cc

+  13	0.000	31744	2048	277836	23_containers/vector_capacity.cc
+  13	0.000	31744	2048	277836	23_containers/vector_capacity.cc

-b 38	0.000	0	0	0	23_containers/vector_ctor.cc
-b 26	0.000	0	0	0	23_containers/vector_ctor.cc

-b 18	0.000	0	0	0
23_containers/vector_element_access.cc
-b 25	0.000	0	0	0
23_containers/vector_element_access.cc

+  15	0.000	40448	2048	394572	23_containers/vector_modifiers.cc
+  15	0.000	40448	2048	394572	23_containers/vector_modifiers.cc

-b 21	0.000	0	0	0	24_iterators/istreambuf_iterator.cc
-b 30	0.000	0	0	0	24_iterators/istreambuf_iterator.cc

+  21	0.000	83968	2048	522076	24_iterators/iterator.cc
+  21	0.000	83968	2048	522076	24_iterators/iterator.cc

+  11	0.000	2560	512	95244	25_algorithms/lower_bound.cc
+  11	0.000	2560	512	95244	25_algorithms/lower_bound.cc

+  10	0.000	1536	512	67596	25_algorithms/min_max.cc
+  10	0.000	1536	512	67596	25_algorithms/min_max.cc

-b 22	0.000	0	0	0	26_numerics/binary_closure.cc
-b 24	0.000	0	0	0	26_numerics/binary_closure.cc

+  9	0.000	1024	512	35340	26_numerics/buggy_complex.cc
+  10	0.000	1024	512	35340	26_numerics/buggy_complex.cc

+  9	0.000	1536	512	30732	26_numerics/c_math.cc
+  8	0.000	1536	512	30732	26_numerics/c_math.cc

-b 34	0.000	0	0	0
26_numerics/complex_inserters_extractors.cc
-b 25	0.000	0	0	0
26_numerics/complex_inserters_extractors.cc

-r 10	0.000	2560	512	37900	26_numerics/complex_value.cc
-r 9	0.000	2560	512	37900	26_numerics/complex_value.cc

+  14	0.000	23040	2048	276816	26_numerics/valarray.cc
+  14	0.000	23040	2048	276816	26_numerics/valarray.cc

-b 26	0.000	0	0	0	27_io/filebuf.cc
-b 23	0.000	0	0	0	27_io/filebuf.cc

-b 23	0.000	0	0	0	27_io/filebuf_members.cc
-b 23	0.000	0	0	0	27_io/filebuf_members.cc

+  12	0.000	3072	512	112652	27_io/fpos.cc
+  12	0.000	3072	512	112652	27_io/fpos.cc

-b 24	0.000	0	0	0	27_io/ifstream_members.cc
-b 24	0.000	0	0	0	27_io/ifstream_members.cc

-b 34	0.000	0	0	0	27_io/ios_base_callbacks.cc
-b 29	0.000	0	0	0	27_io/ios_base_callbacks.cc

-b 20	0.000	0	0	0	27_io/ios_base_members_static.cc
-b 22	0.000	0	0	0	27_io/ios_base_members_static.cc

-b 20	0.000	0	0	0	27_io/ios_ctor.cc
-b 21	0.000	0	0	0	27_io/ios_ctor.cc

-b 25	0.000	0	0	0	27_io/ios_manip_basefield.cc
-b 25	0.000	0	0	0	27_io/ios_manip_basefield.cc

-b 26	0.000	0	0	0	27_io/ios_manip_fmtflags.cc
-b 28	0.000	0	0	0	27_io/ios_manip_fmtflags.cc

-b 27	0.000	0	0	0	27_io/ios_members.cc
-b 41	0.000	0	0	0	27_io/ios_members.cc

+  12	0.000	1024	512	138764	27_io/istream.cc
+  12	0.000	1024	512	138764	27_io/istream.cc

-b 32	0.000	0	0	0	27_io/istream_extractor_arith.cc
-b 28	0.000	0	0	0	27_io/istream_extractor_arith.cc

-b 22	0.000	0	0	0	27_io/istream_extractor_char.cc
-b 30	0.000	0	0	0	27_io/istream_extractor_char.cc

-b 27	0.000	0	0	0	27_io/istream_extractor_other.cc
-b 25	0.000	0	0	0	27_io/istream_extractor_other.cc

-b 25	0.000	0	0	0	27_io/istream_manip.cc
-b 26	0.000	0	0	0	27_io/istream_manip.cc

-b 29	0.000	0	0	0	27_io/istream_seeks.cc
-b 42	0.000	0	0	0	27_io/istream_seeks.cc

-b 28	0.000	0	0	0	27_io/istream_sentry.cc
-b 46	0.000	0	0	0	27_io/istream_sentry.cc

-b 39	0.000	0	0	0	27_io/istream_unformatted.cc
-b 53	0.000	0	0	0	27_io/istream_unformatted.cc

-b 37	0.000	0	0	0	27_io/istringstream_members.cc
-b 32	0.000	0	0	0	27_io/istringstream_members.cc

-b 33	0.000	0	0	0	27_io/narrow_stream_objects.cc
-b 36	0.000	0	0	0	27_io/narrow_stream_objects.cc

-b 25	0.000	0	0	0	27_io/ofstream_members.cc
-b 30	0.000	0	0	0	27_io/ofstream_members.cc

+  12	0.000	1024	512	107532	27_io/ostream.cc
+  11	0.000	1024	512	107532	27_io/ostream.cc

-b 31	0.000	0	0	0	27_io/ostream_inserter_arith.cc
-b 34	0.000	0	0	0	27_io/ostream_inserter_arith.cc

-b 32	0.000	0	0	0	27_io/ostream_inserter_char.cc
-b 34	0.000	0	0	0	27_io/ostream_inserter_char.cc

-b 29	0.000	0	0	0	27_io/ostream_inserter_other.cc
-b 25	0.000	0	0	0	27_io/ostream_inserter_other.cc

-b 22	0.000	0	0	0	27_io/ostream_manip.cc
-b 40	0.000	0	0	0	27_io/ostream_manip.cc

-b 28	0.000	0	0	0	27_io/ostream_seeks.cc
-b 26	0.000	0	0	0	27_io/ostream_seeks.cc

-b 24	0.000	0	0	0	27_io/ostream_unformatted.cc
-b 21	0.000	0	0	0	27_io/ostream_unformatted.cc

-b 24	0.000	0	0	0	27_io/streambuf.cc
-b 22	0.000	0	0	0	27_io/streambuf.cc

-b 39	0.000	0	0	0	27_io/stringbuf.cc
-b 44	0.000	0	0	0	27_io/stringbuf.cc

-b 29	0.000	0	0	0	27_io/stringstream.cc
-b 26	0.000	0	0	0	27_io/stringstream.cc

-b 28	0.000	0	0	0	27_io/wide_stream_objects.cc
-b 27	0.000	0	0	0	27_io/wide_stream_objects.cc

-b 22	0.000	0	0	0	ext/headers.cc
-b 24	0.000	0	0	0	ext/headers.cc

testrun == 4109 seconds


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