-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Compiling azure-iot-sdk-c from Ubuntu host to Rasperry Pi 4: _dl_stack_flags not found #1093
Comments
Correct. I arrived to a similar conclusion based on those links below: https://askubuntu.com/questions/36211/undefined-reference-error-dl-stack-flags-with-gcc-and-pthreads That should be the right path of investigation. Were you able to fix the issue based on this investigation? Thanks. |
Can you please also post here the full output from make? Thanks. |
@z466chen Were you able to figure out what modifications to make to the toolchain file to have pthread statically link? I am having the same issue as you. |
@rafilho I am having the same issue. Do you have any idea how to modify the azure-iot-sdk-c build process to statically link pthread? |
Hi @z466chen We apologize for the long delay, but we were assigned to work on new code development and that affected our github response time. Is this still an issue for you? |
I had the same issue. Quick hack: Just run |
We were able to (re)confirm the issue and the workaround. Thanks @bbpaulvanharen . We will update the docs with the workaround information. |
Update cross-compilation docs for Raspberry Pi 4 (gh #1093)
@z466chen, @campellcl, @bbpaulvanharen, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
OS: 18.04.2 LTS
azure-iot-c-sdk: latest
I am following the tutorial of cross compiling azure-iot-sdk-c on my Rpi 4 device.
It is success fully built using command:
sudo ./build.sh --toolchain-file toolchain-rpi.cmake -cl --sysroot=<work_dir>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf
And makefiles are generated for all samples. However, when making these samples, I got the following error:
/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(pthread_create.o): In function
__pthread_create_2_1': /build/glibc-FUvrFr/glibc-2.28/nptl/pthread_create.c:697: undefined reference to
_dl_stack_flags'/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(unwind.o): In function
unwind_stop': /build/glibc-FUvrFr/glibc-2.28/nptl/unwind.c:72: undefined reference to
__pointer_chk_guard_local'/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(nptl-init.o): In function
__pthread_initialize_minimal_internal': /build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_pagesize'/build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_init_static_tls' /build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_wait_lookup_done'/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(nptl-init.o): In function
__pthread_get_minstack': /build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:443: undefined reference to
_dl_pagesize'collect2: error: ld returned 1 exit status
/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(pthread_create.o): In function
__pthread_create_2_1': /build/glibc-FUvrFr/glibc-2.28/nptl/pthread_create.c:697: undefined reference to
_dl_stack_flags'/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(unwind.o): In function
unwind_stop': /build/glibc-FUvrFr/glibc-2.28/nptl/unwind.c:72: undefined reference to
__pointer_chk_guard_local'/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(nptl-init.o): In function
__pthread_initialize_minimal_internal': /build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_pagesize'/build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_init_static_tls' /build/glibc-FUvrFr/glibc-2.28/nptl/nptl-init.c:434: undefined reference to
_dl_wait_lookup_doneiothub_client/samples/iothub_ll_client_x509_sample/CMakeFiles/iothub_ll_client_x509_sample.dir/build.make:113: recipe for target 'iothub_client/samples/iothub_ll_client_x509_sample/iothub_ll_client_x509_sample' failed'make[2]: *** [iothub_client/samples/iothub_ll_client_x509_sample/iothub_ll_client_x509_sample] Error 1
/home/z466chen/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-64/arm-linux-gnueabihf/usr/lib/arm-linux-gnueabihf/libpthread.a(nptl-init.o): In function
__pthread_get_minstack': /build/glibc-FUvrFr/glibcCMakeFiles/Makefile2:1817: recipe for target 'iothub_client/samples/iothub_ll_client_x509_sample/CMakeFiles/iothub_ll_client_x509_sample.dir/all' failed -make[1]: *** [iothub_client/samples/iothub_ll_client_x509_sample/CMakeFiles/iothub_ll_client_x509_sample.dir/all] Error 2 2.28/nptl/nptl-make[1]: *** Waiting for unfinished jobs.... init.c:443: undefined reference to
_dl_pagesize'collect2: error: ld returned 1 exit status
iothub_client/samples/iothub_ll_c2d_sample/CMakeFiles/iothub_ll_c2d_sample.dir/build.make:140: recipe for target 'iothub_client/samples/iothub_ll_c2d_sample/iothub_ll_c2d_sample' failed
make[2]: *** [iothub_client/samples/iothub_ll_c2d_sample/iothub_ll_c2d_sample] Error 1
CMakeFiles/Makefile2:1753: recipe for target 'iothub_client/samples/iothub_ll_c2d_sample/CMakeFiles/iothub_ll_c2d_sample.dir/all' failed
make[1]: *** [iothub_client/samples/iothub_ll_c2d_sample/CMakeFiles/iothub_ll_c2d_sample.dir/all] Error 2
After research, it seems that it related to pthread not dynamically linked but other libraries like libc are dynamically linked. Is that the right way to investigate this issue? If so, what should I do to overcome this issue?
The text was updated successfully, but these errors were encountered: