Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f58c4d27 authored by Sami Tolvanen's avatar Sami Tolvanen
Browse files

ANDROID: kbuild: don't preprocess module-lto.lds



__cfi_check needs to be aligned to 4k, not necessarily PAGE_SIZE.
Furthermore, using arch-specific includes currently breaks `make
scripts`.

Bug: 165591024
Change-Id: Id80fce84d4c111374718d8d84e7c06812a5d4e4b
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent d88b2969
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -873,7 +873,7 @@ LD_FLAGS_LTO_CLANG := -mllvm -import-instr-limit=5
KBUILD_LDFLAGS += $(LD_FLAGS_LTO_CLANG)
KBUILD_LDFLAGS_MODULE += $(LD_FLAGS_LTO_CLANG)

KBUILD_LDS_MODULE += scripts/module-lto.lds
KBUILD_LDS_MODULE += $(srctree)/scripts/module-lto.lds
endif

ifdef CONFIG_LTO
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ always := $(hostprogs-y) $(hostprogs-m)
# The following hostprogs-y programs are only build on demand
hostprogs-y += unifdef

extra-$(CONFIG_LTO_CLANG)   += module-lto.lds

subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
+2 −4
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm/page.h>

/*
 * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
 * -ffunction-sections, which increases the size of the final module.
@@ -32,9 +30,9 @@ SECTIONS {

	/*
	 * With CFI_CLANG, ensure __cfi_check is at the beginning of the
	 * .text section, and that the section is aligned to page size.
	 * .text section, and that the section is aligned to 4k.
	 */
	.text : ALIGN(PAGE_SIZE) {
	.text : ALIGN(4096) {
		*(.text.__cfi_check)
		*(.text .text.[0-9a-zA-Z_]* .text..L.cfi*)
	}