Skip to content

Commit d5ad9aa

Browse files
brooniebonzini
authored andcommitted
selftests/rseq: Fix build with undefined __weak
Commit 3bcbc20 ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") which is now in Linus' tree introduced uses of __weak but did nothing to ensure that a definition is provided for it resulting in build failures for the rseq tests: rseq.c:41:1: error: unknown type name '__weak' __weak ptrdiff_t __rseq_offset; ^ rseq.c:41:17: error: expected ';' after top level declarator __weak ptrdiff_t __rseq_offset; ^ ; rseq.c:42:1: error: unknown type name '__weak' __weak unsigned int __rseq_size; ^ rseq.c:43:1: error: unknown type name '__weak' __weak unsigned int __rseq_flags; Fix this by using the definition from tools/include compiler.h. Fixes: 3bcbc20 ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+") Signed-off-by: Mark Brown <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 251199f commit d5ad9aa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tools/testing/selftests/rseq/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
44
CLANG_FLAGS += -no-integrated-as
55
endif
66

7+
top_srcdir = ../../../..
8+
79
CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \
8-
$(CLANG_FLAGS)
10+
$(CLANG_FLAGS) -I$(top_srcdir)/tools/include
911
LDLIBS += -lpthread -ldl
1012

1113
# Own dependencies because we only want to build against 1st prerequisite, but

tools/testing/selftests/rseq/rseq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <sys/auxv.h>
3232
#include <linux/auxvec.h>
3333

34+
#include <linux/compiler.h>
35+
3436
#include "../kselftest.h"
3537
#include "rseq.h"
3638

0 commit comments

Comments
 (0)