package/gcc: Fix gcc finale library installation

Fixes:
http://autobuild.buildroot.net/results/98f/98fedf4969c260f73a01b937b9625e66dcd86b3c

When BR2_TOOLCHAIN_HAS_LIBATOMIC is "n", there is no gcc libatomic.so
library to install. For configurations with such settings, compilation
fails as gcc-final.mk unconditionally adds libatomic as an installation
target. This error, for instance, shows for all Canaan K210 riscv
configs, as they all use uclibc flat binary format which disabled
libatomic:

Fix this by modifying package/gcc/gcc-final/gcc-final.mk to add
libatomic to GCC_FINAL_LIBS only for configurations that have
BR2_TOOLCHAIN_HAS_LIBATOMIC set to "y".

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Damien Le Moal 2023-10-30 09:27:48 +09:00 committed by Peter Korsgaard
parent d23bcbd2bb
commit 01932fec17

View File

@ -144,7 +144,11 @@ HOST_GCC_FINAL_POST_INSTALL_HOOKS += TOOLCHAIN_WRAPPER_INSTALL
# -cc symlink to the wrapper is not created.
HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
GCC_FINAL_LIBS = libatomic
GCC_FINAL_LIBS =
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
GCC_FINAL_LIBS += libatomic
endif
ifeq ($(BR2_STATIC_LIBS),)
GCC_FINAL_LIBS += libgcc_s