diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2024-09-21 17:25:16 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2024-09-27 05:27:26 -0700 |
commit | 2613a14c43b11ab92181bdd7ba57cd5b99f128a8 (patch) | |
tree | 89b0c34094cdebf382d321376391240342c922d7 /share | |
parent | a76a48c42e8d6657f9dcb0500bff574651f317d9 (diff) | |
download | spack-2613a14c43b11ab92181bdd7ba57cd5b99f128a8.tar.gz spack-2613a14c43b11ab92181bdd7ba57cd5b99f128a8.tar.bz2 spack-2613a14c43b11ab92181bdd7ba57cd5b99f128a8.tar.xz spack-2613a14c43b11ab92181bdd7ba57cd5b99f128a8.zip |
`cc`: ensure that RPATHs passed to linker are unique
macOS Sequoia's linker will complain if RPATHs on the CLI are specified more than once.
To avoid errors due to this, make `cc` only append unique RPATHs to the final args list.
This required a few improvements to the logic in `cc`:
1. List functions in `cc` didn't have any way to append unique elements to a list. Add a
`contains()` shell function that works like our other list functions. Use it to implement
an optional `"unique"` argument to `append()` and an `extend_unique()`. Use that to add
RPATHs to the `args_list`.
2. In the pure `ld` case, we weren't actually parsing `RPATH` arguments separately as we
do for `ccld`. Fix this by adding *another* nested case statement for raw `RPATH`
parsing. There are now 3 places where we deal with `-rpath` and friends, but I don't
see a great way to unify them, as `-Wl,`, `-Xlinker`, and raw `-rpath` arguments are
all ever so slightly different.
3. Fix ordering of assertions to make `pytest` diffs more intelligible. The meaning of
`+` and `-` in diffs changed in `pytest` 6.0 and the "preferred" order for assertions
became `assert actual == expected` instead of the other way around.
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions