From f7ae5b14d9b75e6411f222c6c3f6dfcc5a16e58c Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Tue, 15 Dec 2020 17:43:33 +0100 Subject: [PATCH] Enable jemalloc for everything --- CMakeLists.txt | 3 +-- cmake/static_link.sh | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6654bc15..c1abd346 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,6 @@ if(FUSE3_FOUND) FUSE_USE_VERSION=35) set_target_properties(dwarfs-bin PROPERTIES OUTPUT_NAME dwarfs) target_link_libraries(dwarfs-bin PkgConfig::FUSE3) - target_link_libraries(dwarfs-bin ${JEMALLOC_LIBRARIES}) add_custom_target(mount.dwarfs ALL COMMAND ${CMAKE_COMMAND} -E create_symlink dwarfs mount.dwarfs) install(TARGETS dwarfs-bin RUNTIME DESTINATION sbin) @@ -221,7 +220,6 @@ if(FUSE_FOUND) FUSE_USE_VERSION=29) set_target_properties(dwarfs2-bin PROPERTIES OUTPUT_NAME dwarfs2) target_link_libraries(dwarfs2-bin PkgConfig::FUSE) - target_link_libraries(dwarfs-bin ${JEMALLOC_LIBRARIES}) add_custom_target( mount.dwarfs2 ALL COMMAND ${CMAKE_COMMAND} -E create_symlink dwarfs2 mount.dwarfs2) @@ -398,6 +396,7 @@ target_link_libraries( foreach(tgt ${BINARY_TARGETS}) target_link_libraries(${tgt} dwarfs) + target_link_libraries(${tgt} ${JEMALLOC_LIBRARIES}) if(TARGET folly_exception_tracer) target_link_libraries( ${tgt} -Wl,--whole-archive folly_exception_tracer_base diff --git a/cmake/static_link.sh b/cmake/static_link.sh index 9612e083..3ef5b78b 100644 --- a/cmake/static_link.sh +++ b/cmake/static_link.sh @@ -5,13 +5,10 @@ target=$1 shift fuse="" -malloc="" if [[ "$target" == "dwarfs" ]]; then fuse="/usr/lib/x86_64-linux-gnu/libfuse3.a" - malloc="/usr/lib/x86_64-linux-gnu/libjemalloc.a" elif [[ "$target" == "dwarfs2" ]]; then fuse="/usr/lib/x86_64-linux-gnu/libfuse.a" - malloc="/usr/lib/x86_64-linux-gnu/libjemalloc.a" fi g++ -static -static-libgcc -static-libstdc++ "$@" -o "$target" \ @@ -44,7 +41,7 @@ g++ -static -static-libgcc -static-libstdc++ "$@" -o "$target" \ /usr/lib/x86_64-linux-gnu/liblzma.a \ /usr/lib/x86_64-linux-gnu/libz.a \ /usr/lib/gcc/x86_64-linux-gnu/10/libatomic.a \ - $malloc \ + /usr/lib/x86_64-linux-gnu/libjemalloc.a \ /usr/lib/x86_64-linux-gnu/libpthread.a \ /usr/lib/x86_64-linux-gnu/libdl.a \ /usr/lib/x86_64-linux-gnu/libc.a \