Skip to content

Commit b12cf8e

Browse files
committed
Allow building statically linked binaries, through LDFLAGS="-static".
Apply patch from <https://lists.gnu.org/archive/html/bug-libtool/2017-07/msg00000.html>. * build-aux/ltmain.sh (func_mode_help, func_mode_link): In the link mode, accept option '-static-uninstalled-libs' in place of '-static', and make '-static' an equivalent of '-all-static'.
1 parent 11228e8 commit b12cf8e

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-07-15 Bruno Haible <bruno@clisp.org>
2+
3+
Allow building statically linked binaries, through LDFLAGS="-static".
4+
Apply patch from
5+
<https://lists.gnu.org/archive/html/bug-libtool/2017-07/msg00000.html>.
6+
* build-aux/ltmain.sh (func_mode_help, func_mode_link): In the link
7+
mode, accept option '-static-uninstalled-libs' in place of '-static',
8+
and make '-static' an equivalent of '-all-static'.
9+
110
2017-07-15 Bruno Haible <bruno@clisp.org>
211

312
Don't attempt to build preloadable_libiconv.so when linking statically.

build-aux/ltmain.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3720,6 +3720,7 @@ a program from several object files.
37203720
The following components of LINK-COMMAND are treated specially:
37213721
37223722
-all-static do not do any dynamic linking at all
3723+
-static do not do any dynamic linking at all
37233724
-avoid-version do not add a version suffix if possible
37243725
-bindir BINDIR specify path to binaries directory (for systems where
37253726
libraries must be found in the PATH setting at runtime)
@@ -3746,7 +3747,8 @@ The following components of LINK-COMMAND are treated specially:
37463747
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
37473748
-shared only do dynamic linking of libtool libraries
37483749
-shrext SUFFIX override the standard shared library file extension
3749-
-static do not do any dynamic linking of uninstalled libtool libraries
3750+
-static-uninstalled-libs
3751+
do not do any dynamic linking of uninstalled libtool libraries
37503752
-static-libtool-libs
37513753
do not do any dynamic linking of libtool libraries
37523754
-version-info CURRENT[:REVISION[:AGE]]
@@ -6573,9 +6575,9 @@ func_mode_link ()
65736575
build_old_libs=no
65746576
break
65756577
;;
6576-
-all-static | -static | -static-libtool-libs)
6578+
-all-static | -static | -static-uninstalled-libs | -static-libtool-libs)
65776579
case $arg in
6578-
-all-static)
6580+
-all-static | -static)
65796581
if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
65806582
func_warning "complete static linking is impossible in this configuration"
65816583
fi
@@ -6584,7 +6586,7 @@ func_mode_link ()
65846586
fi
65856587
prefer_static_libs=yes
65866588
;;
6587-
-static)
6589+
-static-uninstalled-libs)
65886590
if test -z "$pic_flag" && test -n "$link_static_flag"; then
65896591
dlopen_self=$dlopen_self_static
65906592
fi
@@ -6883,7 +6885,7 @@ func_mode_link ()
68836885
prevarg=$arg
68846886

68856887
case $arg in
6886-
-all-static)
6888+
-all-static | -static)
68876889
if test -n "$link_static_flag"; then
68886890
# See comment for -static flag below, for more details.
68896891
func_append compile_command " $link_static_flag"
@@ -7174,9 +7176,9 @@ func_mode_link ()
71747176
continue
71757177
;;
71767178

7177-
-static | -static-libtool-libs)
7178-
# The effects of -static are defined in a previous loop.
7179-
# We used to do the same as -all-static on platforms that
7179+
-static-uninstalled-libs | -static-libtool-libs)
7180+
# The effects of -static-uninstalled-libs are defined in a previous
7181+
# loop. We used to do the same as -all-static on platforms that
71807182
# didn't have a PIC flag, but the assumption that the effects
71817183
# would be equivalent was wrong. It would break on at least
71827184
# Digital Unix and AIX.

0 commit comments

Comments
 (0)