From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=EPS+OXkt; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D6C9F5A0619 for ; Sun, 17 May 2026 03:08:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1778980099; bh=IRSyepCmZmfrfnCJLRUXfv8XoPtNaI3fzG5ks9Lkp9A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EPS+OXkthHKDLWRrBoM4AARx85PzJbz56aWDwRQ16yOvLhw3i1fKTKAkBnWSCjEKN XTH9fPqmfo11goVSXBDwXaUvgcJcMq0NVZc/2gYIGriDheMd0rlZ1SdIUz77Rg+BUo uMRcNAQOopSENhok6PknBJsgKDQlWLTdbKm6P9gSOf34by9qDs6ptUte4PwvxKjMFc Fj0RoV+xLTX/UOkX4SxT+51jpGZRaIvUkPHL9dbp3xVRWRieHEWj6zdARmFbGuCRBr 4z4bpSOBRekTERVXvqRdIH2rSx1N+5R/f4WI3hkhkpxdigRoNT02ciSfst8gyIyPqu ws5ZSqsdeiFCw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gJ2ql5k2Sz4wGB; Sun, 17 May 2026 11:08:19 +1000 (AEST) Date: Sun, 17 May 2026 10:48:13 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 06/12] Makefile: Split $(FLAGS) into cpp and cc components Message-ID: References: <20260512055256.1800449-1-david@gibson.dropbear.id.au> <20260512055256.1800449-7-david@gibson.dropbear.id.au> <20260516174553.5d4e8278@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Q0N9cnplG6z0OOMr" Content-Disposition: inline In-Reply-To: <20260516174553.5d4e8278@elisabeth> Message-ID-Hash: DCOMGN5VGYVOHZB7SUN4LAFTHM5Q26Y2 X-Message-ID-Hash: DCOMGN5VGYVOHZB7SUN4LAFTHM5Q26Y2 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --Q0N9cnplG6z0OOMr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 16, 2026 at 05:45:54PM +0200, Stefano Brivio wrote: > On Tue, 12 May 2026 15:52:50 +1000 > David Gibson wrote: >=20 > > The $(FLAGS) variable contains mandatory compiler flags that should not= be > > overridden. However, it contains a mixture of flags for the preprocess= or > > and for the compiler proper. That's causing some inconvenience for oth= er > > Makefile cleanups, so split it into $(BASE_CPPFLAGS) and $(BASE_CFLAGS) > > variables. > >=20 > > Signed-off-by: David Gibson > > --- > > Makefile | 40 ++++++++++++++++++++++++---------------- > > 1 file changed, 24 insertions(+), 16 deletions(-) > >=20 > > diff --git a/Makefile b/Makefile > > index a8f8d06e..697f229f 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -30,12 +30,17 @@ ifeq ($(shell $(CC) -O2 -dM -E - < /dev/null 2>&1 |= grep ' _FORTIFY_SOURCE ' > / > > FORTIFY_FLAG :=3D -D_FORTIFY_SOURCE=3D2 > > endif > > =20 > > -FLAGS :=3D -Wall -Wextra -Wno-format-zero-length -Wformat-security > > -FLAGS +=3D -pedantic -std=3Dc11 -D_XOPEN_SOURCE=3D700 -D_GNU_SOURCE > > -FLAGS +=3D $(FORTIFY_FLAG) -O2 -pie -fPIE > > -FLAGS +=3D -DPAGE_SIZE=3D$(shell getconf PAGE_SIZE) > > -FLAGS +=3D -DVERSION=3D\"$(VERSION)\" > > -FLAGS +=3D -DDUAL_STACK_SOCKETS=3D$(DUAL_STACK_SOCKETS) > > +# Mandatory preprocessor flags that won't be overridden with $(CPPFLAG= S) > > +# FIXME: Could some of these be default, rather than required? > > +BASE_CPPFLAGS :=3D -D_XOPEN_SOURCE=3D700 -D_GNU_SOURCE $(FORTIFY_FLAG) > > +BASE_CPPFLAGS +=3D -DPAGE_SIZE=3D$(shell getconf PAGE_SIZE) > > +BASE_CPPFLAGS +=3D -DVERSION=3D\"$(VERSION)\" > > +BASE_CPPFLAGS +=3D -DDUAL_STACK_SOCKETS=3D$(DUAL_STACK_SOCKETS) > > + > > +# Mandatory compiler flags that won't be overridden with $(CFLAGS) > > +# FIXME: Could some of these be default, rather than required? > > +BASE_CFLAGS :=3D -std=3Dc11 -pie -fPIE -O2 > > +BASE_CFLAGS +=3D -pedantic -Wall -Wextra -Wno-format-zero-length -Wfor= mat-security > > =20 > > PASST_SRCS =3D arch.c arp.c bitmap.c checksum.c conf.c dhcp.c dhcpv6.c= \ > > epoll_ctl.c flow.c fwd.c fwd_rule.c icmp.c igmp.c inany.c iov.c ip.c \ > > @@ -62,11 +67,11 @@ PASST_REPAIR_HEADERS =3D linux_dep.h > > =20 > > C :=3D \#include \nint main(){int a=3Dgetrandom(0, 0, 0)= ;} > > ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; ech= o $$?),0) > > - FLAGS +=3D -DHAS_GETRANDOM > > + BASE_CPPFLAGS +=3D -DHAS_GETRANDOM > > endif > > =20 > > ifeq ($(shell :|$(CC) -fstack-protector-strong -S -xc - -o - >/dev/nul= l 2>&1; echo $$?),0) > > - FLAGS +=3D -fstack-protector-strong > > + BASE_CFLAGS +=3D -fstack-protector-strong > > endif > > =20 > > prefix ?=3D /usr/local > > @@ -89,7 +94,8 @@ endif > > =20 > > all: $(BIN) $(MANPAGES) docs > > =20 > > -static: FLAGS +=3D -static -DGLIBC_NO_STATIC_NSS > > +static: BASE_CPPFLAGS +=3D -DGLIBC_NO_STATIC_NSS > > +static: BASE_CFLAGS +=3D -static=20 >=20 > Trailing whitespace I fixed up on merge. Oops, thanks! --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --Q0N9cnplG6z0OOMr Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmoJEEEACgkQzQJF27ox 2GeK4A/+OafpUYlyCRe3S2PZeLoteIUtzB9Fxi11gDD639WARUkLckb9blqZziAM xezkhCLL1PdZ3JMWPJpVIGVochtmR9dHAPAiInFRbXv9rSR2cRrcYAb5YV8hrDzk Lu1GJZmeGRv8vDtXZ1xJHkZqyBASV8xPLmukv+2rS3LShkemyO9CDmnzRHh6cOYd YsQmKnoHbo35GNRvQnOXSP5jiLgLtzWKzt9bE8dayoSvBZX89ag4wAEMZeOb5hQS 3NBaBQFmaKm0KnWr4KEiyCpePlffBd4nVqQYvUU8m132ht5LwmgrY44OCzAPiM7Z Jwk2sYfp5303iY5zriXR8M9AT79eKeRJ08E6u03LxD5XDxwiPDSYJbTx0O9u4HHe oOJZ2C+R91yqFOYVsHxAidVdysatb6EsPwDHrsWuthwty4/7WQe155m2Zs1HRQH0 YKosvK6VvpjcouuaRLKIwu+6ZQIhuzJl3q7jyReo6EdNmsqyPCUV1mitKPRVK8xk TyT6In4r3vrWadjKUz7Db53SFlkpMPb8d8IEFpAZVbNr1dmo57bqfTkiX0/mAtxh M703jYG52g9PprkN7+cvoBXjva+fXF+uuDoQHIPHSEsxm+BLMgw4UcGvh20DzEeA mDqlRzShf9e+g0jrzfiPbYhm6CcCFli/RpOjIPDwamn+wNAdQEU= =eZG4 -----END PGP SIGNATURE----- --Q0N9cnplG6z0OOMr--