Skip to content
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

Avoid using separate section for infrequently used functions on apple arm64 builds #4

Closed
wants to merge 1 commit into from

Conversation

glguy
Copy link
Member

@glguy glguy commented Aug 20, 2024

This fixes a linker error where the __cstrings section puts the two code sections too far apart

… arm64 builds

This fixes a linker error where the __cstrings section puts the two code sections too far apart
@RyanGlScott
Copy link
Contributor

RyanGlScott commented Aug 20, 2024

Nice catch!

Now that we've narrowed down the issue to lmdb (a fairly popular C library), this made me wonder if someone else has noticed this issue in another project. And sure enough, someone did:

The lld linker issue has since been fixed upstream (see llvm/llvm-project#99052), but it likely won't make its way into Xcode for a while. Meanwhile, OpenLDAP (which maintains the lmdb C library) has adopted a different workaround in https://git.openldap.org/openldap/openldap/-/merge_requests/563. (I haven't tested to see if this workaround would also fix the linker issue, but I suspect it would.) This workaround is included in the 0.9.30 release of lmdb, while this Haskell library currently vendors version 0.9.29.

Personally, I would prefer to keep the vendored version of lmdb as close to an upstream release as possible. As such, I am inclined to fix this linker issue by upgrading from 0.9.29 to 0.9.30 rather than by applying additional patches. I've opened a separate PR (#5) for this.

@glguy glguy closed this Aug 20, 2024
@glguy glguy deleted the no_text_env branch August 20, 2024 15:31
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