[PATCH v2] sandbox: solve undefined reference to pthread_kill symbol

Raymond Mao raymond.mao at linaro.org
Wed Jun 4 17:48:11 CEST 2025


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 at linaro.org>
---
Changes in v2:
- update fixes tag in commit message.

 arch/sandbox/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index dd9b7473fa9..9a61e803a57 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -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
-- 
2.25.1



More information about the U-Boot mailing list