Skip to content

Conversation

@radarhere
Copy link

@radarhere radarhere commented Feb 8, 2025

Suggestion for python-pillow#8673

After looking at https://github.com/zlib-ng/zlib-ng/blob/287c4dce22a3244a0e2602d9e5bf0929df74fd27/configure#L473, I thought of using flags as an alternative to using install_name_tool.

You may or may not think this is a better solution, just thought I'd offer it.

@freakboy3742
Copy link
Owner

@radarhere I agree that it would be preferable to use a time-of-compilation configuration flag to address this problem.

The problem I see with this approach is that it results in the -dynamiclib -install_name ... argument being specified twice during linking, and it's then up to the combination of compiler behavior and Makefile.in script usage as to whether the LDFLAGS or LDSHAREDFLAGS version is the one that takes effect. To my mind, that makes the solution fragile as any number of changes could cause the fix to break for non-obvious reasons.

If we can convinced zlib-ng maintainers to expose the install name as a direct configuration option, that would enable a much cleaner solution - but that obviously requires a patch upstream.

Interestingly, an iOS build requires patching some libraries, and multibuild has already been updated to support patching official sources. As a variant on this approach, it might be worth developing a macOS patch zlib-ng so we can explicitly specify an install name as part of the Pillow build, and then work to submit that patch upstream.

@radarhere radarhere deleted the zlib-ng-with-sip branch February 9, 2025 21:24
@radarhere
Copy link
Author

If we can convinced zlib-ng maintainers to expose the install name as a direct configuration option, that would enable a much cleaner solution

Ok, I've given it a try - zlib-ng/zlib-ng#1867

freakboy3742 pushed a commit that referenced this pull request Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants