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

extend/ENV/super: avoid adding llvm to HOMEBREW_LIBRARY_PATHS #17104

Merged
merged 1 commit into from Apr 24, 2024

Conversation

carlocab
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This leads to undesired linkage with LLVM's libunwind (because it
shadows the system's libunwind).

See, for example, Homebrew/homebrew-core#169354.

This leads to undesired linkage with LLVM's `libunwind` (because it
shadows the system's `libunwind`).

See, for example, Homebrew/homebrew-core#169354.
@Bo98
Copy link
Member

Bo98 commented Apr 18, 2024

Does this still work OK for things that link to libLLVM/libclang?

@carlocab
Copy link
Member Author

carlocab commented Apr 18, 2024

Does this still work OK for things that link to libLLVM/libclang?

Haven't tested, but I'd be shocked if it didn't for nearly all of them, since they usually use flags from a CMake config file (or from llvm-config). Will test a bit.

@Bo98
Copy link
Member

Bo98 commented Apr 18, 2024

Makes sense yeah

@carlocab
Copy link
Member Author

Yea, seems to not break things (tried castxml and nvc). But perhaps it doesn't go far enough -- maybe what we want to do is set LIBUNWIND_INSTALL_LIBRARY_DIR to something like lib/"unwind" (or perhaps lib/"system", in analogy to Apple's /usr/lib/system/libunwind.dylib) to make sure we're not linking to it unless we really mean to.

@Bo98
Copy link
Member

Bo98 commented Apr 18, 2024

I agree. You should only use LLVM libunwind if you absolutely need it - not by default. Like how we did with libc++, which might itself be something that uses LLVM libunwind.

@carlocab carlocab marked this pull request as draft April 18, 2024 22:49
@carlocab
Copy link
Member Author

Cool. Let's do that. At that stage, though, it makes me wonder if LLVM needs to be keg-only anymore. (All remaining libs in the lib directory don't shadow something OS-provided, IIRC)

@Bo98
Copy link
Member

Bo98 commented Apr 18, 2024

it makes me wonder if LLVM needs to be keg-only anymore

The executables will shadow system clang which we don't want.

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this pull request and can confirm that it avoids unintended linkage with libunwind for formulae in my 3rd-party tap and will resolve osrf/homebrew-simulation#2639 once I rebuild the bottles after this is merged.

Please let me know if there's any further testing I can assist with.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carlocab! I think it's worth undrafting and merging as-is given it fixes some cases and we can always iterate on a better fix later.

@carlocab carlocab marked this pull request as ready for review April 24, 2024 09:16
@carlocab carlocab merged commit e3e927f into master Apr 24, 2024
25 checks passed
@carlocab carlocab deleted the llvm-library-paths branch April 24, 2024 09:16
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.

None yet

5 participants