-
Notifications
You must be signed in to change notification settings - Fork 170
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
CMake: link gost.so statically to its caller #384
base: master
Are you sure you want to change the base?
Conversation
Here is the diff between original state and the fixed one:
|
I'm not sure that I want to link it this way by default. |
There are possible use cases on linux. E.g., the official docker image of |
cafdd38
to
1d44b40
Compare
Please restart cancelled checks. They failed in |
I'd consider this option as a separate build variant. |
Maybe I am wrong to call this type of linking
|
Agree. I discussed this slightly with @ldv-alt and he suggests that this should be build time option — as ALT certainly will not use this feature. |
I don't understand how linking against The plugins are quite common. Kernel modules are plugins in the same sense as Finally, all of this is the least concern possible for a distribution like ALT, which completely controls all the files it ships. Dynamic linking is a mess for sure. That is why everyone tries to link statically: My patch offers part of a solution, if |
@ldv-alt thinks this is better, because this will create strict ABI dependence for packages. Dynamic linker when loading gost.so will load |
Btw, this only happen to me when I play with manually built openssl OR engine and never when I use packages. And @ldv-alt's concern is packages. |
If any executable loads `gost.so`, the executable already either has `libcrypto.so` loaded or is statically linked against `libcrypto.a`. Anyway it already has all libcrypto (and libssl) symbols present. Without this patch `gost.so` is linked against `libcrypto,so`. As a result, a diamond dependency is introduced. If `gost.so` is then loaded by an executable which is statically linked against libcrypto, `ld` will insist on loading `libcripto.so`, despite the executable already having all necessary symbols. When the executable is statically linked, shared objects for libcrypto and libssl are usually not built, `ls` won't find them, and the caller will crush. The patch removes this unnecessary link dependency in `gost.so`, allowing it to be used by executables which are statically linked against libcrypto.
fa99572
to
669ba9a
Compare
669ba9a
to
631e688
Compare
If any executable loads
gost.so
, the executable already either haslibcrypto.so
loaded or is statically linked againstlibcrypto.a
.Anyway it already has all libcrypto (and libssl) symbols present.
Without this patch
gost.so
is linked againstlibcrypto,so
. Asa result, a diamond dependency is introduced. If
gost.so
is thenloaded by an executable which is statically linked against libcrypto,
ld
will insist on loadinglibcripto.so
, despite the executablealready having all necessary symbols. When the executable is statically
linked, shared objects for libcrypto and libssl are usually not built,
ls
won't find them, and the caller will crush.The patch removes this unnecessary link dependency in
gost.so
,allowing it to be used by executables which are statically linked
against libcrypto.