summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-11-21 17:38:38 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2021-11-21 19:28:46 +0000
commitfc0758237548328941fa7a9699510d6f357896ed (patch)
tree219948ee477a74f694468f9af9bc127d2471c152 /Makefile.am
parent3beea10fceea4d58958aaafcdbcf1264b667613f (diff)
downloadlibarchive-fc0758237548328941fa7a9699510d6f357896ed.tar.gz
autotools: enable -fdata/function-sections and --gc-sections
Analogue to the parent cmake commit, with linker flag detection. The former two split the functions and data into separate sections within the object file. Which makes it easier for the latter to properly garbage collect and discard unused sections. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am8
1 files changed, 4 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index e43531c1..8ba152bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -284,7 +284,7 @@ endif
# -no-undefined marks that libarchive doesn't rely on symbols
# defined in the application. This is mandatory for cygwin.
-libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
+libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) $(GC_SECTIONS)
libarchive_la_LIBADD= $(LTLIBICONV)
# Manpages to install
@@ -1023,7 +1023,7 @@ endif
bsdtar_LDADD= libarchive.la libarchive_fe.la $(LTLIBICONV)
bsdtar_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS)
-bsdtar_LDFLAGS= $(bsdtar_ldstatic)
+bsdtar_LDFLAGS= $(bsdtar_ldstatic) $(GC_SECTIONS)
bsdtar_EXTRA_DIST= \
tar/bsdtar.1 \
@@ -1189,7 +1189,7 @@ endif
bsdcpio_LDADD= libarchive_fe.la libarchive.la $(LTLIBICONV)
bsdcpio_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcpio_ccstatic) $(PLATFORMCPPFLAGS)
-bsdcpio_LDFLAGS= $(bsdcpio_ldstatic)
+bsdcpio_LDFLAGS= $(bsdcpio_ldstatic) $(GC_SECTIONS)
bsdcpio_EXTRA_DIST= \
cpio/bsdcpio.1 \
@@ -1343,7 +1343,7 @@ endif
bsdcat_LDADD= libarchive_fe.la libarchive.la $(LTLIBICONV)
bsdcat_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcat_ccstatic) $(PLATFORMCPPFLAGS)
-bsdcat_LDFLAGS= $(bsdcat_ldstatic)
+bsdcat_LDFLAGS= $(bsdcat_ldstatic) $(GC_SECTIONS)
bsdcat_EXTRA_DIST= \
cat/bsdcat.1 \