Message ID | 20240510000842.410729-1-edliaw@google.com |
---|---|
Headers | show |
Series | Define _GNU_SOURCE for sources using | expand |
Hi Edward, On 2024-05-10 00:06:54+0000, Edward Liaw wrote: > _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent > redefinition warnings. The nolibc tests do not use lib.mk. This change breaks "make libc-test", please drop it. > Signed-off-by: Edward Liaw <edliaw@google.com> > --- > tools/testing/selftests/nolibc/nolibc-test.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > index 94bb6e11c16f..a28813f4367f 100644 > --- a/tools/testing/selftests/nolibc/nolibc-test.c > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > @@ -1,6 +1,4 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > - > -#define _GNU_SOURCE > #define _LARGEFILE64_SOURCE > > /* libc-specific include files > -- > 2.45.0.118.g7fe29c98d7-goog Thomas
On Fri, May 10, 2024 at 12:06:30AM +0000, Edward Liaw wrote: > -D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk. > > Signed-off-by: Edward Liaw <edliaw@google.com> Thanks! Acked-by: Kees Cook <keescook@chromium.org>
On Fri, May 10, 2024 at 12:07:12AM +0000, Edward Liaw wrote: > _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent > redefinition warnings. > > Reviewed-by: John Hubbard <jhubbard@nvidia.com> > Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> > Signed-off-by: Edward Liaw <edliaw@google.com> Acked-by: Kees Cook <keescook@chromium.org>
On 5/9/24 18:06, Edward Liaw wrote: > Centralizes the definition of _GNU_SOURCE into KHDR_INCLUDES and removes > redefinitions of _GNU_SOURCE from source code. > > 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. > > v1: https://lore.kernel.org/linux-kselftest/20240430235057.1351993-1-edliaw@google.com/ > v2: https://lore.kernel.org/linux-kselftest/20240507214254.2787305-1-edliaw@google.com/ > - Add -D_GNU_SOURCE to KHDR_INCLUDES so that it is in a single > location. > - Remove #define _GNU_SOURCE from source code to resolve redefinition > warnings. > v3: https://lore.kernel.org/linux-kselftest/20240509200022.253089-1-edliaw@google.com/ > - Rebase onto linux-next 20240508. > - Split patches by directory. > - Add -D_GNU_SOURCE directly to CFLAGS in lib.mk. > - Delete additional _GNU_SOURCE definitions from source code in > linux-next. > - Delete additional -D_GNU_SOURCE flags from Makefiles. > v4: > - Rebase onto linux-next 20240509. > - Remove Fixes tag from patches that drop _GNU_SOURCE definition. > - Restore space between comment and includes for selftests/damon. > > Edward Liaw (66): > selftests: Compile with -D_GNU_SOURCE when including lib.mk This above change is causing some build problems - I didn't notice them when I tested on linux-next. However some problems are seen by Mark. He sent in a fix for ALSA and a change to descalate build warn. Please don't apply these for 6.10 for now. I will take all of these together. thanks, -- Shuah