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=GCZ77/By; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 2F1BA5A0262 for ; Wed, 29 Apr 2026 06:47:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1777438023; bh=z9+y7mOFe/SuRW6TppDNYkyYgSvDnOoRy1x1XeMrk88=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GCZ77/BySZiXs/Z9ZexooJyiR70DRXF8YZYbGVDJNmdPlN4/B1KMxd1uIEwc7OiTA 3D5RuZMgRUHRx4ygKo0VeC6P8dvSeIxy4ZOA9QHbyZMU4QScPdvtVcYA6HAULaSXIV 68ZA3XOvAo8Sfy7tFsBwtuiD5fieB/mDDIpFMCtJuZouUgP1KzPGhg9eroRwbfzxZU cjrSYiQMOquqOu2FrjTdFP+CiB9UvyyYYLNfe9F/ruJwnl4iUvwmWMmLCqf47BHTKg g4H5jBIvqMzqYkOgoNY4DI2oD+s9YPeXqkb/J2LXYjABYwWcVFQS6ASX+iHXLJQXNE 8o7E3NyPZCNiA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4g54XR4YS7z4wnv; Wed, 29 Apr 2026 14:47:03 +1000 (AEST) Date: Wed, 29 Apr 2026 13:47:13 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 04/13] Makefile: Remove non-standard $(FLAGS) variable Message-ID: References: <20260421032338.1909084-1-david@gibson.dropbear.id.au> <20260421032338.1909084-5-david@gibson.dropbear.id.au> <20260428091728.3b00b5be@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lDtaPDSwQ+u6aggX" Content-Disposition: inline In-Reply-To: <20260428091728.3b00b5be@elisabeth> Message-ID-Hash: XBN6CPAOVK7KAJQQEEMQSHPY34V52OYI X-Message-ID-Hash: XBN6CPAOVK7KAJQQEEMQSHPY34V52OYI 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: --lDtaPDSwQ+u6aggX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 28, 2026 at 09:17:31AM +0200, Stefano Brivio wrote: > On Tue, 21 Apr 2026 13:23:29 +1000 > David Gibson wrote: >=20 > > FLAGS was introduced over the more standard CFLAGS, because there are s= ome > > options we can't compile without, so overriding CFLAGS from the command > > line wasn't practical. We've now better dealt with that using > > BASE_CPPFLAGS, so there's no real need for FLAGS any more. Replace it > > with the more conventional CFLAGS, which now *can* be reasonable overri= dden > > from the command line. > >=20 > > Signed-off-by: David Gibson > > --- > > Makefile | 21 ++++++++++----------- > > test/build/build.py | 4 ++-- > > 2 files changed, 12 insertions(+), 13 deletions(-) > >=20 > > diff --git a/Makefile b/Makefile > > index e89e5556..1e5f0282 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -36,8 +36,8 @@ BASE_CPPFLAGS :=3D -D_XOPEN_SOURCE=3D700 -D_GNU_SOURC= E \ > > -DVERSION=3D\"$(VERSION)\" > > CPPFLAGS :=3D $(FORTIFY_FLAG) -DDUAL_STACK_SOCKETS=3D$(DUAL_STACK_SOCK= ETS) > > =20 > > -FLAGS :=3D -Wall -Wextra -Wno-format-zero-length -Wformat-security > > -FLAGS +=3D -pedantic -std=3Dc11 -O2 -pie -fPIE > > +WARNINGS =3D -Wall -Wextra -Wno-format-zero-length -Wformat-security > > +CFLAGS =3D -pedantic -std=3Dc11 -O2 -pie -fPIE $(WARNINGS) > > =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 \ > > @@ -66,7 +66,7 @@ ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/d= ev/null 2>&1; echo $$?),0) > > endif > > =20 > > ifeq ($(shell :|$(CC) -fstack-protector-strong -S -xc - -o - >/dev/nul= l 2>&1; echo $$?),0) > > - FLAGS +=3D -fstack-protector-strong > > + CFLAGS +=3D -fstack-protector-strong > > endif > > =20 > > prefix ?=3D /usr/local > > @@ -85,7 +85,7 @@ endif > > =20 > > all: $(BIN) $(MANPAGES) docs > > =20 > > -static: FLAGS +=3D -static > > +static: CFLAGS +=3D -static > > static: CPPFLAGS +=3D -DGLIBC_NO_STATIC_NSS > > static: clean all > > =20 > > @@ -96,12 +96,11 @@ seccomp_repair.h: seccomp.sh $(PASST_REPAIR_SRCS) > > @ ARCH=3D"$(TARGET_ARCH)" CC=3D"$(CC)" ./seccomp.sh seccomp_repair.h = $(PASST_REPAIR_SRCS) > > =20 > > passt: $(PASST_SRCS) $(HEADERS) > > - $(CC) $(FLAGS) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) $(PASST_SRCS) -= o passt $(LDFLAGS) > > + $(CC) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) $(PASST_SRCS) -o passt $= (LDFLAGS) > > =20 > > -passt.avx2: FLAGS +=3D -Ofast -mavx2 -ftree-vectorize -funroll-loops > > +passt.avx2: CFLAGS +=3D -Ofast -mavx2 -ftree-vectorize -funroll-loops > > passt.avx2: $(PASST_SRCS) $(HEADERS) > > - $(CC) $(filter-out -O2,$(FLAGS)) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAG= S) \ > > - $(PASST_SRCS) -o passt.avx2 $(LDFLAGS) > > + $(CC) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) $(PASST_SRCS) -o passt.a= vx2 $(LDFLAGS) > > =20 > > passt.avx2: passt > > =20 > > @@ -109,16 +108,16 @@ pasta.avx2 pasta.1 pasta: pasta%: passt% > > ln -sf $< $@ > > =20 > > qrap: $(QRAP_SRCS) passt.h > > - $(CC) $(FLAGS) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) -DARCH=3D\"$(TA= RGET_ARCH)\" $(QRAP_SRCS) -o qrap $(LDFLAGS) > > + $(CC) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) -DARCH=3D\"$(TARGET_ARCH= )\" $(QRAP_SRCS) -o qrap $(LDFLAGS) > > =20 > > passt-repair: $(PASST_REPAIR_SRCS) seccomp_repair.h > > - $(CC) $(FLAGS) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) $(PASST_REPAIR_= SRCS) -o passt-repair $(LDFLAGS) > > + $(CC) $(CFLAGS) $(BASE_CPPFLAGS) $(CPPFLAGS) $(PASST_REPAIR_SRCS) -o = passt-repair $(LDFLAGS) > > =20 > > valgrind: EXTRA_SYSCALLS +=3D rt_sigprocmask rt_sigtimedwait rt_sigact= ion \ > > rt_sigreturn getpid gettid kill clock_gettime \ > > mmap|mmap2 munmap open unlink gettimeofday futex \ > > statx readlink > > -valgrind: FLAGS +=3D -g > > +valgrind: CFLAGS +=3D -g > > valgrind: CPPFLAGS +=3D -DVALGRIND > > valgrind: all > > =20 > > diff --git a/test/build/build.py b/test/build/build.py > > index e3de8305..7c9cbb44 100755 > > --- a/test/build/build.py > > +++ b/test/build/build.py > > @@ -60,7 +60,7 @@ def test_make(target: str, expected_files: list[str])= -> None: > > with clone_sources(): > > for p in ex_paths: > > assert not p.exists(), f"{p} existed before make" > > - sh(f'make {target} CFLAGS=3D"-Werror"') > > + sh(f'make {target}') > > for p in ex_paths: > > assert p.exists(), f"{p} wasn't made" > > sh('make clean') > > @@ -90,7 +90,7 @@ def test_install_uninstall() -> None: > > progs =3D ['passt', 'pasta', 'qrap'] > > =20 > > # Install > > - sh(f'make install CFLAGS=3D"-Werror" prefix=3D{prefix}') > > + sh(f'make install prefix=3D{prefix}') >=20 > Here, and above: I don't understand what (if anything) implies -Werror > now. Ah, oops. I misread the -Werror in test/Makefile, thinking it was in Makefile and applied to everything. I think the right fix is to put -Werror in the default CFLAGS and remove it from here. --=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 --lDtaPDSwQ+u6aggX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmnxfzcACgkQzQJF27ox 2GdjZw//fsfHBG3KcOHA6QOcjc/a8WJP1sHjnbY+701xYFjlIDHKgmNiEdarz98i yxrvB2voubWOYv0U99gyCf9VECfjv/NvPRAkAcVsxYvQqyqwal7iCFowGVJZ9MDC QtuQZKKRLt64Lgg2qnNbbZ10qdOf1oxgbbnoD/0eTO4/m6caSceZBn6Ykoab4Af2 NU0F82SFbu6zS3Wg0iyzZZBdWFC+P7XPBAv7BUEecpIrzHmIOeVUKR/M29fm9dZ9 BIm2FrVeNNZF9F1SnvhtMXOy8bAD2UnhqG4pYjsAhmY/gokVoLQNXxRlgrK3zbi9 El7nAlcCjBgEpi7IdtPMbFj4eYKlUQk4Vbw8TDlUFRpyWi0s7Scx0RZcgQpY7+w/ m6+heMZXcCGChh5HOOh0roOzadEGPLcITW/orAWlGfBUQ7dKvkJ8Z6AqsWErX120 MoX84qUAmHovZ10R2Z0INNMFNmL9A3QLiNKDefV+MYFPi1/Yjt8N2BvwwFteRlr/ xeN9+ehyasw5v9l2ef9gBJwPdvKT0sCcR6S7z+PIM8GUlRZuMtgHmMog7i8zocZa prFXvlXfqAIuhABABjM+Ac5Ia8g30pBoo++HDN7JQ6RPbSgyqbdiRFQrXetFQovp K1P856ixaEvsKKrOEi77+b4MbLTQf4a4tUyEHJ67C8r4XXuE/Pc= =giH+ -----END PGP SIGNATURE----- --lDtaPDSwQ+u6aggX--