Skip to content

Commit

Permalink
Makefile + script: improve and fix
Browse files Browse the repository at this point in the history
*.so files are now in out/
  • Loading branch information
Antonin Reitz committed Oct 9, 2023
1 parent c0c2336 commit cf14e39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ src/lib-alloc.c

# foptimize-strlen = gcc issue culprit
lib: verify extract
mkdir -p out
$(CC) -O3 \
-DKRML_VERIFIED_UINT128 \
-I $(KRML_HOME)/include \
Expand All @@ -180,13 +181,14 @@ lib: verify extract
-shared -fPIC \
$(FILES) \
src/lib-alloc.c \
-o bench/starmalloc.so
-o out/starmalloc.so

#-Wmissing-prototypes
#-std=c17
#-Wall -Wextra -Wcast-align=strict -Wcast-qual
#-fvisibility=hidden
hardened_lib: verify extract
mkdir -p out
$(CC) -DKRML_VERIFIED_UINT128 \
-pipe -O3 -flto -fPIC \
-fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong \
Expand All @@ -199,7 +201,7 @@ hardened_lib: verify extract
-shared -fPIC \
$(FILES) \
src/lib-alloc.c \
-o bench/h_starmalloc.so \
-o out/h_starmalloc.so \

# test the allocator as a shared library with a simple program
test-alloc1: lib
Expand Down
4 changes: 2 additions & 2 deletions setup-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ apply_starmalloc_tweak() {
install StarMalloc libs within mimalloc-bench dir"
pushd extern/mimalloc-bench 1>/dev/null
mkdir -p extern/st
cp out/*.so extern/st
cp ../../out/*.so extern/st
if [[ -f "../mb-tweak-starmalloc.txt" ]]; then
echo "StarMalloc tweak already applied to mimalloc-bench"
else
Expand Down Expand Up @@ -165,7 +165,7 @@ else
cat <<-EOF
Now, everything is ready to bench StarMalloc wrt to other allocators,
using mimalloc-bench.
From the mimalloc-bench/out/bench directory,
From the extern/mimalloc-bench/out/bench directory,
you can use the following command:
bash ../../bench.sh \$ALLOCATORS \$BENCHES,
e.g.
Expand Down

0 comments on commit cf14e39

Please sign in to comment.