Skip to content

cc: fix RPATH handling with -r on macOS#46598

Open
tgamblin wants to merge 1 commit intodevelopfrom
fix-rpath-r-arg-handling
Open

cc: fix RPATH handling with -r on macOS#46598
tgamblin wants to merge 1 commit intodevelopfrom
fix-rpath-r-arg-handling

Conversation

@tgamblin
Copy link
Copy Markdown
Member

Closes #46264.
Fixes #45479.
Needs #46536 (based on it)

We have special logic in cc to not add RPATH arguments on macOS when using -r as a linker argument, but it's applied every time we append/extend RPATH lists, and it's not applied consistently.

  • Fix this by just not appending any parsed RPATHs on macOS when -r is present, instead of handling it on every insertion.
  • Simplify logic using the recently added contains() function.
  • Fix a broken test.

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Sep 26, 2024
@tgamblin
Copy link
Copy Markdown
Member Author

tgamblin commented Sep 26, 2024

@Chrismarsh does this fix your issue mentioned in #46536 (comment)? (just the last commit -- this is based on #46536)

@Chrismarsh
Copy link
Copy Markdown
Contributor

@tgamblin Looks like it does. I pulled this and ran it against parallel-netcdf and it built as expected!

@tgamblin
Copy link
Copy Markdown
Member Author

Great! Something else is broken here -- I'll work on it

We have special logic in `cc` to *not* add RPATH arguments on macOS
when using `-r` as a linker argument, but it's applied every time we
append/extend RPATH lists, and it's not applied consistently.

- [x] Fix this by just not appending *any* parsed RPATHs on macOS
      when `-r` is present, instead of handling it on every insertion.

- [x] Simplify logic using the recently added `contains()` function.

Signed-off-by: Todd Gamblin <[email protected]>
@Chrismarsh
Copy link
Copy Markdown
Contributor

With the now reverted #46536 this no longer works for me and parallel-netcdf continues to fail to build for me and @adamjstewart, e.g., #46811. I'm wondering if there is anything else I can test to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Macos AppleClang-gcc mixed tool chain should better handle FC rpath

3 participants