-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
zlib v1.2.12 fails to build shared library #617
Comments
I tried tip of develop, but it still fails. |
Please share the full log of the failure you're seeing. |
|
I checked all the variables inside configure, and For some weird reason, zlib 1.2.11 could manage to find gcc even though full name of the binary wasn't detected. |
I am running into similar issues and I had to downgrade back to 1.2.11; many other programs failed to compile For instance harfbuzz just now:
|
When it doesn't detect the system is Linux, it doesn't set soname or use version map, so the exported symbols don't include symbol versions. |
Switching to CMake instead of configure / make at least solves the issue with the relocation issue on rh8.5. |
When cross-compiling, using configure is a lot easier as no toolchain file is needed; just set CHOST before running configure. Paths and filenames can differ depending on the operating system version. We use a build matrix with over 10 different compilers and 3 operating systems. |
Same here. |
This is to circumvent madler/zlib#617.
have you tried to use git bisect to find the commit which introduced thebug ? (https://www.git-tower.com/learn/git/faq/git-bisect/) |
Git blame would be a lot faster as I know what line the bug is... Commit hash is 7301420 ;) |
7301420 got introduced for v1.2.4.5 more than 10 years ago. I thought the reported issue is a more recent regression of v1.2.12. |
That's the first commit that fails, hence introducing the bug... It had workaround that worked up to v1.2.11, but not in v1.2.12 anymore... I can't track workarounds when going commits backwards as that would require modifying commits after fetching the commit in script and that is not possible in non-interactive shell. |
This issue has also affected the Fedora distribution and thus we cannot rebase zlib to its newest 1.2.12 version. Did you find any workarounds for this yet? @mtl1979 |
Only workaround I know is to use incorrect CHOST (already canonicalized) and then manually specify CC using full path to compiler... This should work with the tip of develop branch... |
What line is the bug and what is the bug? (That commit has all the changes for that version, so it doesn't help find your line.) |
@madler https://github.com/madler/zlib/blob/develop/configure#L35 ... The regex is too simplified... Canonicalizing is the cleanest solution, but it requires copying over the canonicalizing script. See https://github.com/zlib-ng/zlib-ng/blob/develop/configure#L25 |
What was your workaround that 1.2.12 broke? |
@madler We did normalize the triplet before calling zlib's configure, but that didn't work anymore as the prefix of the compiler binary isn't same as the normalized |
So what changed in 1.2.12 that made it not work anymore? |
@madler Obviously handling of empty |
I assume by fixed, you are referring to commit 05796d3 . Please explain, with an example, what about the fix is incomplete, and how the result differs from 1.2.11. What is a "triplet"? How were there two different "triplets" in 1.2.11? |
@madler Triplet is target for a compiler, for example |
As you pointed out, that regular expression hasn't changed since 2011. What did 12.2.11 do that it no longer does, even with commit 05796d3 ? |
@madler I've already explained the core issue... There is two alternatives, either it uses wrong binaries, targeting host operating system instead of cross-compile target, or it fails during linking shared library due to incorrect linker flags. Specifying Obviously using non-canonicalized triplet is the right/preferred choice as then the triplet matches prefix used by the toolchain. |
Yes, I know the end result. I'm trying to understand how. Let me ask more explicit questions. In your example, configure is trying to run the executable |
It doesn't exist. Closest existing binary is To answer what should happen, is that it should ignore |
This is all the targets for gcc I use:
|
Ok. By "ignore", do you mean "remove"? Are you expecting configure to convert You must be giving |
No... I mean ignore that it doesn't exist in |
I'm going to try something different. I am going to remove the sed command completely, set Please try the current develop branch, with 013c0ca . |
Linker command-line looks correct and it gives no error when I try abicheck on zlib-ng repository without altering |
So is this issue resolved? |
Works for me ;) |
Thank you. |
This is to circumvent madler/zlib#617.
When using configure, compiler is not correctly detected as gcc and
-fPIC
is not added toSFLAGS
. This causes relocation issues when linking under Linux.The text was updated successfully, but these errors were encountered: