mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
efi/libstub: Only disable stackleak plugin for arm64
arm64 uses the full KBUILD_CFLAGS for building libstub as opposed to x86 which doesn't. This means that x86 doesn't pick up the gcc-plugins. We need to disable the stackleak plugin but doing this unconditionally breaks x86 build since it doesn't have any plugins. Switch to disabling the stackleak plugin for arm64 only. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
committed by
Will Deacon
parent
d26de6c9f4
commit
ce279d374f
@@ -11,7 +11,10 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
|
|||||||
-fPIC -fno-strict-aliasing -mno-red-zone \
|
-fPIC -fno-strict-aliasing -mno-red-zone \
|
||||||
-mno-mmx -mno-sse -fshort-wchar
|
-mno-mmx -mno-sse -fshort-wchar
|
||||||
|
|
||||||
cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie
|
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
|
||||||
|
# disable the stackleak plugin
|
||||||
|
cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \
|
||||||
|
$(DISABLE_STACKLEAK_PLUGIN)
|
||||||
cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
|
cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
|
||||||
-fno-builtin -fpic -mno-single-pic-base
|
-fno-builtin -fpic -mno-single-pic-base
|
||||||
|
|
||||||
@@ -21,7 +24,6 @@ KBUILD_CFLAGS := $(cflags-y) -DDISABLE_BRANCH_PROFILING \
|
|||||||
-D__NO_FORTIFY \
|
-D__NO_FORTIFY \
|
||||||
$(call cc-option,-ffreestanding) \
|
$(call cc-option,-ffreestanding) \
|
||||||
$(call cc-option,-fno-stack-protector) \
|
$(call cc-option,-fno-stack-protector) \
|
||||||
$(DISABLE_STACKLEAK_PLUGIN)
|
|
||||||
|
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
KASAN_SANITIZE := n
|
KASAN_SANITIZE := n
|
||||||
|
|||||||
Reference in New Issue
Block a user