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 00:10:56 (GMT)
commitc44fa92db5cccf557d1ced431da6aa5ded58ed16 (patch)
treee284ccb6c2bb03d52c6868fe736b3581e8f749ab
parent583c32c3056bff7606570e7836d33bf8fd18d299 (diff)
downloadjemalloc-c44fa92db5cccf557d1ced431da6aa5ded58ed16.zip
jemalloc-c44fa92db5cccf557d1ced431da6aa5ded58ed16.tar.gz
jemalloc-c44fa92db5cccf557d1ced431da6aa5ded58ed16.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 d509d55..eb77d9f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -51,6 +51,7 @@ enable_code_coverage := @enable_code_coverage@
enable_prof := @enable_prof@
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@
@@ -119,7 +120,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)
@@ -135,7 +136,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 9ece786..f27c61f 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