summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/Makefile
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2023-02-25 10:52:56 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2023-02-25 17:12:16 +0300
commit41596803302d83a67a80dc1efef4e51ac46acabb (patch)
tree91fb727f636ae6d72b1f0653567edd861c1afa9e /arch/loongarch/kernel/Makefile
parentbb7a78e343468873bf00b2b181fcfd3c02d8cb56 (diff)
downloadlinux-41596803302d83a67a80dc1efef4e51ac46acabb.tar.xz
LoongArch: Make -mstrict-align configurable
Introduce Kconfig option ARCH_STRICT_ALIGN to make -mstrict-align be configurable. Not all LoongArch cores support h/w unaligned access, we can use the -mstrict-align build parameter to prevent unaligned accesses. CPUs with h/w unaligned access support: Loongson-2K2000/2K3000/3A5000/3C5000/3D5000. CPUs without h/w unaligned access support: Loongson-2K500/2K1000. This option is enabled by default to make the kernel be able to run on all LoongArch systems. But you can disable it manually if you want to run kernel only on systems with h/w unaligned access support in order to optimise for performance. Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/Makefile')
-rw-r--r--arch/loongarch/kernel/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/Makefile b/arch/loongarch/kernel/Makefile
index c8cfbd562921..df5dbabfe7a6 100644
--- a/arch/loongarch/kernel/Makefile
+++ b/arch/loongarch/kernel/Makefile
@@ -8,13 +8,15 @@ extra-y := vmlinux.lds
obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
traps.o irq.o idle.o process.o dma.o mem.o io.o reset.o switch.o \
elf.o syscall.o signal.o time.o topology.o inst.o ptrace.o vdso.o \
- alternative.o unaligned.o unwind.o
+ alternative.o unwind.o
obj-$(CONFIG_ACPI) += acpi.o
obj-$(CONFIG_EFI) += efi.o
obj-$(CONFIG_CPU_HAS_FPU) += fpu.o
+obj-$(CONFIG_ARCH_STRICT_ALIGN) += unaligned.o
+
ifdef CONFIG_FUNCTION_TRACER
ifndef CONFIG_DYNAMIC_FTRACE
obj-y += mcount.o ftrace.o