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

Commit fae1165

Browse files
authored
Merge pull request #170 from nathanchance/fix-4.19
patches: 4.19: x86_64: Update after 4.19.48 release
2 parents e42dfd6 + 9b03e2a commit fae1165

File tree

2 files changed

+35
-100
lines changed

2 files changed

+35
-100
lines changed
Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,82 @@
1-
From 28e98de6638031d0ab539469ab0387a95f2d3316 Mon Sep 17 00:00:00 2001
1+
From f5de4c534f03c9d8c81bd35aac8512a5396378a7 Mon Sep 17 00:00:00 2001
22
From: Nathan Chancellor <[email protected]>
33
Date: Tue, 25 Sep 2018 13:32:33 -0700
44
Subject: [PATCH] DO-NOT-UPSTREAM: x86: Avoid warnings/errors due to lack of
55
asm goto
66

7-
This isn't strictly required right now and it prevents us from building
8-
with Clang. It's supposedly in the works though, progress can be tracked
9-
below.
7+
We don't want to see an inordinate amount of warning spam from
8+
the BPF samples and after reverting commits 4a789213c9a5 ("x86
9+
uaccess: Introduce __put_user_goto") and a959dc88f9c8 ("Use
10+
__put_user_goto in __put_user_size() and unsafe_put_user()"), we
11+
can successfully compile an x86 kernel with Clang.
12+
13+
This is obviously not a long term solution. LLVM/Clang support for
14+
asm goto can be tracked at the below link.
1015

1116
Link: https://github.com/ClangBuiltLinux/linux/issues/6
1217
Signed-off-by: Nathan Chancellor <[email protected]>
1318
---
14-
arch/x86/Makefile | 3 +--
19+
arch/x86/Makefile | 9 +++++----
1520
arch/x86/boot/compressed/Makefile | 3 +++
1621
drivers/firmware/efi/libstub/Makefile | 4 ++++
17-
3 files changed, 8 insertions(+), 2 deletions(-)
22+
3 files changed, 12 insertions(+), 4 deletions(-)
1823

1924
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
20-
index 75ef499a66e2..bb705df20a68 100644
25+
index ce0d0424a53d..094a0f11c943 100644
2126
--- a/arch/x86/Makefile
2227
+++ b/arch/x86/Makefile
23-
@@ -301,8 +301,7 @@ vdso_install:
28+
@@ -235,6 +235,11 @@ ifdef CONFIG_RETPOLINE
29+
endif
30+
endif
31+
32+
+# Avoid warnings in arch/x86/include/asm/cpufeature.h when building with Clang
33+
+ifndef CONFIG_CC_HAS_ASM_GOTO
34+
+ KBUILD_CFLAGS += -D__BPF_TRACING__
35+
+endif
36+
+
37+
archscripts: scripts_basic
38+
$(Q)$(MAKE) $(build)=arch/x86/tools relocs
39+
40+
@@ -305,10 +310,6 @@ vdso_install:
41+
2442
archprepare: checkbin
2543
checkbin:
26-
ifndef CC_HAVE_ASM_GOTO
44+
-ifndef CONFIG_CC_HAS_ASM_GOTO
2745
- @echo Compiler lacks asm-goto support.
2846
- @exit 1
29-
+KBUILD_CFLAGS += -D__BPF_TRACING__
30-
endif
47+
-endif
3148
ifdef CONFIG_RETPOLINE
3249
ifeq ($(RETPOLINE_CFLAGS),)
50+
@echo "You are building kernel with non-retpoline compiler." >&2
3351
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
34-
index 466f66c8a7f8..deb2a7fef08c 100644
52+
index 466f66c8a7f8..000bd188beb0 100644
3553
--- a/arch/x86/boot/compressed/Makefile
3654
+++ b/arch/x86/boot/compressed/Makefile
3755
@@ -38,6 +38,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
3856
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
3957
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
4058
KBUILD_CFLAGS += -Wno-pointer-sign
41-
+ifndef CC_HAVE_ASM_GOTO
59+
+ifndef CONFIG_CC_HAS_ASM_GOTO
4260
+KBUILD_CFLAGS += -D__BPF_TRACING__
4361
+endif
4462

4563
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
4664
GCOV_PROFILE := n
4765
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
48-
index c51627660dbb..167572144766 100644
66+
index d9845099635e..68ff33dc075d 100644
4967
--- a/drivers/firmware/efi/libstub/Makefile
5068
+++ b/drivers/firmware/efi/libstub/Makefile
51-
@@ -21,6 +21,10 @@ cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
69+
@@ -24,6 +24,10 @@ cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
5270

5371
cflags-$(CONFIG_EFI_ARMSTUB) += -I$(srctree)/scripts/dtc/libfdt
5472

55-
+ifndef CC_HAVE_ASM_GOTO
73+
+ifndef CONFIG_CC_HAS_ASM_GOTO
5674
+cflags-$(CONFIG_X86) += -D__BPF_TRACING__
5775
+endif
5876
+
5977
KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \
6078
-D__NO_FORTIFY \
6179
$(call cc-option,-ffreestanding) \
6280
--
63-
2.20.0
81+
2.22.0.rc3
6482

patches/4.19/x86_64/0002-compiler.h-give-up-__compiletime_assert_fallback.patch

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)