From: Kees Cook <keescook@chromium.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Mark Brown <broonie@kernel.org>, Edward Liaw <edliaw@google.com>,
shuah@kernel.org, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Bongsu Jeon <bongsu.jeon@samsung.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Muhammad Usama Anjum <usama.anjum@collabora.com>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kernel-team@android.com, linux-sound@vger.kernel.org,
linux-input@vger.kernel.org, kvm@vger.kernel.org,
netdev@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-sgx@vger.kernel.org
Subject: Re: [PATCH v1 00/10] Define _GNU_SOURCE for sources using
Date: Thu, 2 May 2024 15:41:00 -0700 [thread overview]
Message-ID: <202405021540.3FF73DF47@keescook> (raw)
In-Reply-To: <ZjJClMYEIyGEo37e@google.com>
On Wed, May 01, 2024 at 06:24:36AM -0700, Sean Christopherson wrote:
> On Wed, May 01, 2024, Mark Brown wrote:
> > On Tue, Apr 30, 2024 at 11:50:09PM +0000, Edward Liaw wrote:
> > > 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced
> > > asprintf into kselftest_harness.h, which is a GNU extension and needs
> > > _GNU_SOURCE to either be defined prior to including headers or with the
> > > -D_GNU_SOURCE flag passed to the compiler.
> >
> > This seems like something that should be handled centrally rather than
> > having to go round and audit the users every time some update is made.
>
> +1.
>
> And if for some reason unilaterally defining _GNU_SOURCE in
> tools/testing/selftests/lib.mk isn't an option, we should at least have
> kselftest_harness.h assert instead of making a futile attempt to provide its own
> definition, e.g.
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 4fd735e48ee7..6741b4f20f25 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -51,7 +51,7 @@
> #define __KSELFTEST_HARNESS_H
>
> #ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> +static_assert(0, "Using the kselftests harness requires building with _GNU_SOURCE");
> #endif
> #include <asm/types.h>
> #include <ctype.h>
Yeah, let's fix centrally. I like this approach.
--
Kees Cook
prev parent reply other threads:[~2024-05-02 22:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 23:50 [PATCH v1 00/10] Define _GNU_SOURCE for sources using Edward Liaw
2024-04-30 23:50 ` [PATCH v1 01/10] selftests/sgx: Compile with -D_GNU_SOURCE Edward Liaw
2024-05-03 1:46 ` Jarkko Sakkinen
2024-04-30 23:50 ` [PATCH v1 02/10] selftests/alsa: " Edward Liaw
2024-04-30 23:50 ` [PATCH v1 03/10] selftests/hid: " Edward Liaw
2024-04-30 23:50 ` [PATCH v1 04/10] selftests/kvm: Define _GNU_SOURCE Edward Liaw
2024-05-01 13:26 ` Sean Christopherson
2024-04-30 23:50 ` [PATCH v1 05/10] selftests/nci: Compile with -D_GNU_SOURCE Edward Liaw
2024-04-30 23:50 ` [PATCH v1 06/10] selftests/net: Define _GNU_SOURCE Edward Liaw
2024-04-30 23:50 ` [PATCH v1 07/10] selftests/prctl: Compile with -D_GNU_SOURCE Edward Liaw
2024-04-30 23:50 ` [PATCH v1 08/10] selftests/rtc: " Edward Liaw
2024-04-30 23:50 ` [PATCH v1 09/10] selftests/tdx: " Edward Liaw
2024-04-30 23:50 ` [PATCH v1 10/10] selftests/user_events: Compiled " Edward Liaw
2024-05-01 1:59 ` [PATCH v1 00/10] Define _GNU_SOURCE for sources using Mark Brown
2024-05-01 5:40 ` Muhammad Usama Anjum
2024-05-07 17:53 ` Edward Liaw
2024-05-01 13:24 ` Sean Christopherson
2024-05-02 22:41 ` Kees Cook [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202405021540.3FF73DF47@keescook \
--to=keescook@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=alexandre.belloni@bootlin.com \
--cc=bentiss@kernel.org \
--cc=bongsu.jeon@samsung.com \
--cc=broonie@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edliaw@google.com \
--cc=edumazet@google.com \
--cc=jarkko@kernel.org \
--cc=jikos@kernel.org \
--cc=kernel-team@android.com \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pbonzini@redhat.com \
--cc=perex@perex.cz \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=tiwai@suse.com \
--cc=usama.anjum@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).