OSDN Git Service

Support all-static linking with recent GCC versions.
authorKeith Marshall <keith@users.osdn.me>
Fri, 19 Jun 2020 11:00:44 +0000 (12:00 +0100)
committerKeith Marshall <keith@users.osdn.me>
Fri, 19 Jun 2020 11:00:44 +0000 (12:00 +0100)
ChangeLog
Makefile.in

index 3ca25b0..1e62af5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-06-19  Keith Marshall  <keith@users.osdn.me>
+
+       Support all-static linking with recent GCC versions.
+
+       * Makefile.in (LDFLAGS): Add "-static" unconditionally.
+       (LIBS, SETUP_TOOL_LIBS): Remove all "-Wl,-Bstatic" and "-Wl,-Bdynamic"
+       references; the latter, in particular, appears to induce dynamic
+       linking of libstdc++-6.dll, overriding "--static-libstdc++".
+
 2020-06-12  Keith Marshall  <keith@users.osdn.me>
 
        Use XML templates to adapt to download host changes.
index 9b86207..bf67c98 100644 (file)
@@ -154,9 +154,9 @@ RC_INCLUDES = -I . -I ${srcdir}/src -I ${srcdir}/icons
 OBJEXT = @OBJEXT@
 EXEEXT = @EXEEXT@
 
-LDFLAGS = @LDFLAGS@
+LDFLAGS = -static @LDFLAGS@
 GUI_LDFLAGS = -mwindows $(LDFLAGS)
-LIBS = -Wl,-Bstatic -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
+LIBS = -llua -lz -lbz2 -llzma -lwininet
 
 # Define the content of package deliverables.
 #
@@ -184,7 +184,7 @@ GUIMAIN_LIB_OBJECTS = \
 GUIMAIN_LIBS = -lwtklite -lcomctl32
 
 SETUP_TOOL_OBJECTS = setup.$(OBJEXT) setup.res.$(OBJEXT) apihook.$(OBJEXT)
-SETUP_TOOL_LIBS = -lwtklite -lwininet -lcomctl32 -lole32 -Wl,-Bstatic -llzma
+SETUP_TOOL_LIBS = -lwtklite -lwininet -lcomctl32 -lole32 -llzma
 
 SETUP_DLL_OBJECTS =  \
    dllhook.$(OBJEXT) $(GUIMAIN_LIB_OBJECTS) guimain.res.$(OBJEXT)