From 3ed698bc145c9189824419e90bde0a4d7c7cf51f Mon Sep 17 00:00:00 2001 From: PeroSar Date: Sat, 4 Jun 2022 10:10:58 +0530 Subject: [PATCH] Test build with musl libc Signed-off-by: PeroSar --- .drone.yml | 7 +++---- common.sh | 8 ++++++-- emerald-binutils.sh | 2 -- emerald-gcc.sh | 2 -- emerald-post-gcc-build.sh | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index 80e8737..f951500 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,11 +9,10 @@ trigger: steps: - name: build - image: ubuntu:20.04 + image: alpine:latest commands: - - apt update -yqq && apt install software-properties-common -yqq >/dev/null 2>&1 && add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt install build-essential flex texinfo curl xz-utils gcc-11 g++-11 -yqq >/dev/null 2>&1 - - ln -sf $(which gcc-11) $(which gcc) && ln -sf $(which g++-11) $(which g++) - - bash emerald-binutils.sh && rm -rf build + - apk add gcc g++ texinfo make curl xz bash patch + - bash emerald-binutils.sh - bash emerald-sysroot.sh - bash emerald-gcc.sh - bash emerald-post-gcc-build.sh diff --git a/common.sh b/common.sh index 64b45ac..c7b84aa 100644 --- a/common.sh +++ b/common.sh @@ -3,10 +3,14 @@ TARGET=aarch64-linux-android export PREFIX=/tmp/"$TARGET"-emerald +export EMERALD_SCRIPT_DIR=$(dirname "$(realpath "$0")") +export EMERALD_BUILD_DIR="$EMERALD_SCRIPT_DIR"/build +export EMERALD_DL_DIR="$EMERALD_SCRIPT_DIR"/dl + export CFLAGS="-O3" export CPPFLAGS="$CFLAGS" -export CXXFLAGS="$CFLAGS -static-libgcc -static-libstdc++" -export LDFLAGS="-s -w" +export CXXFLAGS="$CFLAGS" +export LDFLAGS="-s -w -static --static -static-libgcc -static-libstdc++" export CFLAGS_FOR_TARGET="$CFLAGS" export CPPFLAGS_FOR_TARGET="$CFLAGS" diff --git a/emerald-binutils.sh b/emerald-binutils.sh index 6bfbd60..2afe37c 100755 --- a/emerald-binutils.sh +++ b/emerald-binutils.sh @@ -7,8 +7,6 @@ EMERALD_SCRIPT_DIR=$(dirname "$(realpath "$0")") BINUTILS_VER=2.38 BINUTILS_SHA256=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024 -EMERALD_BUILD_DIR="$EMERALD_SCRIPT_DIR"/build -EMERALD_DL_DIR="$EMERALD_SCRIPT_DIR"/dl source "$EMERALD_SCRIPT_DIR"/common.sh # Make sure build/dl directory exists diff --git a/emerald-gcc.sh b/emerald-gcc.sh index 55e291b..83bbba6 100755 --- a/emerald-gcc.sh +++ b/emerald-gcc.sh @@ -7,8 +7,6 @@ EMERALD_SCRIPT_DIR=$(dirname "$(realpath "$0")") GCC_VER=12.1.0 GCC_SHA256=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b -EMERALD_BUILD_DIR="$EMERALD_SCRIPT_DIR"/build -EMERALD_DL_DIR="$EMERALD_SCRIPT_DIR"/dl source "$EMERALD_SCRIPT_DIR"/common.sh # Make sure build and dl directory exists diff --git a/emerald-post-gcc-build.sh b/emerald-post-gcc-build.sh index d4a5395..632365b 100755 --- a/emerald-post-gcc-build.sh +++ b/emerald-post-gcc-build.sh @@ -11,7 +11,7 @@ cd "$PREFIX" # Fix rust builds ( - cd lib/gcc/aarch64-linux-android/"$GCC_VER"/ + cd lib/gcc/"$TARGET"/"$GCC_VER"/ LIBGCC_FILENAME=libgcc_$(base64 <<< $RANDOM$RANDOM | sed 's|=||g').a mv libgcc.a "$LIBGCC_FILENAME" $AR crsT libgcc.a "$LIBGCC_FILENAME" libgcc_eh.a