From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J9GiF9eI; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 5ED295A026D for ; Sat, 16 May 2026 17:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778946365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cZTgkaDDlS2f6YxKraNATBlVihWTP0lVZSXsN16rkB8=; b=J9GiF9eI2pYu+sjyVq5q7Z9B273d5NAlmYUhoUIwm32XrIjANH//g62e9NUt1U6K/+za21 qAmzESXeebhH3F3fOr+Cc924nCQm2cTTTI6JG3PU3Mx6KJjk+BgbCL2ZTp/VxqJDNPmYKq OGouqrkeHTgv2PEmE8r4WEJG9cAStqs= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-627--Y7QwhXIMKC9iAdJkiebxA-1; Sat, 16 May 2026 11:46:03 -0400 X-MC-Unique: -Y7QwhXIMKC9iAdJkiebxA-1 X-Mimecast-MFC-AGG-ID: -Y7QwhXIMKC9iAdJkiebxA_1778946362 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48fd3dbd16aso6242995e9.0 for ; Sat, 16 May 2026 08:46:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778946362; x=1779551162; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cZTgkaDDlS2f6YxKraNATBlVihWTP0lVZSXsN16rkB8=; b=G0aHVS8BjA+EB03Dg/YNBgaB8gzSiI5I4ejeihOcJ565N/o+WQO5g/vaza05aX8Jb6 yr7ijM9CZ1GBBp/vm02umrTjH3WvArdtmccJl2v1cCALsMewUg6nywqVPmb8qVBVORTm zb3e8cZgod8WAwry96fQH8w2C+MLaFgGHoBjfNu1MlTTNBx0eQKbH1HbNchP8u6LS1fK G2HkhqsGz5VyVO/5J5stn+L1i7gGD5SRosgKApIDzbq2l5pnQdKeCUKa9ryYxqh6wih2 xPua2/FnHaUOKJ6a6/WqGpQSk5bq+VZDZdN7hNm6ACPXL3A/jA8mC29X2hCkP3AhpBit Da7g== X-Gm-Message-State: AOJu0YxFPW2uOlIXJeyyF+O6BTEdy63Eny+CcCTX5QiJaVUIELShZnmw FEFYFuRfUVKgEhmkxof5ywQ9aEnm0jE+9A8rEobtJNwDn+uqb7WH2FjHKtfXloEMkFV2+PT9xQP qaC2wVOV6VxJPkDSFgQDpLBKxVP7uryDPf42La5ETDMzq8/aQZ+o4W4+tv0wqQw== X-Gm-Gg: Acq92OG9S2vfY/rbZYBw0FlvtTJlO4SS014ug2zwZd9utcE8X8gzdMAND0yji6azKAQ xfJbB8zywwIqjBYJhxObyWykOVFyUatQyrH5ufMezu+R5HUi0Ofo76711JZy3I4I9wLgwkSkFRT f2Y/cs4+3Ri05aClvUOWwReCKwZJbt4oE7hoIYdeKjzkbtxN50uzXVqtCGIF3qT1y2W4i/aVjNZ 6vMLcQsHIkyEYTlghgc3JdsRDPEcaT5uiYiBZIafpQLUobwRPOO56TIgawCrCCq+6XivyPup+vO wgI0OAzqESrc2Nasgmfw2Syzj9XMTRNFcdK8ttiOTCTtMJJnwEp5ISjuWagP2YhQdVfEZjVZAyj qW2yCu31IEIYFARWSbIM+bVq5uoeTssG8a/SzfSfFTChA5NrbcA== X-Received: by 2002:a05:600d:8496:20b0:48f:f7cc:f6f5 with SMTP id 5b1f17b1804b1-48ff7ccf76bmr22726365e9.31.1778946361795; Sat, 16 May 2026 08:46:01 -0700 (PDT) X-Received: by 2002:a05:600d:8496:20b0:48f:f7cc:f6f5 with SMTP id 5b1f17b1804b1-48ff7ccf76bmr22726105e9.31.1778946361281; Sat, 16 May 2026 08:46:01 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48febe78aadsm38231635e9.29.2026.05.16.08.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 May 2026 08:45:59 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v3 06/12] Makefile: Split $(FLAGS) into cpp and cc components Message-ID: <20260516174553.5d4e8278@elisabeth> In-Reply-To: <20260512055256.1800449-7-david@gibson.dropbear.id.au> References: <20260512055256.1800449-1-david@gibson.dropbear.id.au> <20260512055256.1800449-7-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sat, 16 May 2026 17:45:54 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: hrMR7qyer7BR9MMIZtcGqwTIepUGeOHYmxe78fG4UUE_1778946362 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Y2TOBOTRP27G4RY6YWB5A2BBBDYJPTYN X-Message-ID-Hash: Y2TOBOTRP27G4RY6YWB5A2BBBDYJPTYN X-MailFrom: sbrivio@redhat.com 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: On Tue, 12 May 2026 15:52:50 +1000 David Gibson wrote: > The $(FLAGS) variable contains mandatory compiler flags that should not be > overridden. However, it contains a mixture of flags for the preprocessor > and for the compiler proper. That's causing some inconvenience for other > Makefile cleanups, so split it into $(BASE_CPPFLAGS) and $(BASE_CFLAGS) > variables. > > Signed-off-by: David Gibson > --- > Makefile | 40 ++++++++++++++++++++++++---------------- > 1 file changed, 24 insertions(+), 16 deletions(-) > > 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 := -D_FORTIFY_SOURCE=2 > endif > > -FLAGS := -Wall -Wextra -Wno-format-zero-length -Wformat-security > -FLAGS += -pedantic -std=c11 -D_XOPEN_SOURCE=700 -D_GNU_SOURCE > -FLAGS += $(FORTIFY_FLAG) -O2 -pie -fPIE > -FLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE) > -FLAGS += -DVERSION=\"$(VERSION)\" > -FLAGS += -DDUAL_STACK_SOCKETS=$(DUAL_STACK_SOCKETS) > +# Mandatory preprocessor flags that won't be overridden with $(CPPFLAGS) > +# FIXME: Could some of these be default, rather than required? > +BASE_CPPFLAGS := -D_XOPEN_SOURCE=700 -D_GNU_SOURCE $(FORTIFY_FLAG) > +BASE_CPPFLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE) > +BASE_CPPFLAGS += -DVERSION=\"$(VERSION)\" > +BASE_CPPFLAGS += -DDUAL_STACK_SOCKETS=$(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 := -std=c11 -pie -fPIE -O2 > +BASE_CFLAGS += -pedantic -Wall -Wextra -Wno-format-zero-length -Wformat-security > > PASST_SRCS = 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 = linux_dep.h > > C := \#include \nint main(){int a=getrandom(0, 0, 0);} > ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0) > - FLAGS += -DHAS_GETRANDOM > + BASE_CPPFLAGS += -DHAS_GETRANDOM > endif > > ifeq ($(shell :|$(CC) -fstack-protector-strong -S -xc - -o - >/dev/null 2>&1; echo $$?),0) > - FLAGS += -fstack-protector-strong > + BASE_CFLAGS += -fstack-protector-strong > endif > > prefix ?= /usr/local > @@ -89,7 +94,8 @@ endif > > all: $(BIN) $(MANPAGES) docs > > -static: FLAGS += -static -DGLIBC_NO_STATIC_NSS > +static: BASE_CPPFLAGS += -DGLIBC_NO_STATIC_NSS > +static: BASE_CFLAGS += -static Trailing whitespace I fixed up on merge. -- Stefano