Description: Add -g flag for debugging symbols needed in dbgsym packages and
             hardening flags suggested by blhc; -fcf-protection not added
             because it fails on architectures other than amd64
Origin: vendor
Forwarded: no
Author: Helmar Gerloni <helmar@gerloni.net>
Last-Update: 2025-01-08

--- a/desktop/build-scripts/native-modules/tuxguitar-alsa-linux/pom.xml
+++ b/desktop/build-scripts/native-modules/tuxguitar-alsa-linux/pom.xml
@@ -23,8 +23,8 @@
 
 		<tuxguitar-alsa.jni.path>${project.parent.relativePath}/TuxGuitar-alsa/jni/</tuxguitar-alsa.jni.path>
 		<tuxguitar-alsa.jni.cc>${tuxguitar.jni.cc}</tuxguitar-alsa.jni.cc>
-		<tuxguitar-alsa.jni.cflags>${tuxguitar.jni.header.path} -fPIC</tuxguitar-alsa.jni.cflags>
-		<tuxguitar-alsa.jni.ldflags>-fPIC</tuxguitar-alsa.jni.ldflags>
+		<tuxguitar-alsa.jni.cflags>${tuxguitar.jni.header.path} -fPIC -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security</tuxguitar-alsa.jni.cflags>
+		<tuxguitar-alsa.jni.ldflags>-fPIC -Wl,-z,relro -Wl,-z,now</tuxguitar-alsa.jni.ldflags>
 		<tuxguitar-alsa.jni.ldlibs>-lasound</tuxguitar-alsa.jni.ldlibs>
 		<tuxguitar-alsa.jni.ldpath>${tuxguitar.jni.ldpath}</tuxguitar-alsa.jni.ldpath>
 		<tuxguitar-alsa.jni.library.name>tuxguitar-alsa-jni</tuxguitar-alsa.jni.library.name>
--- a/desktop/build-scripts/native-modules/tuxguitar-fluidsynth-linux/pom.xml
+++ b/desktop/build-scripts/native-modules/tuxguitar-fluidsynth-linux/pom.xml
@@ -25,8 +25,8 @@
 		<tuxguitar-fluidsynth.jni.path>${project.parent.relativePath}/TuxGuitar-fluidsynth/jni/</tuxguitar-fluidsynth.jni.path>
 		<tuxguitar-fluidsynth.jni.rm>${tuxguitar.jni.rm}</tuxguitar-fluidsynth.jni.rm>
 		<tuxguitar-fluidsynth.jni.cc>${tuxguitar.jni.cc}</tuxguitar-fluidsynth.jni.cc>
-		<tuxguitar-fluidsynth.jni.cflags>${tuxguitar.jni.header.path} -fPIC</tuxguitar-fluidsynth.jni.cflags>
-		<tuxguitar-fluidsynth.jni.ldflags>-fPIC</tuxguitar-fluidsynth.jni.ldflags>
+		<tuxguitar-fluidsynth.jni.cflags>${tuxguitar.jni.header.path} -fPIC -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security</tuxguitar-fluidsynth.jni.cflags>
+		<tuxguitar-fluidsynth.jni.ldflags>-fPIC -Wl,-z,relro -Wl,-z,now</tuxguitar-fluidsynth.jni.ldflags>
 		<tuxguitar-fluidsynth.jni.ldlibs>-lfluidsynth</tuxguitar-fluidsynth.jni.ldlibs>
 		<tuxguitar-fluidsynth.jni.ldpath>${tuxguitar.jni.ldpath}</tuxguitar-fluidsynth.jni.ldpath>
 		<tuxguitar-fluidsynth.jni.library.name>tuxguitar-fluidsynth-jni</tuxguitar-fluidsynth.jni.library.name>
--- a/desktop/build-scripts/native-modules/tuxguitar-jack-linux/pom.xml
+++ b/desktop/build-scripts/native-modules/tuxguitar-jack-linux/pom.xml
@@ -25,8 +25,8 @@
 		<tuxguitar-jack.jni.path>${project.parent.relativePath}/TuxGuitar-jack/jni/</tuxguitar-jack.jni.path>
 		<tuxguitar-jack.jni.rm>${tuxguitar.jni.rm}</tuxguitar-jack.jni.rm>
 		<tuxguitar-jack.jni.cc>${tuxguitar.jni.cc}</tuxguitar-jack.jni.cc>
-		<tuxguitar-jack.jni.cflags>${tuxguitar.jni.header.path} -fPIC</tuxguitar-jack.jni.cflags>
-		<tuxguitar-jack.jni.ldflags>-fPIC</tuxguitar-jack.jni.ldflags>
+		<tuxguitar-jack.jni.cflags>${tuxguitar.jni.header.path} -fPIC -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security</tuxguitar-jack.jni.cflags>
+		<tuxguitar-jack.jni.ldflags>-fPIC -Wl,-z,relro -Wl,-z,now</tuxguitar-jack.jni.ldflags>
 		<tuxguitar-jack.jni.ldlibs>`pkg-config --libs jack`</tuxguitar-jack.jni.ldlibs>
 		<tuxguitar-jack.jni.ldpath>${tuxguitar.jni.ldpath}</tuxguitar-jack.jni.ldpath>
 		<tuxguitar-jack.jni.library.name>tuxguitar-jack-jni</tuxguitar-jack.jni.library.name>
--- a/desktop/build-scripts/native-modules/tuxguitar-synth-lv2-linux/pom.xml
+++ b/desktop/build-scripts/native-modules/tuxguitar-synth-lv2-linux/pom.xml
@@ -25,8 +25,8 @@
 		<tuxguitar-synth-lv2.jni.path>${project.parent.relativePath}/TuxGuitar-synth-lv2/src/main/jni/</tuxguitar-synth-lv2.jni.path>
 		<tuxguitar-synth-lv2.jni.cxx>${tuxguitar.jni.cxx}</tuxguitar-synth-lv2.jni.cxx>
 		<tuxguitar-synth-lv2.jni.rm>${tuxguitar.jni.rm}</tuxguitar-synth-lv2.jni.rm>
-		<tuxguitar-synth-lv2.jni.cflags>${tuxguitar.jni.header.path} -I/usr/include/lilv-0/lilv -fPIC -fpermissive</tuxguitar-synth-lv2.jni.cflags>
-		<tuxguitar-synth-lv2.jni.ldflags>-fPIC</tuxguitar-synth-lv2.jni.ldflags>
+		<tuxguitar-synth-lv2.jni.cflags>${tuxguitar.jni.header.path} -I/usr/include/lilv-0/lilv -fPIC -fpermissive -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2</tuxguitar-synth-lv2.jni.cflags>
+		<tuxguitar-synth-lv2.jni.ldflags>-fPIC -Wl,-z,relro -Wl,-z,now</tuxguitar-synth-lv2.jni.ldflags>
 		<tuxguitar-synth-lv2.jni.ldlibs>-llilv-0 -lsuil-0</tuxguitar-synth-lv2.jni.ldlibs>
 		<tuxguitar-synth-lv2.jni.ldpath>${tuxguitar.jni.ldpath}</tuxguitar-synth-lv2.jni.ldpath>
 		<tuxguitar-synth-lv2.jni.library.name>tuxguitar-synth-lv2-jni</tuxguitar-synth-lv2.jni.library.name>
@@ -37,8 +37,8 @@
 		<tuxguitar-synth-lv2.cxx.path>${project.parent.relativePath}/TuxGuitar-synth-lv2/src/main/cxx/</tuxguitar-synth-lv2.cxx.path>
 		<tuxguitar-synth-lv2.cxx.cxx>${tuxguitar.jni.cxx}</tuxguitar-synth-lv2.cxx.cxx>
 		<tuxguitar-synth-lv2.cxx.rm>${tuxguitar.jni.rm}</tuxguitar-synth-lv2.cxx.rm>
-		<tuxguitar-synth-lv2.cxx.cflags>-I/usr/include/lilv-0/lilv -I/usr/include/suil-0/suil -I`pkg-config Qt5Core --cflags` `pkg-config Qt5Widgets --cflags` -fPIC -fpermissive</tuxguitar-synth-lv2.cxx.cflags>
-		<tuxguitar-synth-lv2.cxx.ldflags>-fPIC</tuxguitar-synth-lv2.cxx.ldflags>
+		<tuxguitar-synth-lv2.cxx.cflags>-I/usr/include/lilv-0/lilv -I/usr/include/suil-0/suil -I`pkg-config Qt5Core --cflags` `pkg-config Qt5Widgets --cflags` -fPIC -fpermissive -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2</tuxguitar-synth-lv2.cxx.cflags>
+		<tuxguitar-synth-lv2.cxx.ldflags>-fPIC -Wl,-z,relro -Wl,-z,now</tuxguitar-synth-lv2.cxx.ldflags>
 		<tuxguitar-synth-lv2.cxx.ldlibs>-llilv-0 -lsuil-0 -lpthread `pkg-config Qt5Core --libs` `pkg-config Qt5Widgets --libs`</tuxguitar-synth-lv2.cxx.ldlibs>
 		<tuxguitar-synth-lv2.cxx.ldpath>${tuxguitar.jni.ldpath}</tuxguitar-synth-lv2.cxx.ldpath>
 		<tuxguitar-synth-lv2.cxx.binary.name>tuxguitar-synth-lv2</tuxguitar-synth-lv2.cxx.binary.name>
