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
'make -C lib lib-mt' produces underlinked libzstd.so
#2045
Comments
Thanks @trofi for this very interesting report. I was surprised to read, through the comments, that underlinking is a thing, which may even be achieved intentionally ( Most other docs on this topic advise not to underlink libraries. There are additional impacts on It's interesting as it seems to open a way towards enabling multi-threading in First thing to do : update tests, so that they can catch this situation. Then apply fix. Minor detail : I'm not sure how "universal" |
Correct. That matches my understanding.
Correct. That also matches my understanding.
|
for information, tested with macos-x 's
note : |
fix #2045 When compiling `libzstd` in multithreading mode, the `libzstd-mt` recipe would not include `-pthread`, resulting in an underlinked dynamic library. Added a test on Travis to check that the library is fully linked. This makes it possible, in some future release, to build a multi-threaded `libzstd` dynamic library by default as it would no longer impact the build script of user programs.
Original build failure was reported as a
gcc-10
build failure whenzstd
is installed in system. Shorter version of underlying cause is https://bugs.gentoo.org/713940.The simplest way to reproduce it is to try to build multi-threaded
libzstd.so
with undefined symbols forbidden (there should be no undefined symbols in non-plugin libraries anyway).I injected
-Wl,--no-undefined
manually as I don't see a nice way to append to existing LDFLAGS:Now build failure shows underlinked library:
Desktop (please complete the following information):
Reading https://github.com/facebook/zstd/blob/dev/lib/README.md#multithreading-support it looks like build system is supposed to pass
-pthread
when building/linkinglibzstd.so
, but it does not:The following fix seems to be enough to fix underlinking:
The text was updated successfully, but these errors were encountered: