-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Making .so on x86 w/ libz-ng.a #1759
Comments
This has been discussed numerous times before... Mixing static and shared libraries isn't supported as linker won't know how to resolve if two compilation units define or use same symbol. Some platforms might enable PIC or PIE by default, but that doesn't eliminate the root cause of why we don't support manually specifying |
Fair enough. In general, how would other projects handle this (shared and static), or how should it be done? |
The main binary should be dynamically linked against zlib-ng and the symbols should be re-exported for any modules. This is the best way unless modules of that program can request other modules to be loaded on-demand. |
Sure, but the configure script has the option |
The static flag only works when linking against an executable, not a shared library, that is limitation of the linker, not zlib-ng. |
What I meant was the project seems to support a static version of zlib-ng, and it seems that |
I'm trying to compile a Python module which links against the static library for Zlib-ng, and I was getting a linker error:
relocation R_X86_PC32 against symbol zng_z_errmsg can not be used when making a shared object; recompile with -fPIC
This is on a Debian 12 system on x86_64 with gcc. I was able to fix this by adding
-fPIC
to the CFLAGS variable in the Makefile after running the configure script. Maybe this could be added to the project?Interestingly enough, I was able to compile the same code on Power9, also on Debian 12 with gcc without any issues.
The text was updated successfully, but these errors were encountered: