sandbox: solve undefined reference to pthread_kill symbol
authorRaymond Mao <raymond.mao@linaro.org>
Wed, 4 Jun 2025 15:48:11 +0000 (08:48 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 13 Jun 2025 22:57:02 +0000 (16:57 -0600)
This patch is to solve the sandbox building error:
$ make O=build-sandbox -s sandbox_defconfig
$ make O=build-sandbox -s -j2
/usr/bin/ld: /tmp/u-boot.27rzOu.ltrans58.ltrans.o: undefined reference to symbol 'pthread_kill@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[...]

Fixes: b989f9ed9fe1 ("test: lib: add initjmp() test")
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/sandbox/config.mk

index dd9b747..9a61e80 100644 (file)
@@ -3,7 +3,7 @@
 
 PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE
 PLATFORM_CPPFLAGS += -fPIC -ffunction-sections -fdata-sections
-PLATFORM_LIBS += -lrt
+PLATFORM_LIBS += -lrt -lpthread
 SDL_CONFIG ?= sdl2-config
 
 # Define this to avoid linking with SDL, which requires SDL libraries