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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76342: closed ([PATCH] Shepherd: build: Pass CFLAGS, CPPFLAGS
 and LDFLAGS to CC.)
Date: Thu, 20 Feb 2025 22:54:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 20 Feb 2025 23:53:00 +0100
with message-id <871pvsfctv.fsf <at> gnu.org>
and subject line Re: [bug#76342] [PATCH] build: Pass CFLAGS, CPPFLAGS and LDFLAGS to CC.
has caused the debbugs.gnu.org bug report #76342,
regarding [PATCH] Shepherd: build: Pass CFLAGS, CPPFLAGS and LDFLAGS to CC.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76342: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76342
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 6 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Simon Josefsson <simon <at> josefsson.org>
Cc: 76342-done <at> debbugs.gnu.org
Subject: Re: [bug#76342] [PATCH] build: Pass CFLAGS, CPPFLAGS and LDFLAGS to
 CC.
Date: Thu, 20 Feb 2025 23:53:00 +0100
Hi Simon,

Simon Josefsson <simon <at> josefsson.org> skribis:

> 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>

Applied, thanks!

Ludo’.


This bug report was last modified 149 days ago.

Previous Next


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