Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY78s-000opH-8t for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Aug 2023 15:48:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qY78p-007sES-1b for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Aug 2023 15:48:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY78o-007sE8-K6 for pgsql-hackers@lists.postgresql.org; Mon, 21 Aug 2023 15:48:30 +0000 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qY78k-000C7B-8Y for pgsql-hackers@lists.postgresql.org; Mon, 21 Aug 2023 15:48:29 +0000 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6bd6a34474cso2612546a34.3 for ; Mon, 21 Aug 2023 08:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1692632904; x=1693237704; h=in-reply-to:references:cc:from:to:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jKvVu7VtHxIP3a7JcoOwh1aZKkdVSGj8bXG8tHrBQLQ=; b=AfIVzzdvcqO0Bo9TQxvFCWuhTW3TcBqs1lVFhQhm8hG7c9olRC/FDB43EcAz4MMfwn eK0fjZ8Uh9BAlJoatTjofhSi31QPnvhgb0NeswzI3aPgSDUd769Wei3lmZhVJnbTla75 ctjJWX/VAIsqp/vCoyoe1UM6XKavrp6e+0sl8SUs2JN3pvlF71ABtMBFJXdnS9OKSOnO aHZRDEx6/h3Rheci3osCMy2XnPXW5JTmbKSjXRRMYQzMk6BbwWTXg9gC70nF7ecE+gCD gJ5AY/ogLgCrMVz1ivkr9hEkIzan8paDky73UXd6jgAjebCtWFDH4rHrxJgUwM8fsvM9 S44A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692632904; x=1693237704; h=in-reply-to:references:cc:from:to:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jKvVu7VtHxIP3a7JcoOwh1aZKkdVSGj8bXG8tHrBQLQ=; b=hiVxvWOhAOp+BL23zrs3gtA4/6pvvMuBPBBgzpR81QSQSMbV/0qKLCPWnCiR1Sm3Up Njb5FGyIpZfYbb3uscdRO7AXlfo72tmWDM1aMzL3Rg65XofwWOn75wKZGxxxLIbvme/6 oylohUlUgxH/lho23laimhmRtVwkOEeEFMDXvjZR6lUoOqXY0sBl0u/8zW4VKuBDUVxv 3PhzBiOsQbKMcHa52Ls88OONl16IzGIG1E0qpu0/z0CVkBOSqucS9AUs1xHvS9OVbWKv PiJgDnNGqWzpU8Dxc3URzm7TokxPUHM+9NuBEfA3TOE90UcaJKzivMPlpHokkekO/jz4 +wLg== X-Gm-Message-State: AOJu0YxP6WcV84ffGzO/JawVBzU8AUv2raAod5G76vNrwuvjV3goltPQ ZSqkW/83w/guBZLPwdNX7DYrgB10bQ8k80M/UMM= X-Google-Smtp-Source: AGHT+IEVyVwS8swVnbOsIvfyMpPkTny/BgGFlGOBJNcToi3ZI5q6kQaZHXnHnW4tBfr3G1fj7elkjg== X-Received: by 2002:a05:6870:6124:b0:1b0:1e3b:5c21 with SMTP id s36-20020a056870612400b001b01e3b5c21mr9768254oae.1.1692632904330; Mon, 21 Aug 2023 08:48:24 -0700 (PDT) Received: from localhost ([2607:fb90:e631:422:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id s36-20020a05687050e400b001cc970f3b00sm604617oaf.50.2023.08.21.08.48.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Aug 2023 08:48:23 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Mon, 21 Aug 2023 10:48:23 -0500 Message-Id: Subject: Re: meson: pgxs Makefile.global differences To: "Andrew Dunstan" , "Andres Freund" From: "Tristan Partin" Cc: "PostgreSQL Hackers" X-Mailer: aerc 0.15.2-131-ga5d6a70f440f References: <61d629b6-d5ad-a49e-e905-b66d3ac4903a@dunslane.net> <20230817205142.lkinsfndjabpdejv@alap3.anarazel.de> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon Aug 21, 2023 at 10:33 AM CDT, Andrew Dunstan wrote: > > On 2023-08-17 Th 16:51, Andres Freund wrote: > > Hi, > > > > On 2023-08-17 14:45:54 -0500, Tristan Partin wrote: > >> On Thu Aug 17, 2023 at 2:32 PM CDT, Andrew Dunstan wrote: > >>> I started digging into a warning I noticed on my FDW builds where > >>> Postgres is built with meson, e.g. > >>> which has this: > >>> > >>> cc1: warning: =E2=80=98-Wformat-security=E2=80=99 ignored without =E2= =80=98-Wformat=E2=80=99 > >>> [-Wformat-security] > >>> > >>> I found that the pgxs Makefile.global built under meson is a bit > >>> different. On debug builds for both this is what I get on HEAD (meson= ) > >>> and REL_15_STABLE (autoconf), stripped of the current components: > > I assume "current" means the flags that are present in both cases? > > > > > >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 HEAD: CFLAGS =3D-W= shadow=3Dcompatible-local > >>> REL_15_STABLE: CFLAGS =3D-Wall=C2=A0 -g > >>> > >>> The warning is apparently due to the missing -Wall. > >>> > >>> Shouldn't we be aiming for pretty much identical settings? > > The difference for -Wshadow=3Dcompatible-local is due to changes betwee= n 15 and > > HEAD. > > > > We're indeed not adding -Wall right now (the warning level is handled b= y > > meson, so it doesn't show up in our cflags right now). > > > > > >> I agree that they should be identical. The meson bild should definitel= y be > >> aiming for 100% compatibility for the Makefile.global. > > I don't think that's feasible. It was a fair bit of work to get the mos= t > > important contents to match, while skipping lots of things that are pri= marily > > relevant for building the server (which isn't relevant for pgxs). > > > > That said, in this specific case, I agree, we should likely emit -Wall = to > > Makefile.global in meson as well. > > > > Where should we do that? And how about the -g that's also missing for=20 > debug-enabled builds? Look in src/makefiles/meson.build. You will see a line like 'CFLAGS': var_cflags. You probably want to do something like: pgxs_cflags =3D var_cflags + cc.get_supported_arguments('-Wxxx') if get_option('debug') # Populate for debug flags that aren't -g debug_flags =3D {} pgxs_cflags +=3D debug_flags.get(cc.get_id(),=20 cc.get_supported_arguments('-g') endif ... CFLAGS: pgxs_cflags, ... --=20 Tristan Partin Neon (https://neon.tech)