Commit 1c2fa742 authored by Sophie Brun's avatar Sophie Brun

Import a Debian commit to fix arm issues...

Import a Debian commit to fix arm issues (https://salsa.debian.org/benh/linux/commit/d06731909d9ffa86cce1bb98c8b176d07ecfe9c8)
parent e6d0258f
......@@ -341,6 +341,7 @@ class Gencontrol(Base):
('kernel-arch', 'KERNEL_ARCH', False),
('cflags', 'KCFLAGS', True),
('override-host-type', 'OVERRIDE_HOST_TYPE', True),
('cross-compile-compat', 'CROSS_COMPILE_COMPAT', True),
)
flavour_makeflags_build = (
......
linux (5.3.7-1kali2) kali-experimental; urgency=medium
* Import a Debian commit to fix arm issues
(https://salsa.debian.org/benh/linux/commit/d06731909d9ffa86cce1bb98c8b176d07ecfe9c8)
-- Sophie Brun <[email protected]> Mon, 04 Nov 2019 17:01:31 +0100
linux (5.3.7-1kali1) kali-experimental; urgency=medium
* Sync With Debian
......@@ -15,6 +15,7 @@ CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_XEN=y
CONFIG_COMPAT=y
CONFIG_COMPAT_VDSO=y
CONFIG_ARMV8_DEPRECATED=y
CONFIG_SWP_EMULATION=y
CONFIG_CP15_BARRIER_EMULATION=y
......@@ -1281,11 +1282,6 @@ CONFIG_CMA_SIZE_MBYTES=64
##
CONFIG_ENERGY_MODEL=y
##
## file: lib/vdso/Kconfig
##
CONFIG_CROSS_COMPILE_COMPAT_VDSO="arm-linux-gnueabihf-"
##
## file: mm/Kconfig
##
......
[base]
cross-compile-compat: arm-linux-gnueabihf-
kernel-arch: arm64
featuresets:
none
......
From: Will Deacon <[email protected]>
Date: Mon, 7 Oct 2019 13:03:12 +0100
Subject: arm64: Kconfig: Make CONFIG_COMPAT_VDSO a proper Kconfig option
Origin: https://git.kernel.org/linus/7c4791c9efca8c105a86022f7d5532aeaa819125
Bug-Debian: https://bugs.debian.org/943953
CONFIG_COMPAT_VDSO is defined by passing '-DCONFIG_COMPAT_VDSO' to the
compiler when the generic compat vDSO code is in use. It's much cleaner
and simpler to expose this as a proper Kconfig option (like x86 does),
so do that and remove the bodge.
Acked-by: Catalin Marinas <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
[bwh: Backported to 5.3: adjust context]
---
arch/arm64/Kconfig | 15 +++++++++++++--
arch/arm64/Makefile | 5 -----
2 files changed, 13 insertions(+), 7 deletions(-)
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -111,7 +111,6 @@ config ARM64
select GENERIC_STRNLEN_USER
select GENERIC_TIME_VSYSCALL
select GENERIC_GETTIMEOFDAY
- select GENERIC_COMPAT_VDSO if (!CPU_BIG_ENDIAN && COMPAT && "$(CROSS_COMPILE_COMPAT)" != "")
select HANDLE_DOMAIN_IRQ
select HARDIRQS_SW_RESEND
select HAVE_PCI
@@ -1132,7 +1131,7 @@ menuconfig COMPAT
if COMPAT
config KUSER_HELPERS
- bool "Enable kuser helpers page for 32 bit applications"
+ bool "Enable kuser helpers page for 32-bit applications"
default y
help
Warning: disabling this option may break 32-bit user programs.
@@ -1158,6 +1157,18 @@ config KUSER_HELPERS
Say N here only if you are absolutely certain that you do not
need these helpers; otherwise, the safe option is to say Y.
+config COMPAT_VDSO
+ bool "Enable vDSO for 32-bit applications"
+ depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
+ select GENERIC_COMPAT_VDSO
+ default y
+ help
+ Place in the process address space of 32-bit applications an
+ ELF shared object providing fast implementations of gettimeofday
+ and clock_gettime.
+
+ You must have a 32-bit build of glibc 2.22 or later for programs
+ to seamlessly take advantage of this.
menuconfig ARMV8_DEPRECATED
bool "Emulate deprecated/obsolete ARMv8 instructions"
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -50,11 +50,6 @@ endif
COMPATCC ?= $(CROSS_COMPILE_COMPAT)gcc
export COMPATCC
-ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)
- export CONFIG_COMPAT_VDSO := y
- compat_vdso := -DCONFIG_COMPAT_VDSO=1
-endif
-
KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) $(compat_vdso)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
From: Vincenzo Frascino <[email protected]>
Date: Thu, 3 Oct 2019 18:48:33 +0100
Subject: arm64: vdso32: Fix broken compat vDSO build warnings
Origin: https://git.kernel.org/linus/e0de01aafc3dd7b73308106b056ead2d48391905
Bug-Debian: https://bugs.debian.org/943953
The .config file and the generated include/config/auto.conf can
end up out of sync after a set of commands since
CONFIG_CROSS_COMPILE_COMPAT_VDSO is not updated correctly.
The sequence can be reproduced as follows:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
[...]
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
[set CONFIG_CROSS_COMPILE_COMPAT_VDSO="arm-linux-gnueabihf-"]
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
Which results in:
arch/arm64/Makefile:62: CROSS_COMPILE_COMPAT not defined or empty,
the compat vDSO will not be built
even though the compat vDSO has been built:
$ file arch/arm64/kernel/vdso32/vdso.so
arch/arm64/kernel/vdso32/vdso.so: ELF 32-bit LSB pie executable, ARM,
EABI5 version 1 (SYSV), dynamically linked,
BuildID[sha1]=c67f6c786f2d2d6f86c71f708595594aa25247f6, stripped
A similar case that involves changing the configuration parameter
multiple times can be reconducted to the same family of problems.
Remove the use of CONFIG_CROSS_COMPILE_COMPAT_VDSO altogether and
instead rely on the cross-compiler prefix coming from the environment
via CROSS_COMPILE_COMPAT, much like we do for the rest of the kernel.
Cc: Will Deacon <[email protected]>
Cc: Catalin Marinas <[email protected]>
Reported-by: Will Deacon <[email protected]>
Signed-off-by: Vincenzo Frascino <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
---
arch/arm64/Kconfig | 2 +-
arch/arm64/Makefile | 18 +++++-------------
arch/arm64/kernel/vdso32/Makefile | 2 --
3 files changed, 6 insertions(+), 16 deletions(-)
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -111,7 +111,7 @@ config ARM64
select GENERIC_STRNLEN_USER
select GENERIC_TIME_VSYSCALL
select GENERIC_GETTIMEOFDAY
- select GENERIC_COMPAT_VDSO if (!CPU_BIG_ENDIAN && COMPAT)
+ select GENERIC_COMPAT_VDSO if (!CPU_BIG_ENDIAN && COMPAT && "$(CROSS_COMPILE_COMPAT)" != "")
select HANDLE_DOMAIN_IRQ
select HARDIRQS_SW_RESEND
select HAVE_PCI
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -47,20 +47,12 @@ $(warning Detected assembler with broken
endif
endif
-ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)
- CROSS_COMPILE_COMPAT ?= $(CONFIG_CROSS_COMPILE_COMPAT_VDSO:"%"=%)
+COMPATCC ?= $(CROSS_COMPILE_COMPAT)gcc
+export COMPATCC
- ifeq ($(CONFIG_CC_IS_CLANG), y)
- $(warning CROSS_COMPILE_COMPAT is clang, the compat vDSO will not be built)
- else ifeq ($(strip $(CROSS_COMPILE_COMPAT)),)
- $(warning CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built)
- else ifeq ($(shell which $(CROSS_COMPILE_COMPAT)gcc 2> /dev/null),)
- $(error $(CROSS_COMPILE_COMPAT)gcc not found, check CROSS_COMPILE_COMPAT)
- else
- export CROSS_COMPILE_COMPAT
- export CONFIG_COMPAT_VDSO := y
- compat_vdso := -DCONFIG_COMPAT_VDSO=1
- endif
+ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)
+ export CONFIG_COMPAT_VDSO := y
+ compat_vdso := -DCONFIG_COMPAT_VDSO=1
endif
KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) $(compat_vdso)
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -8,8 +8,6 @@
ARCH_REL_TYPE_ABS := R_ARM_JUMP_SLOT|R_ARM_GLOB_DAT|R_ARM_ABS32
include $(srctree)/lib/vdso/Makefile
-COMPATCC := $(CROSS_COMPILE_COMPAT)gcc
-
# Same as cc-*option, but using COMPATCC instead of CC
cc32-option = $(call try-run,\
$(COMPATCC) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
......@@ -77,6 +77,8 @@ bugfix/arm64/arm64-acpi-Add-fixup-for-HPE-m400-quirks.patch
bugfix/x86/x86-32-disable-3dnow-in-generic-config.patch
bugfix/riscv64/riscv-Fix-memblock-reservation-for-device-tree-blob.patch
bugfix/riscv64/RISC-V-Clear-load-reservations-while-restoring-hart-.patch
bugfix/arm64/arm64-vdso32-fix-broken-compat-vdso-build-warnings.patch
bugfix/arm64/arm64-kconfig-make-config_compat_vdso-a-proper-kconf.patch
# Arch features
features/mips/MIPS-Loongson-3-Add-Loongson-LS3A-RS780E-1-way-machi.patch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment