Commit Graph

6 Commits

Author SHA1 Message Date
Tim Schumacher
cda4034b46 LibCrypt: Start installing headers again
This was accidentally broken in
ac40197047, after which we started
installing headers into a `LibCrypt` subdirectory instead.

`serenity_install_headers("")` is really the only thing that we need
from `serenity_libc`, so just replicate that manually.
2023-03-20 09:33:30 +01:00
Tim Schumacher
ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
Tim Schumacher
7834e26ddb Everywhere: Explicitly link all binaries against the LibC target
Even though the toolchain implicitly links against -lc, it does not know
where it should get LibC from except for the sysroot. In the case of
Clang this causes it to pick up the LibC stub instead, which might be
slightly outdated and feature missing symbols.

This is currently not an issue that manifests because we pass through
the dependency on LibC and other libraries by accident, which causes
CMake to link against the LibC target (instead of just the library),
and thus points the linker at the build output directory.

Since we are looking to fix that in the upcoming commits, let's make
sure that everything will still be able to find the proper LibC first.
2022-11-01 14:49:09 +00:00
Tim Schumacher
ac40197047 LibCrypt: Define it as a normal library
LibCrypt has no need for being -nostdlib, especially since we just link
in LibC manually anyways.
2022-11-01 14:49:09 +00:00
Andrew Kaster
e687e5ba74 LibCrypt: Link the SHA2 hash implementation into LibCrypt privately
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 :^)
2022-01-08 18:56:29 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00