delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/12/12:54:13

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49B94E5B.20301@gmail.com>
Date: Thu, 12 Mar 2009 18:03:07 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated: experimental package: gcc4-4.3.2-2
References: <49B90A2B DOT 3050907 AT alice DOT it> <49B92D24 DOT 3000802 AT gmail DOT com> <49B93C71 DOT 50809 AT gmail DOT com>
In-Reply-To: <49B93C71.50809@gmail.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------090502050608060205000606
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

[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



--------------090502050608060205000606
Content-Type: text/plain;
 name="root-cygwin-D_DLL_patch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="root-cygwin-D_DLL_patch.diff"

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


--------------090502050608060205000606
Content-Type: text/plain; charset=us-ascii

--
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/
--------------090502050608060205000606--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019