Skip to content

[Flang-RT] Do not use Apple-specific libdir scheme #151954

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Aug 4, 2025

With -target x86_64-apple-darwin, flang looks for the following directories:

lib/x86_64-apple-darwin
lib/darwin/x86_64

while get_toolchain_library_subdir returned the following dir:

lib/darwin

The APPLE exception was copied over from compiler-rt. Either it doesn't work there either, or was not adapted correctly.
We remove the special Apple handling such that flang-rt is emitted into lib/x86_64-apple-darwin.

Fixes #151031

Comment on lines +37 to +38
get_toolchain_arch_dirname(arch_dirname)
set(outval "${outval}/${arch_dirname}")
Copy link
Contributor

@luporl luporl Aug 4, 2025

Choose a reason for hiding this comment

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

On my machine, both compiler-rt and flang-rt libraries are installed into <install_dir>/lib/clang/22/lib/darwin.

IIUC, this change would make flang-rt libraries be installed in a new directory, <install_dir>/lib/clang/22/lib/<target>, right?
Wouldn't it be better to make flang look for its libraries in the same path as compiler-rt?

@klausler
Copy link
Contributor

klausler commented Aug 4, 2025

This patch didn't change the behavior for me, unfortunately.

@PHHargrove
Copy link

This did not resolve the problem because the new ___location is not in the linker's search path.
I will add the linker command from flang -v output to issue #151031

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.

[flang] Building flang on Macs requires manually passing a flag with path to runtime libraries
4 participants