[bug] system lib (dl) ordering change on link
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: Debian bullseye
- Compiler+version: gcc 11
- Conan version: 1.51
- Python version: 3.9.2
Steps to reproduce (Include if Applicable)
Not easy, but lot of dependencies and openssl with dl usage (using crypto)
Logs (Executed commands with output) (Include/Attach if Applicable)
/usr/bin/c++ -pipe -Wall -fstack-protector-all -fstack-check -O3 -DNDEBUG -Wl,-z,relro -Wl,--as-needed CMakeFiles/bin_beauty_application_singleton.dir/beauty_application_singleton.cpp.o -o ../../../bin/beauty_application_singleton ../../../lib/libbeauty.a /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libssl.a -ldl /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libcrypto.a -lrt -lpthread -lstdc++fs
Here -ldl is placed before crypto.a, so I get
usr/bin/ld: /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x13): undefined reference to `dlopen'
If I use conan 1.49 or conan 1.50, it works fine.
usr/bin/c++ -pipe -Wall -fstack-protector-all -fstack-check -O3 -DNDEBUG -Wl,-z,relro -Wl,--as-needed CMakeFiles/bin_beauty_chat.dir/beauty_chat.cpp.o -o ../../../bin/beauty_chat ../../../lib/libbeauty.a /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libssl.a /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libcrypto.a /home/dfleury/.conan/data/openssl/1.1.1q/_/_/package/fae585d7c68637b721c0c4c0d1c52174d067eda8/lib/libcrypto.a -ldl -lpthread -lrt -lstdc++fs
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
DL Ordering - Trident Connect
We appreciate your understanding as we consolidate online ordering systems into a single, convenient portal. We anticipate this process to be completed in ......
Read more >Dynamic link library (DLL) - Windows Client | Microsoft Learn
This article describes what a dynamic link library (DLL) is and the various issues that may occur when you use DLLs.
Read more >What is dynamic link library (DLL)? - TechTarget
A dynamic link library (DLL) is a collection of small programs that larger programs can load when needed to complete specific tasks.
Read more >Why does the order in which libraries are linked sometimes ...
Linking to static libraries ... The linker searches from left to right, and notes unresolved symbols as it goes. If a library resolves...
Read more >Google Play Billing Library release notes - Android Developers
Google Play's billing system ... These replace Purchase#getSku and PurchaseHistoryRecord#getSku which have been removed. ... Java and Kotlin Bug fixes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am using some “scripts” to generate lot of boring stuff. Hard to extract it easily. But something as simple as:
just that I generated a variable inside conanfile.py that list all dependencies generated (*.cmake files), pass it to CMake, to call each find_package.
and I have a macro to replace add_library/target_link_libraries in a single call.
Ok, I found something that work, on a direct dependency. Currently I am using
openssl::openssl
as dependency (but broken). If I usein this exact order it works fine. If I put SSL before crypto, it’s broken again, the dl lib is after ssl.a but before crypto.a Hope this one help.