-
Notifications
You must be signed in to change notification settings - Fork 283
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
binutils: zlib not correctly embedded #1350
Comments
The suggestion above does not have the desired effect. I tried it and the sanity check fails saying that zlib was not statically linked. The longer I look into this and think about it, the less I am convinced that embedding |
I'm actually more interested why we cannot static link zlib to |
@wpoely86 Here is the corresponding excerpt from the build log:
As you can see, |
Just to make it clear: There is no such thing as "statically linking a static library to a static library". You can either manually extract the object files from the library you want to embed and add them to the other static library, or you have to pass both libraries on the link line to the compiler in the right order (that's what the Honestly, I don't believe that there is a sensible way to make this work without significant changes to the |
BTW: Shouldn't the RPATH stuff for |
It was put in Maybe just use |
Maybe it was put in I couldn't get the |
Do we want to solve the inconsistency? With a static lib you must provide everything, for a dynamic the linker does the work for you? |
The inconsistency is what is causing trouble, yes. We do use Bottom line: |
If you want to link Anyway, I'm not against add |
I'm not sure the So, to make some progress (and to get rid of the custom easyblock I'm currently using), what about doing the following: We do the patching stuff only if |
I also had this error. From unknown me reasons during build binutils search libz.so in /usr/lib, and not in /lib. Creating symbolic link in /usr/lib ( ln -s /lib/libz.so /usr/lib/libz.so) resolve issue. |
I got similar error building foss-2019a:
|
Note that we should not touch this!! The system versions of libbfd.a/so have the exact same setup, i.e. no definition of inflate* in libbfd.a I.e., libz.a should not be a part of libbfd.a at all. and it should not be used in the ar command for libbfd.a |
Not embedding |
@geimer Is including If you're up for fixing this, please open the relevant PRs (and mention them here), so we can better assess the required changes. I'm also wondering if this implies that people will need to rebuild their existing |
Ubuntu doesn't embed libz in libbfd.so so there shouldn't be a problem for us either. I.e., ignore my previous comment on this. |
Anything that itself need libz of course have to link with -lz, but just using libbfd.so will work as usual. |
In the current situation, one gets
Thus, With not trying to embed any
Thus, both |
I also should have said that the latter is what should happen and the current situation actually breaks things. |
With #1732 and easybuilders/easybuild-easyconfigs#8340 merged, I think we can close this. @geimer: agreed? |
@boegel Yes, agreed. This issue should be fully addressed for "recent" binutils (>=2.28). |
The way in which
zlib
is embedded inlibbfd
is half-way broken. While thezlib
symbols correctly show up inlibbfd.so
they do not in
libbfd.a
:As can be seen from the first line of the output, the reason is that the whole
libz.a
is included inlibbfd.a
rather than the individual object files oflibz.a
. This leads to problems when linking a program statically.Example:
I'm not entirely sure what the right way to fix this is. Maybe set
ZLIB
to-L$EBROOTZLIB/lib -lz
rather than$EBROOTZLIB/lib/libz.a
in all theMakefile.in
s?The text was updated successfully, but these errors were encountered: