mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
e687e5ba74
Previously, we linked LibCrypt against LibCrypto. This creates a circular symbol dependency between LibCore, LibCrypto and LibCrypt. LibCrypto uses Core::DateTime, LibCrypt uses Crypto::SHA2, and LibCore uses crypt in Core::Account. The GNU toolchain massages the DT_NEEDED lines of each library and applications that use each library such that the Loader finds all the symbols as necessary. However, when using the Clang toolchain, the circular library dependency is not as tolerated. We get a symbol not found error in the Loader at runtime, and the app in question crashes. Now, we build the SHA2.cpp implementation file into LibCrypt using an object library and `-fvisibility=hidden -fvisibility-hidden-inlines`. This adds the implementation in a way that only creates STB_LOCAL symbols and should avoid nasty ODR problems in the future. An alternative approach to resolving this dependency would be to move Core::DateTime to AK, or to make Crypto::ASN1::parse_utc_date return a struct tm instead of a Core::DateTime. One of those approaches to remove the LibCore dependency from LibCrypto should probabably be investigated further in the future. The net effect of removing this circular library dependency is that one can now build and run the python3 port with the Clang toolchain :^) |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
crypt.cpp | ||
crypt.h |