gettext: Fix hardening for some binaries.

Message ID 20230311132945.384480-1-stefan.schantl@ipfire.org
State Accepted
Commit 6659cc1188028ad3fabb72603158e386260fb7ed
Headers
Series gettext: Fix hardening for some binaries. |

Commit Message

Stefan Schantl March 11, 2023, 1:29 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 gettext/gettext.nm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gettext/gettext.nm b/gettext/gettext.nm
index 264eb2db0..1e2af67f7 100644
--- a/gettext/gettext.nm
+++ b/gettext/gettext.nm
@@ -5,7 +5,7 @@ 
 
 name       = gettext
 version    = 0.21.1
-release    = 2.1
+release    = 3
 
 groups     = System/Base
 url        = https://www.gnu.org/software/gettext/
@@ -44,6 +44,13 @@  build
 		--enable-shared \
 		--disable-rpath
 
+	configure_cmds
+		# Add additional compiler flages to build gettext-tools binaries with
+		# proper hardening.
+		sed -i '/^CFLAGS =/ s/$/ -fno-builtin-exit -D__noreturn__=/' \
+			%{DIR_APP}/gettext-tools/src/Makefile
+	end
+
 	test
 		make check || :
 	end