linux-stable/lib/zstd
Alexey Kardashevskiy 637a642f5c 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>
2022-10-03 03:52:58 +09:00
..
common zstd: Fixing mixed module-builtin objects 2022-10-03 03:52:58 +09:00
compress lib: zstd: Don't inline functions in zstd_opt.c 2021-11-18 13:15:33 -08:00
decompress lib: zstd: Add cast to silence clang's -Wbitwise-instead-of-logical 2021-11-08 16:55:38 -08:00
Makefile zstd: Fixing mixed module-builtin objects 2022-10-03 03:52:58 +09:00
decompress_sources.h lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
zstd_compress_module.c lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00
zstd_decompress_module.c lib: zstd: Upgrade to latest upstream zstd version 1.4.10 2021-11-08 16:55:32 -08:00