Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit 1ffd550

Browse files
authored
Merge pull request #119 from nathanchance/fix-x86-patch
patches: linux: x86_64: Fix passing of __BPF_TRACING__ to KBUILD_CFLAGS
2 parents a99c66f + 9c93aff commit 1ffd550

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

patches/linux/x86_64/x86-series.patch

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From a4b551d99e0124c144a8ed5c3796135589ecac16 Mon Sep 17 00:00:00 2001
1+
From e6676062c603d696e70b06041580c62ca364fd18 Mon Sep 17 00:00:00 2001
22
From: Nathan Chancellor <[email protected]>
33
Date: Sat, 5 Jan 2019 11:51:39 -0700
44
Subject: [PATCH 1/2] DO-NOT-UPSTREAM: x86: Revert two commits that break the
@@ -17,7 +17,7 @@ Signed-off-by: Nathan Chancellor <[email protected]>
1717
1 file changed, 42 insertions(+), 39 deletions(-)
1818

1919
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
20-
index a77445d1b034..a87ab5290ab4 100644
20+
index 780f2b42c8ef..122e42319acc 100644
2121
--- a/arch/x86/include/asm/uaccess.h
2222
+++ b/arch/x86/include/asm/uaccess.h
2323
@@ -186,14 +186,19 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
@@ -158,7 +158,7 @@ index a77445d1b034..a87ab5290ab4 100644
158158
2.20.1
159159

160160

161-
From a1ceb19fa6ab9383f9db276f465865f02ab76626 Mon Sep 17 00:00:00 2001
161+
From ebbb36f656831313b8ef5d75e864a0ab8bc83bc9 Mon Sep 17 00:00:00 2001
162162
From: Nathan Chancellor <[email protected]>
163163
Date: Tue, 25 Sep 2018 13:32:33 -0700
164164
Subject: [PATCH 2/2] DO-NOT-UPSTREAM: x86: Avoid warnings/errors due to lack
@@ -176,27 +176,40 @@ asm goto can be tracked at the below link.
176176
Link: https://github.com/ClangBuiltLinux/linux/issues/6
177177
Signed-off-by: Nathan Chancellor <[email protected]>
178178
---
179-
arch/x86/Makefile | 3 +--
179+
arch/x86/Makefile | 9 +++++----
180180
arch/x86/boot/compressed/Makefile | 3 +++
181181
drivers/firmware/efi/libstub/Makefile | 4 ++++
182-
3 files changed, 8 insertions(+), 2 deletions(-)
182+
3 files changed, 12 insertions(+), 4 deletions(-)
183183

184184
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
185-
index 9c5a67d1b9c1..a6ee6381f302 100644
185+
index 9c5a67d1b9c1..95baa56c2de0 100644
186186
--- a/arch/x86/Makefile
187187
+++ b/arch/x86/Makefile
188-
@@ -290,8 +290,7 @@ vdso_install:
188+
@@ -219,6 +219,11 @@ ifdef CONFIG_RETPOLINE
189+
KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
190+
endif
191+
192+
+# Avoid warnings in arch/x86/include/asm/cpufeature.h when building with Clang
193+
+ifndef CONFIG_CC_HAS_ASM_GOTO
194+
+ KBUILD_CFLAGS += -D__BPF_TRACING__
195+
+endif
196+
+
197+
archscripts: scripts_basic
198+
$(Q)$(MAKE) $(build)=arch/x86/tools relocs
199+
200+
@@ -289,10 +294,6 @@ vdso_install:
201+
189202
archprepare: checkbin
190203
checkbin:
191-
ifndef CONFIG_CC_HAS_ASM_GOTO
204+
-ifndef CONFIG_CC_HAS_ASM_GOTO
192205
- @echo Compiler lacks asm-goto support.
193206
- @exit 1
194-
+KBUILD_CFLAGS += -D__BPF_TRACING__
195-
endif
207+
-endif
196208
ifdef CONFIG_RETPOLINE
197209
ifeq ($(RETPOLINE_CFLAGS),)
210+
@echo "You are building kernel with non-retpoline compiler." >&2
198211
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
199-
index f0515ac895a4..d6e04a32b87f 100644
212+
index f0515ac895a4..24cca31995ae 100644
200213
--- a/arch/x86/boot/compressed/Makefile
201214
+++ b/arch/x86/boot/compressed/Makefile
202215
@@ -38,6 +38,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
@@ -210,7 +223,7 @@ index f0515ac895a4..d6e04a32b87f 100644
210223
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
211224
GCOV_PROFILE := n
212225
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
213-
index d9845099635e..0d2817edc8ab 100644
226+
index d9845099635e..68ff33dc075d 100644
214227
--- a/drivers/firmware/efi/libstub/Makefile
215228
+++ b/drivers/firmware/efi/libstub/Makefile
216229
@@ -24,6 +24,10 @@ cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \

0 commit comments

Comments
 (0)