[ 
https://issues.apache.org/jira/browse/XERCESC-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14746286#comment-14746286
 ] 

Keith Marshall commented on XERCESC-2048:
-----------------------------------------

Hmm. Some further investigation identifies this as a libtool issue, and that 
the intent of "LDFLAGS=\-no-undefined" is to pass this flag to "libtool 
\-\-link ...", rather than to the linker directly, (as the use of LDFLAGS seems 
to imply). In config/ltmain.sh, I see:

{code}
    case $host in
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
      # It is impossible to link a dll without this setting, and
      # we shouldn't force the makefile maintainer to figure out
      # what system we are compiling for in order to pass an extra
      # flag for every libtool invocation.
      # allow_undefined=no

      # FIXME: Unfortunately, there are problems with the above when trying
      # to make a dll that has undefined symbols, in which case not
      # even a static library is built.  For now, we need to specify
      # -no-undefined on the libtool link line when we can be certain
      # that all symbols are satisfied, otherwise we get a static library.
      allow_undefined=yes
      ;;
{code}

so, it is clear that libtool does know how to DTRT, wrt the windows targets, 
but the "FIXME" suggests that there is some bug which breaks creation of static 
libraries, if it does this unconditionally, and the objects for the 
corresponding DLL build are incompletely specified.  I neither know nor 
understand what that bug might be; nor do I understand how instructing users to 
always force the "\-no-undefined" flag would have any different effect.  
However, I can confirm that, for the case of Xerces-C++ 3.1.2, reverting the 
effect of that "FIXME":

{code}
    case $host in
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
      # It is impossible to link a dll without this setting, and
      # we shouldn't force the makefile maintainer to figure out
      # what system we are compiling for in order to pass an extra
      # flag for every libtool invocation.
      allow_undefined=no
      ;;
{code}

allows Xerces-C++ to build completely successfully for the mingw32 target, 
creating both static and shared (DLL+import) libraries, without any need for 
the "LDFLAGS=\-no-undefined" nonsense.

> Error during build on Windows/MinGW because of LDFLAGS=-no-undefined 
> ---------------------------------------------------------------------
>
>                 Key: XERCESC-2048
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2048
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.1.2
>         Environment: Windows 8.1 with MinGW
>            Reporter: Philip Young
>            Priority: Blocker
>
> Followed the build instructions and used ./configure LDFLAGS=-no-undefined
> config.log shows the following:
> Target: mingw32
> Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 
> --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld 
> --enable-lto --enable-libssp --disable-multilib 
> --enable-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions 
> --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug 
> --enable-version-specific-runtime-libs 
> --with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld 
> --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= 
> --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp 
> --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw 
> --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
> Thread model: win32
> gcc version 4.8.1 (GCC) 
> configure:3781: $? = 0
> configure:3770: g++ -V >&5
> g++.exe: error: unrecognized command line option '-V'
> g++.exe: fatal error: no input files
> compilation terminated.
> configure:3781: $? = 1
> configure:3770: g++ -qversion >&5
> g++.exe: error: unrecognized command line option '-qversion'
> g++.exe: fatal error: no input files
> compilation terminated.
> configure:3781: $? = 1
> configure:3801: checking whether the C++ compiler works
> configure:3823: g++   -no-undefined conftest.cpp  >&5
> g++.exe: error: unrecognized command line option '-no-undefined'
> configure:3827: $? = 1
> configure:3865: result: no
> configure: failed program was:
> | /* confdefs.h */



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to