summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-05-24 15:45:54 +0200
committerPeter Fors <peter.fors@mindkiller.com>2025-05-24 15:45:54 +0200
commita8e0c141b0184d629504b9f0ee8dbc4fefb90934 (patch)
treecff0f7e64ce58dc8f1e4ff4501743d9b94449c94 /build.sh
parente28ad1546509de31b706f0fd300a906e5bc55199 (diff)
3011fps
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/build.sh b/build.sh
index cbe8e64..0660fbb 100755
--- a/build.sh
+++ b/build.sh
@@ -10,23 +10,26 @@ CFLAGS="-std=gnu11 -mtune=generic "
CFLAGS+="-mbmi "
CFLAGS+="-mfunction-return=keep -mindirect-branch=keep "
CFLAGS+="-fwrapv -ffast-math -fno-trapping-math -fvisibility=hidden "
-CFLAGS+="-fno-stack-protector -fno-PIE -no-pie -fno-strict-aliasing -fcf-protection=none -ffunction-sections -fdata-sections "
+CFLAGS+="-fno-stack-protector -fno-PIE -no-pie -fcf-protection=none -ffunction-sections -fdata-sections "
# CFLAGS+="-fno-exceptions -fno-rtti -fno-use-cxa-atexit "
CFLAGS+="-fno-non-call-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables "
-CFLAGS+="-Wall -Wextra "
+CFLAGS+="-Wall -Wextra -Wstrict-aliasing=3 "
CFLAGS+="-Wno-unused-parameter -Wno-sign-compare -Wno-trigraphs -Wno-maybe-uninitialized "
CFLAGS+="-Wno-unused-variable -Wno-unused-const-variable -Wno-unused-function -Wno-write-strings -Wno-missing-field-initializers "
CFLAGS+="-U_FORTIFY_SOURCE -fno-pic "
+# Enable occationally to check for errors..
+# CFLAGS+="-fanalyzer "
+
LDFLAGS="-Wl,--gc-sections -Wl,--as-needed "
-# LDFLAGS+="-Wl,--script=mknes.ld "
# Base include paths (common for all platforms)
INCLUDE_PATHS="-Ibase -I.."
# Linux-specific includes and libraries
LINUX_INCLUDE="-I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2"
-LINUX_LIBS="-lpipewire-0.3 -lXi -lX11 -lGL -lm -ldl -pthread -lglfw -larchive "
+#LINUX_LIBS="-lpipewire-0.3 -lXi -lX11 -lGL -lm -ldl -pthread -lglfw -larchive "
+LINUX_LIBS="-lXi -lX11 -lGL -lm -ldl -pthread -lglfw -larchive "
# Windows-specific includes and libraries
# WINDOWS_INCLUDE=""
@@ -49,7 +52,7 @@ case "$BUILD_TYPE" in
CFLAGS+=" -s -Wl,--strip-all -O2"
;;
"profile")
- CFLAGS+=" -g -O2 -fprofile-generate -ftest-coverage"
+ CFLAGS+=" -O2 -fprofile-generate -ftest-coverage"
;;
"profile_release")
CFLAGS+=" -s -Wl,--strip-all -O2 -fprofile-use"
@@ -84,6 +87,7 @@ set -e
(
# ../bin/ctime -begin .${PROJECT_NAME}_linux
$CC $CFLAGS ${PROJECT_NAME}.c -o ${PROJECT_NAME} $INCLUDE_PATHS $LINUX_INCLUDE $LDFLAGS $LINUX_LIBS
+ objdump -d -Mintel mknes > mknes.s
# ../bin/ctime -end .${PROJECT_NAME}_linux $?
) &