From ddbc843bbc7bf30db68ae3938d1a84aa982d1a7e Mon Sep 17 00:00:00 2001 From: Boulay Mathias Date: Wed, 3 May 2023 13:38:15 +0200 Subject: [PATCH] Feat: strip binaries --- buildjdk.sh | 8 ++++---- repackjre.sh | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/buildjdk.sh b/buildjdk.sh index 2ed35f5..9f634cf 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -92,15 +92,15 @@ fi bash ./configure \ --openjdk-target=$TARGET \ - --with-extra-cflags=" -flto $CFLAGS" \ - --with-extra-cxxflags=" -flto $CFLAGS" \ - --with-extra-ldflags=" -flto $LDFLAGS" \ + --with-extra-cflags="$CFLAGS" \ + --with-extra-cxxflags="$CFLAGS" \ + --with-extra-ldflags="$LDFLAGS" \ --disable-precompiled-headers \ --disable-warnings-as-errors \ --enable-option-checking=fatal \ --enable-headless-only=yes \ --with-jvm-variants=$JVM_VARIANTS \ - --with-jvm-features=-dtrace,-zero,-vm-structs,-epsilongc,link-time-opt \ + --with-jvm-features=-dtrace,-zero,-vm-structs,-epsilongc \ --with-cups-include=$CUPS_DIR \ --with-devkit=$TOOLCHAIN \ --with-debug-level=$JDK_DEBUG_LEVEL \ diff --git a/repackjre.sh b/repackjre.sh index 4109298..5710f9e 100755 --- a/repackjre.sh +++ b/repackjre.sh @@ -18,7 +18,7 @@ mkdir -p $work1 mkdir -p "$out" # here comes a not-so-complicated functions to easily make desired arch -## Usage: makearch [jre_libs_dir_name] [name_in_tarball] +## Usage: makearch [jre_libs_dir_name] [name_in_tarball] [name of prebuilt tool] makearch () { echo "Making $2..."; cd "$work"; @@ -36,6 +36,9 @@ makearch () { find ./ -name '*.so' -execdir mv {} "$work1"/lib/{} \; mv release "$work1"/release + + # Strip in place all .so files thanks to the ndk + find "$work1" -name '.*so' -execdir "$NDK/toolchains/llvm/prebuilt/linux-x86_64/$3-linux-android/bin/strip" {} XZ_OPT="-6 --threads=0" tar cJf bin-$2.tar.xz -C "$work1" . > /dev/null; mv bin-$2.tar.xz "$out"/; @@ -62,10 +65,10 @@ makeuni () { # now time to use them! makeuni -makearch aarch32 arm -makearch aarch64 arm64 -makearch i386 x86 -makearch amd64 x86_64 +makearch aarch32 arm arm +makearch aarch64 arm64 aarch64 +makearch i386 x86 i686 +makearch amd64 x86_64 x86_64 # if running under GitHub Actions, write commit sha, else formatted system date if [ -n "$GITHUB_SHA" ]