GNU bug report logs - #76342
[PATCH] Shepherd: build: Pass CFLAGS, CPPFLAGS and LDFLAGS to CC.

Previous Next

Package: guix-patches;

Reported by: Simon Josefsson <simon <at> josefsson.org>

Date: Sun, 16 Feb 2025 17:23:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Josefsson <simon <at> josefsson.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] build: Pass CFLAGS, CPPFLAGS and LDFLAGS to CC.
Date: Sun, 16 Feb 2025 18:21:41 +0100
[Message part 1 (text/plain, inline)]
Hi

The Debian QA linters noticed that some CC flags were missing, and this
patch fixes it.  It seems the default CFLAGS for me is '-O2 -g' when
running ./configure so I dropped those since they were added twice
otherwise.  Maye -Wall should be moved to a Makefile.am AM_CFLAGS (or
something), but the attached patch seems sufficient to silences Debian's
"blhc" tool which is my main concern.

https://salsa.debian.org/debian/shepherd/-/jobs/7100765

400:CFLAGS missing (-fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection): 			\ gcc -O2 -g -Wall -shared -fPIC -o "etc/crash-handler.so" "etc/crash-handler.c"
400:CPPFLAGS missing (-D_FORTIFY_SOURCE=2): 			\ gcc -O2 -g -Wall -shared -fPIC -o "etc/crash-handler.so" "etc/crash-handler.c"
400:LDFLAGS missing (-Wl,-z,relro): 			\ gcc -O2 -g -Wall -shared -fPIC -o "etc/crash-handler.so" "etc/crash-handler.c"

/Simon
[0001-build-Pass-CFLAGS-CPPFLAGS-and-LDFLAGS-to-CC.patch (text/x-diff, inline)]
From fdaeac0a71f3bdd1daaafffc46647f05e019ac10 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <simon <at> josefsson.org>
Date: Sun, 16 Feb 2025 16:11:04 +0100
Subject: [PATCH] build: Pass CFLAGS, CPPFLAGS and LDFLAGS to CC.

* Makefile.am (etc/crash-handler.so): Do it.

Signed-off-by: Simon Josefsson <simon <at> josefsson.org>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index aa2edd9..bc87404 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -107,7 +107,7 @@ install-crash-handler:
 
 etc/crash-handler.so: etc/crash-handler.c
 	$(AM_V_GEN)$(MKDIR_P) etc;			\
-	$(CC) -O2 -g -Wall -shared -fPIC -o "$@" "$^"
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -shared -fPIC -o "$@" "$^"
 
 CLEANFILES += etc/crash-handler.so
 
-- 
2.48.1

[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.