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

Patrice CHOTARD patrice.chotard at foss.st.com
Thu Jun 5 10:36:44 CEST 2025



On 6/4/25 17:48, Raymond Mao wrote:
> 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

Hi

Tested-by: Patrice Chotard <patrice.chotard at foss.st.com>

On Ubuntu 20.04 with default gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0

Thanks
Patrice


More information about the U-Boot mailing list