From 1f5fabd4538fbceb9884874caca7ba819e49c896 Mon Sep 17 00:00:00 2001 From: Chongyun Lee <45286352+licy183@users.noreply.github.com> Date: Mon, 1 Jan 2024 04:06:12 +0800 Subject: [PATCH] Enable optimization --- build.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 5161f4c..58b2cc8 100755 --- a/build.sh +++ b/build.sh @@ -91,6 +91,11 @@ popd mkdir -p $_TMP_DIR/newer-toolchain cp -R $_TMP_DIR/standalone-toolchain/sysroot $_TMP_DIR/newer-toolchain/ +# Set CPPFLAGS/CFLAGS/CXXFLAGS +export CPPFLAGS="-O3 -g0" +export CFLAGS="$CPPFLAGS" +export CXXFLAGS="$CPPFLAGS" + # Build binutils mkdir -p binutils-build pushd binutils-build @@ -109,9 +114,9 @@ export PATH="$_TMP_DIR/newer-toolchain/bin:$PATH" mkdir -p newer-toolchain-build pushd newer-toolchain-build -export CFLAGS="-D__ANDROID_API__=$_API_LEVEL" -export CPPFLAGS="-D__ANDROID_API__=$_API_LEVEL" -export CXXFLAGS="-D__ANDROID_API__=$_API_LEVEL" +export CFLAGS+=" -D__ANDROID_API__=$_API_LEVEL" +export CPPFLAGS+=" -D__ANDROID_API__=$_API_LEVEL" +export CXXFLAGS+=" -D__ANDROID_API__=$_API_LEVEL" $GCC_SRC_DIR/configure \ --host=x86_64-linux-gnu \