Skip to content

Commit 3711e29

Browse files
committed
examples: fix jemalloc
fixed #7
1 parent a7a00d7 commit 3711e29

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/spec2006/build-all.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ in stdenv.mkDerivation {
7575
export CFLAGS="$CFLAGS -static -Wno-format-security -I${riscv64-jemalloc}/include "
7676
export CXXFLAGS="$CXXFLAGS -static -Wno-format-security -I${riscv64-jemalloc}/include"
7777
export LDFLAGS="$LDFLAGS -static -ljemalloc -L${riscv64-jemalloc}/lib"
78+
export LIBS="${riscv64-jemalloc}/lib/libjemalloc.a"
7879
7980
pushd $SPEC && source shrc && popd
8081
make copy-all-src

examples/spec2006/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ let
133133
];
134134
preBuild = ''
135135
# Add weak attribute to C++ operators, same as jemalloc_cpp.patch
136-
sed -i 's/void \*operator new(size_t)/void *operator new(size_t) __attribute__((weak))/g' src/jemalloc_cpp.cpp
137-
sed -i 's/void operator delete(void \*)/void operator delete(void *) __attribute__((weak))/g' src/jemalloc_cpp.cpp
136+
sed -i '/void/N;s/void[[:space:]]*\*[[:space:]]*operator new/void __attribute__((weak)) *operator new/g' src/jemalloc_cpp.cpp
137+
sed -i '/void/N;s/void[[:space:]]*operator delete/void __attribute__((weak)) operator delete/g' src/jemalloc_cpp.cpp
138138
'';
139139
# Ensure static libraries are installed
140140
postInstall = ''

0 commit comments

Comments
 (0)