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

configure (with libtool.m4 < 2.5.4) fails to determine -single_module support for lld #10290

Open
benlorenz opened this issue Jan 17, 2025 · 0 comments

Comments

@benlorenz
Copy link
Contributor

benlorenz commented Jan 17, 2025

The result are errors like this (on macos):

ld64.lld: warning: Option `-keep_private_externs' is not yet implemented. Stay tuned...
ld64.lld: warning: Option `-r' is not yet implemented. Stay tuned...
ld64.lld: warning: Option `-r' is not yet implemented. Stay tuned...
ld64.lld: error: undefined symbol: main

Tip

One workaround is to disable the default use of lld via clang_use_lld=false, which switches back to ld64 (but this might cause other problems).

I think a better workaround is to pass a cached value to configure: lt_cv_apple_cc_single_mod=yes

The reason is that configure (with code from libtool.m4) tries to detect whether the linker supports -single_module and gets confused because lld prints a warning:

ld64.lld: warning: Option `-single_module' is deprecated in ld64:
ld64.lld: warning: Unnecessary option: this is already the default

This causes it to believe that this option is unsupported and the fallback options contain -keep_private_externs and -r which are not implemented.

With the cached value we tell configure that this option can be used which should be fine since this is the default of lld anyway.

This was fixed in libtool 2.5.4

See https://savannah.gnu.org/support/?110937, https://savannah.gnu.org/news/?id=10693:

Noteworthy changes in release 2.5.4 (2024-11-20) [stable]

** Bug fixes:

  • Fix incorrect use of workarounds designed for Darwin versions that
    don't have -single_module support.

Unfortunately just updating the libtool version in the Rootfs wont change much since most autoconf based tarballs contain a pre-generated configure script which contains this code and even their own (outdated?) copy of libtool.m4.
We would probably need to regenerate the configure script and related files for each package that runs into this... or keep using a workaround until the release managers update their own libtool.

cc: @giordano

x-ref: #10280 (review), #7745 (comment), #7876, and probably quite a few more...

@benlorenz benlorenz changed the title libtool < 2.5.4 fails to determine -single_module support for lld configure (with libtool.m4 < 2.5.4) fails to determine -single_module support for lld Jan 17, 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

No branches or pull requests

1 participant