Skip to content

Commit

Permalink
gnustep-make: enable optimizations and always generate debug info
Browse files Browse the repository at this point in the history
Fixes #18.
  • Loading branch information
triplef committed Dec 4, 2023
1 parent 8bb7395 commit 0fdce4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ export NM="${TOOLCHAIN}"/bin/llvm-nm
export OBJDUMP="${TOOLCHAIN}"/bin/llvm-objdump
export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"

# always generate debug info and build with optimizations
if [ ! -n "${OPTFLAG+set}" ]; then
OPTFLAG="-g -O2"
fi

# NOTE: The following compiler and linker flags mirror the NDK's CMake toolchain file
# and are recommended by the Android Build System Maintainers Guide (see link above)

# - emit stack guards to protect against security vulnerabilities caused by buffer overruns
# - enable FORTIFY to try to catch incorrect use of standard functions
# - generate position-independent code (PIC) to remove unsupported text relocations
export CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC"
export CFLAGS="$OPTFLAG -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC"

# -L library search path required for some projects to find libraries (e.g. gnustep-corebase)
# -fuse-ld=lld require to enforce LLD, which is needed e.g. for --no-rosegment flag
Expand Down

0 comments on commit 0fdce4b

Please sign in to comment.