0

I'm trying to compile a Buildroot image using a preconfigured builtin _defconfig file... More specific the riscv64_xwin_defconfig which is a simple setup for a riscv64 image with Xorg builtin.

Since it's a rather old build i'm doing this inside a Fedora 23 Docker container which has gcc version 5.3.1, i don't think this is a problem since i can successfully build the non-Xwin riscv64 defconfig just fine

The problem resides when the Makefile tries to build the specific package "eudev-3.2"

Here is the config.log:

configure:3158: $? = 1
configure:3178: checking whether the C compiler works
configure:3200: /home/buildroot-riscv-2018-10-20/output/host/usr/bin/riscv64-buildroot-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  conftest.c -lrt >&5
/home/buildroot-riscv-2018-10-20/output/host/usr/lib/gcc/riscv64-buildroot-linux-gnu/7.3.0/../../../../riscv64-buildroot-linux-gnu/bin/ld: warning: libpthread.so.0, needed by /home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so, not found (try using -rpath or -rpath-link)
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_barrier_wait@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_barrier_init@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_unwind@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_create@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_sigmask@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_once@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__shm_directory@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_detach@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_cancel@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_get_minstack@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status

0

Looks like someone forgot to explicitly link against libpthread. Adding -lpthread at the very end (after -lrt) should fix the problem at hand. Take a look at your Makefile to find out where you need to add -lpthread.

1
  • Thanks for you answer, i actually found this workound online but i'm failing so hard to understand which makefile should i add this.. Buildroot is so full of configurations and build files. I can't find even the line where it says "-lrt" in the first place.... Maybe it's inside the problematic package itself? (eudev-3.2) – Fabricio Dematte Jun 17 '20 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.