summaryrefslogtreecommitdiff
path: root/lib/Kconfig
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2022-09-29 05:08:23 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-10-02 21:52:58 +0300
commit637a642f5ca5e850186bb64ac75ebb0f124b458d (patch)
tree3081d6f333d3ff9421f337b80aace2f6f1aaa347 /lib/Kconfig
parentd32b55f4bb43466bc6cdd98a00f8a600bbf7e8ec (diff)
downloadlinux-637a642f5ca5e850186bb64ac75ebb0f124b458d.tar.xz
zstd: Fixing mixed module-builtin objects
With CONFIG_ZSTD_COMPRESS=m and CONFIG_ZSTD_DECOMPRESS=y we end up in a situation when files from lib/zstd/common/ are compiled once to be linked later for ZSTD_DECOMPRESS (build-in) and ZSTD_COMPRESS (module) even though CFLAGS are different for builtins and modules. So far somehow this was not a problem but enabling LLVM LTO exposes the problem as: ld.lld: error: linking module flags 'Code Model': IDs have conflicting values in 'lib/built-in.a(zstd_common.o at 5868)' and 'ld-temp.o' This particular conflict is caused by KBUILD_CFLAGS=-mcmodel=medium vs. KBUILD_CFLAGS_MODULE=-mcmodel=large , modules use the large model on POWERPC as explained at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/Makefile?h=v5.18-rc4#n127 but the current use of common files is wrong anyway. This works around the issue by introducing a zstd_common module with shared code. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r--lib/Kconfig8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index dc1ab2ed1dc6..3ea8941ab18d 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -343,12 +343,16 @@ config LZ4HC_COMPRESS
config LZ4_DECOMPRESS
tristate
-config ZSTD_COMPRESS
+config ZSTD_COMMON
select XXHASH
tristate
+config ZSTD_COMPRESS
+ select ZSTD_COMMON
+ tristate
+
config ZSTD_DECOMPRESS
- select XXHASH
+ select ZSTD_COMMON
tristate
source "lib/xz/Kconfig"