Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define _GNU_SOURCE for sources using #976

Closed
wants to merge 5 commits into from

Conversation

bjoto
Copy link

@bjoto bjoto commented May 7, 2024

Pull request for series with
subject: Define _GNU_SOURCE for sources using
version: 2
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=851358

@bjoto
Copy link
Author

bjoto commented May 7, 2024

Upstream branch: 0a16a17
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=851358
version: 2

edliaw added 5 commits May 8, 2024 01:09
Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a
central location.

8092162 ("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.

Fixes: 8092162 ("selftests/harness: remove use of LINE_MAX")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com
Signed-off-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Add KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness
dependencies (-D_GNU_SOURCE).

Also, remove redefinitions of _GNU_SOURCE in the source code.

Fixes: 8092162 ("selftests/harness: remove use of LINE_MAX")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com
Signed-off-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Add KHDR_INCLUDES to CFLAGS to pull in the kselftest harness
dependencies (-D_GNU_SOURCE).

Fixes: 8092162 ("selftests/harness: remove use of LINE_MAX")
Signed-off-by: Edward Liaw <edliaw@google.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
_GNU_SOURCE is provided by KHDR_INCLUDES, so it should be dropped to
prevent _GNU_SOURCE redefined warnings.

Fixes: 8092162 ("selftests/harness: remove use of LINE_MAX")
Signed-off-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
-D_GNU_SOURCE can be de-duplicated here, as it is added by
KHDR_INCLUDES.

Signed-off-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
@bjoto
Copy link
Author

bjoto commented May 8, 2024

Upstream branch: 0a16a17
series: https://patchwork.kernel.org/project/linux-riscv/list/?series=851358
version: 2

@bjoto bjoto force-pushed the series/851358=>for-next branch from aba586c to 1d929e6 Compare May 8, 2024 01:09
@bjoto bjoto closed this May 9, 2024
@bjoto bjoto deleted the series/851358=>for-next branch May 14, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants