Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
feat: build libcryptobox with stack protector flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara committed Aug 29, 2023
1 parent 117244c commit 65d9225
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust
FROM rust:bullseye

USER root

Expand Down
16 changes: 12 additions & 4 deletions android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ jni/armeabi-v7a/libcryptobox.so: libsodium-armeabi-v7a | build/src/$(CRYPTOBOX_N
-L ../../libsodium-android-arm-v7a/lib \
-C ar=arm-linux-androideabi-ar \
-C linker=armv7a-linux-androideabi16-clang \
-C link_args="-Wl,-soname,libcryptobox.so"
-C link_args="-Wl,-soname,libcryptobox.so" \
-C link_arg=-fstack-protector-strong \
-C target_feature=+crt-static
mkdir -p jni/armeabi-v7a
cp build/src/$(CRYPTOBOX_NAME)/target/armv7-linux-androideabi/release/libcryptobox.so jni/armeabi-v7a/libcryptobox.so

Expand All @@ -118,7 +120,9 @@ jni/x86/libcryptobox.so: libsodium-x86 | build/src/$(CRYPTOBOX_NAME)
-L ../../libsodium-android-x86/lib \
-C ar=i686-linux-android-ar \
-C linker=i686-linux-android16-clang \
-C link_args="-Wl,-soname,libcryptobox.so"
-C link_args="-Wl,-soname,libcryptobox.so" \
-C link_arg=-fstack-protector-strong \
-C target_feature=+crt-static
mkdir -p jni/x86
cp build/src/$(CRYPTOBOX_NAME)/target/i686-linux-android/release/libcryptobox.so jni/x86/libcryptobox.so

Expand All @@ -131,7 +135,9 @@ jni/x86_64/libcryptobox.so: libsodium-x86_64 | build/src/$(CRYPTOBOX_NAME)
-L ../../libsodium-android-x86_64/lib \
-C ar=x86_64-linux-android-ar \
-C linker=x86_64-linux-android21-clang \
-C link_args="-Wl,-soname,libcryptobox.so"
-C link_args="-Wl,-soname,libcryptobox.so" \
-C link_arg=-fstack-protector-strong \
-C target_feature=+crt-static
mkdir -p jni/x86_64
cp build/src/$(CRYPTOBOX_NAME)/target/x86_64-linux-android/release/libcryptobox.so jni/x86_64/libcryptobox.so

Expand All @@ -144,7 +150,9 @@ jni/arm64-v8a/libcryptobox.so: libsodium-aarch64 | build/src/$(CRYPTOBOX_NAME)
-L ../../libsodium-android-armv8-a/lib \
-C ar=aarch64-linux-android-ar \
-C linker=aarch64-linux-android21-clang \
-C link_args="-Wl,-soname,libcryptobox.so"
-C link_args="-Wl,-soname,libcryptobox.so" \
-C link_arg=-fstack-protector-strong \
-C target_feature=+crt-static
mkdir -p jni/arm64-v8a
cp build/src/$(CRYPTOBOX_NAME)/target/aarch64-linux-android/release/libcryptobox.so jni/arm64-v8a/libcryptobox.so

Expand Down

0 comments on commit 65d9225

Please sign in to comment.