Skip to content

Commit 0fdce4b

Browse files
committed
gnustep-make: enable optimizations and always generate debug info
Fixes #18.
1 parent 8bb7395 commit 0fdce4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/toolchain.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ export NM="${TOOLCHAIN}"/bin/llvm-nm
2020
export OBJDUMP="${TOOLCHAIN}"/bin/llvm-objdump
2121
export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"
2222

23+
# always generate debug info and build with optimizations
24+
if [ ! -n "${OPTFLAG+set}" ]; then
25+
OPTFLAG="-g -O2"
26+
fi
27+
2328
# NOTE: The following compiler and linker flags mirror the NDK's CMake toolchain file
2429
# and are recommended by the Android Build System Maintainers Guide (see link above)
2530

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

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

0 commit comments

Comments
 (0)