Skip to content

Commit 217d1b1

Browse files
committed
Only export pkg's bundled symbols
1 parent f55f973 commit 217d1b1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Makefile.autosetup

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,15 @@ LOCAL_CFLAGS= -I$(top_srcdir)/external/uthash \
4343
-I$(top_builddir)/libpkg \
4444
-DGITHASH=\"@GITHASH@\" \
4545
-DHAVE_CONFIG_H
46-
LIBS= \
47-
-L$(top_builddir)/libpkg -lpkg_flat \
48-
-lm \
49-
@EXTRA_LIBS@
46+
LIBPKGFLAT= -L$(top_builddir)/libpkg -lpkg_flat
47+
LIBS= @EXTRA_LIBS@
5048

5149
@if HAVE_PKG_LIBARCHIVE
5250
LIBS+= @PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS_STATIC@
5351
@else
5452
LIBS+= -larchive -lbz2 -lz -llzma
5553
@endif
56-
OTHER_LIBS= -lssl -lcrypto -pthread
54+
OTHER_LIBS= -lm -lssl -lcrypto -pthread
5755
@if HAVE_LIBUTIL
5856
OTHER_LIBS+= -lutil
5957
@endif
@@ -65,16 +63,17 @@ OTHER_LIBS+= -lresolv
6563
@endif
6664

6765
@if libabidir == libmachista
68-
LOCAL_LDFLAGS= $(LIBS) $(OTHER_LIBS)
66+
LOCAL_LDFLAGS= $(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS)
6967
@else
7068
LOCAL_LDFLAGS= -Wl,-Bstatic \
71-
-Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive \
69+
-Wl,--whole-archive $(LIBPKGFLAT) -Wl,--no-whole-archive \
70+
$(LIBS) \
7271
-Wl,-Bdynamic $(OTHER_LIBS) \
7372
-Wl,--export-dynamic \
7473
-Wl,--version-script=$(top_builddir)/libpkg/libpkg.ver
7574
@endif
7675

77-
STATIC_LDFLAGS= $(LIBS) $(OTHER_LIBS)
76+
STATIC_LDFLAGS= $(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS)
7877

7978
include $(MK)/prog.mk
8079

0 commit comments

Comments
 (0)