[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange issues with -all-static link flag under MinGW
From: |
Werner LEMBERG |
Subject: |
Re: strange issues with -all-static link flag under MinGW |
Date: |
Wed, 26 Mar 2014 10:20:03 +0100 (CET) |
Ping! I've updated to current git of libtool
(v2.4.2.444-28-g053df7e), and the problem persists.
I'll also contact the MinGW list.
BTW, does it make sense to send my original e-mail to bug-libtool?
Werner
======================================================================
> [libtool 2.4.2]
>
> Folks,
>
>
> I have two programs, which I try to link with
>
> make LDFLAGS=-all-static
>
> to build stand-alone Windows binaries. One program has a command line
> interface, and everything is just fine. The other one has a Qt GUI,
> and suddenly there is a mysterious problem: The program uses DLLs
> instead of the static libraries.
>
> Note that all of the affected libraries (HarfBuzz, FreeType, and
> libpng) use libtool, and both static and dynamic libraries have been
> built and installed. The other libraries mentioned are coming with
> MinGW. Attached you can find the three .la files.
>
> Here the libtool commands for the CLI program:
>
> /bin/sh ../libtool \
> --tag=CXX \
> --mode=link g++ \
> -g -O2 -all-static \
> -o ttfautohint.exe \
> info.o main.o \
> ../lib/libttfautohint.la \
> ../gnulib/src/libgnu.la \
> /usr/local/lib/libfreetype.la
>
> This gets translated to
>
> libtool: link: g++ \
> -g -O2 -static \
> -o ttfautohint.exe \
> info.o main.o \
> ../lib/.libs/libttfautohint.a \
> -L/usr/local/lib \
> -LD:/Werner/MinGW.new/msys/1.0/local/lib \
> /usr/local/lib/libharfbuzz.a \
> ../gnulib/src/.libs/libgnu.a \
> /usr/local/lib/libfreetype.a \
> -lbz2 \
> /usr/local/lib/libpng16.a \
> -lz
>
> Here the same for the GUI program. The large bunch of additional
> flags are extracted automatically from Qt's build mechanism using the
> `autotroll' m4 package, cf. http://repo.or.cz/w/autotroll.git. Qt has
> been configured as a static build. Since I don't know the cause, I
> don't shorten the libtool arguments here, showing the complete call.
>
> /bin/sh ../libtool \
> --tag=CXX \
> --mode=link g++ \
> -pipe -Os \
> -momit-leaf-frame-pointer -fno-exceptions \
> -Wall -Wextra -fno-rtti \
> -DUNICODE -DQT_STATIC_BUILD -DQT_NO_DEBUG \
> -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX \
> -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT \
> -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT \
> -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST \
> -g -O2 -static -static-libgcc \
> -Wl,-s -Wl,-subsystem,windows -all-static \
> -o ttfautohintGUI.exe \
> ttfautohintGUI-ddlineedit.o ttfautohintGUI-info.o \
> ttfautohintGUI-main.o ttfautohintGUI-maingui.o \
> ttfautohintGUI-ttlineedit.o ttfautohintGUI-ddlineedit.moc.o \
> ttfautohintGUI-maingui.moc.o ttfautohintGUI-ttlineedit.moc.o \
> ../lib/libttfautohint.la \
> ../gnulib/src/libgnu.la \
> /usr/local/lib/libfreetype.la \
> -L'd:/Werner/qt-4.8.5/lib' \
> -lmingw32 -lqtmain -lQtGui -lgdi32 -lcomdlg32 \
> -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 \
> -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 \
> -lshell32 -luser32 -lkernel32
>
> And here the translation.
>
> libtool: link: g++ \
> -pipe -Os \
> -momit-leaf-frame-pointer -fno-exceptions \
> -Wall -Wextra -fno-rtti \
> -DUNICODE -DQT_STATIC_BUILD -DQT_NO_DEBUG \
> -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX \
> -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT \
> -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT \
> -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST \
> -g -O2 -static-libgcc \
> -Wl,-s -Wl,-subsystem -Wl,windows -static \
> -o ttfautohintGUI.exe \
> ttfautohintGUI-ddlineedit.o ttfautohintGUI-info.o \
> ttfautohintGUI-main.o ttfautohintGUI-maingui.o \
> ttfautohintGUI-ttlineedit.o ttfautohintGUI-ddlineedit.moc.o \
> ttfautohintGUI-maingui.moc.o ttfautohintGUI-ttlineedit.moc.o \
> ../lib/.libs/libttfautohint.a \
> -L/usr/local/lib \
> -LD:/Werner/MinGW.new/msys/1.0/local/lib \
> /usr/local/lib/libharfbuzz.dll.a \
> ../gnulib/src/.libs/libgnu.a \
> /usr/local/lib/libfreetype.dll.a \
> -lbz2 \
> /usr/local/lib/libpng16.dll.a \
> -lz \
> -Ld:/Werner/qt-4.8.5/lib \
> -lmingw32 -lqtmain -lQtGui -lgdi32 -lcomdlg32 \
> -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 \
> -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 \
> -lshell32 -luser32 -lkernel32 \
> -L/usr/local/lib -L/usr/local/lib
>
> Why does libtool decide to use the `.dll.a' stuff in the second call?
>
>
> Werner
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: strange issues with -all-static link flag under MinGW,
Werner LEMBERG <=