summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-10-28 00:10:56 (GMT)
committerJason Evans <jasone@canonware.com>2016-10-28 07:47:53 (GMT)
commit875ff15e6a99f4ff4d8aaaaf76d9dc5f3d8f1e39 (patch)
treec0af643fd76119edfdaf0505ddf2e689ad2a1f06
parent1eb801bcad74f4b7eb4d5ab3ce2d67935c10ac58 (diff)
downloadjemalloc-875ff15e6a99f4ff4d8aaaaf76d9dc5f3d8f1e39.zip
jemalloc-875ff15e6a99f4ff4d8aaaaf76d9dc5f3d8f1e39.tar.gz
jemalloc-875ff15e6a99f4ff4d8aaaaf76d9dc5f3d8f1e39.tar.bz2
Only use --whole-archive with gcc.
Conditionalize use of --whole-archive on the platform plus compiler, rather than on the ABI. This fixes a regression caused by 7b24c6e5570062495243f1e55131b395adb31e33 (Use --whole-archive when linking integration tests on MinGW.).
-rw-r--r--Makefile.in5
-rw-r--r--configure.ac3
-rw-r--r--msvc/ReadMe.txt2
3 files changed, 7 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index de28218..11e94b7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,6 +52,7 @@ enable_prof := @enable_prof@
enable_valgrind := @enable_valgrind@
enable_zone_allocator := @enable_zone_allocator@
MALLOC_CONF := @JEMALLOC_CPREFIX@MALLOC_CONF
+link_whole_archive := @link_whole_archive@
DSO_LDFLAGS = @DSO_LDFLAGS@
SOREV = @SOREV@
PIC_CFLAGS = @PIC_CFLAGS@
@@ -125,7 +126,7 @@ DSOS := $(objroot)lib/$(LIBJEMALLOC).$(SOREV)
ifneq ($(SOREV),$(SO))
DSOS += $(objroot)lib/$(LIBJEMALLOC).$(SO)
endif
-ifeq (pecoff, $(ABI))
+ifeq (1, $(link_whole_archive))
LJEMALLOC := -Wl,--whole-archive -L$(objroot)lib -l$(LIBJEMALLOC) -Wl,--no-whole-archive
else
LJEMALLOC := $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
@@ -141,7 +142,7 @@ C_TESTLIB_SRCS := $(srcroot)test/src/btalloc.c $(srcroot)test/src/btalloc_0.c \
$(srcroot)test/src/mtx.c $(srcroot)test/src/mq.c \
$(srcroot)test/src/SFMT.c $(srcroot)test/src/test.c \
$(srcroot)test/src/thd.c $(srcroot)test/src/timer.c
-ifeq (pecoff, $(ABI))
+ifeq (1, $(link_whole_archive))
C_UTIL_INTEGRATION_SRCS :=
else
C_UTIL_INTEGRATION_SRCS := $(srcroot)src/nstime.c $(srcroot)src/util.c
diff --git a/configure.ac b/configure.ac
index d5ffd4c..c45d821 100644
--- a/configure.ac
+++ b/configure.ac
@@ -313,6 +313,7 @@ o="$ac_objext"
a="a"
exe="$ac_exeext"
libprefix="lib"
+link_whole_archive="0"
DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
RPATH='-Wl,-rpath,$(1)'
SOREV="${so}.${rev}"
@@ -442,6 +443,7 @@ case "${host}" in
else
importlib="${so}"
DSO_LDFLAGS="-shared"
+ link_whole_archive="1"
fi
a="lib"
libprefix=""
@@ -479,6 +481,7 @@ AC_SUBST([o])
AC_SUBST([a])
AC_SUBST([exe])
AC_SUBST([libprefix])
+AC_SUBST([link_whole_archive])
AC_SUBST([DSO_LDFLAGS])
AC_SUBST([EXTRA_LDFLAGS])
AC_SUBST([SOREV])
diff --git a/msvc/ReadMe.txt b/msvc/ReadMe.txt
index b1c2fc5..77d567d 100644
--- a/msvc/ReadMe.txt
+++ b/msvc/ReadMe.txt
@@ -17,7 +17,7 @@ How to build jemalloc for Windows
(note: x86/x64 doesn't matter at this point)
5. Generate header files:
- sh -c "./autogen.sh" CC=cl --enable-lazy-lock=no
+ sh -c "CC=cl ./autogen.sh"
6. Now the project can be opened and built in Visual Studio:
msvc\jemalloc_vc2015.sln