Skip to content

Commit

Permalink
Merge tag 'linux_kselftest-next-6.10-rc1-fixes' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "Revert framework change to add D_GNU_SOURCE to KHDR_INCLUDES to
  Makefile, lib.mk, and kselftest_harness.h and follow-on changes to
  cgroup and sgx test as they are causing build failures and warnings"

* tag 'linux_kselftest-next-6.10-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  Revert "selftests/cgroup: Drop define _GNU_SOURCE"
  Revert "selftests/sgx: Include KHDR_INCLUDES in Makefile"
  Revert "selftests: Compile kselftest headers with -D_GNU_SOURCE"
  • Loading branch information
torvalds committed May 20, 2024
2 parents 72ece20 + a97853f commit 70ec81c
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),)
# $(realpath ...) resolves symlinks
abs_objtree := $(realpath $(abs_objtree))
BUILD := $(abs_objtree)/kselftest
KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include
KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
else
BUILD := $(CURDIR)
abs_srctree := $(shell cd $(top_srcdir) && pwd)
KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include
KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
DEFAULT_INSTALL_HDR_PATH := 1
endif

Expand Down
3 changes: 3 additions & 0 deletions tools/testing/selftests/cgroup/cgroup_util.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */

#define _GNU_SOURCE

#include <errno.h>
#include <fcntl.h>
#include <linux/limits.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_core.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */

#define _GNU_SOURCE
#include <linux/limits.h>
#include <linux/sched.h>
#include <sys/types.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_cpu.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0

#define _GNU_SOURCE
#include <linux/limits.h>
#include <sys/sysinfo.h>
#include <sys/wait.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_hugetlb_memcg.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE

#include <linux/limits.h>
#include <sys/mman.h>
#include <stdio.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_kmem.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE

#include <linux/limits.h>
#include <fcntl.h>
#include <stdio.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_memcontrol.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */
#define _GNU_SOURCE

#include <linux/limits.h>
#include <linux/oom.h>
#include <fcntl.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/cgroup/test_zswap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE

#include <linux/limits.h>
#include <unistd.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/kselftest_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#define __KSELFTEST_HARNESS_H

#ifndef _GNU_SOURCE
static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined");
#define _GNU_SOURCE
#endif
#include <asm/types.h>
#include <ctype.h>
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory
endif

ifeq ($(KHDR_INCLUDES),)
KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include
KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
endif

# In order to use newer items that haven't yet been added to the user's system
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/selftests/sgx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
endif

INCLUDES := -I$(top_srcdir)/tools/include
HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC
HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC
HOST_LDFLAGS := -z noexecstack -lcrypto
ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \
-fno-stack-protector -mrdrnd $(INCLUDES)
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/sgx/sigstruct.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2016-20 Intel Corporation. */

#define _GNU_SOURCE
#include <assert.h>
#include <getopt.h>
#include <stdbool.h>
Expand Down

0 comments on commit 70ec81c

Please sign in to comment.