Skip to content

Commit 59f1166

Browse files
paulbissHhvm Bot
authored and
Hhvm Bot
committed
Add --no-as-needed linker flag for jemalloc
Summary:For reasons that remain unclear the ubuntu 14.04 and 15.10 builders have been stripping the jemalloc dependency from their hhvm binaries at link time. The resulting binaries will always segfault on start unless LD_PRELOAD includes jemalloc. This flag prevents the linker from performing this strip. Reviewed By: jasone, Orvid Differential Revision: D3083799 fb-gh-sync-id: 9122e0f04753d1683373e31ba009ca0a5772d894 shipit-source-id: 9122e0f04753d1683373e31ba009ca0a5772d894
1 parent c39cf73 commit 59f1166

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMake/HPHPSetup.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ include(HPHPCompiler)
126126
include(HPHPFunctions)
127127
include(HPHPFindLibs)
128128

129+
# Ubuntu 15.10 and 14.04 have been failing to include a dependency on jemalloc
130+
# as a these linked flags force the dependency to be recorded
131+
if (JEMALLOC_ENABLED AND LINUX)
132+
LIST(APPEND HHVM_LINK_LIBRARIES -Wl,--no-as-needed ${JEMALLOC_LIB} -Wl,--as-needed)
133+
endif()
134+
129135
if (HHVM_VERSION_OVERRIDE)
130136
parse_version("HHVM_VERSION_" ${HHVM_VERSION_OVERRIDE})
131137
add_definitions("-DHHVM_VERSION_OVERRIDE")

0 commit comments

Comments
 (0)