[Bcc's sent to interested third parties] Dave Korn wrote:
> And the immediate reason for this is the way that TSystem.o is built: > > ------------------------build.log------------------------ > g++-4 -O2 -pipe -Wall -Woverloaded-virtual -D_DLL -Iinclude > -I/usr/X11R6/include -o core/base/src/TSystem.o -c > core/base/src/TSystem.cxx > ------------------------build.log------------------------ > > Why is a -D for _DLL present? That is a reserved definition in the > implementation's namespace, and in particular it used when compiling > libstdc++ itself, where it alters the effect of the library headers to > declare all the library APIs as dllexport - they are dllimport by default, > which is what user applications want to see. > > I manually re-ran the compile command without "-D_DLL" and got a good > object file: > So I'll now try rebuilding and retesting without _DLL defined anywhere and > see if it solves the problem. Indeed it did. With the attached patch, build and test both ran to completion without any errors. As far as I can see (thanks, Peter R.) the _DLL definition conveys information from compiler to linker to tell it which multilib variant to link against. We have the -shared-libgcc/-static-libgcc option in the gcc driver and the related specs to serve the same purpose on GNU. One disclaimer: this could have side-effects on MinGW, and should be verified there to make sure, if it's a supported platform. (Hopefully it'll be equally correct there, though). cheers, DaveK
diff -pru -x '*.o' -x '*.log' 1st.root/config/Makefile.win32gcc root/config/Makefile.win32gcc --- 1st.root/config/Makefile.win32gcc 2009-02-26 14:07:32.000000000 +0000 +++ root/config/Makefile.win32gcc 2009-03-12 16:51:25.656250000 +0000 @@ -17,14 +17,14 @@ endif # Compiler: CXX = g++ CC = gcc -CXXFLAGS = -pipe -Wall -Woverloaded-virtual -D_DLL $(EXTRA_CXXFLAGS) \ +CXXFLAGS = -pipe -Wall -Woverloaded-virtual $(EXTRA_CXXFLAGS) \ -I/usr/X11R6/include -CFLAGS = -pipe -Wall -D_DLL $(EXTRA_CFLAGS) -I/usr/X11R6/include -CINTCXXFLAGS = -pipe -Wall -Woverloaded-virtual -D_DLL $(EXTRA_CXXFLAGS) \ +CFLAGS = -pipe -Wall $(EXTRA_CFLAGS) -I/usr/X11R6/include +CINTCXXFLAGS = -pipe -Wall -Woverloaded-virtual $(EXTRA_CXXFLAGS) \ -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \ -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__CYGWIN \ -DG__NEWSTDHEADER -CINTCFLAGS = -pipe -Wall -D_DLL $(EXTRA_CFLAGS) \ +CINTCFLAGS = -pipe -Wall $(EXTRA_CFLAGS) \ -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \ -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__CYGWIN \ -DG__NEWSTDHEADER diff -pru -x '*.o' -x '*.log' 1st.root/test/Makefile.arch root/test/Makefile.arch --- 1st.root/test/Makefile.arch 2009-02-26 14:07:26.000000000 +0000 +++ root/test/Makefile.arch 2009-03-12 16:51:16.593750000 +0000 @@ -542,7 +542,7 @@ LD = g++ LDFLAGS = $(OPT) -Wl,--enable-auto-import \ -Wl,--enable-runtime-pseudo-reloc \ -L/usr/X11R6/lib -SOFLAGS = -shared -D_DLL -Wl,--enable-auto-image-base \ +SOFLAGS = -shared -Wl,--enable-auto-image-base \ -Wl,--export-all-symbols EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS) endif
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/