spack/lib/spack/env
Harmen Stoppels d946c37cbb
ldflags=* are compiler flags, not linker flags (#43820)
We run `extend spack_flags_list SPACK_LDFLAGS` for `$mode in ld|ccld`.

That's problematic, cause `ccld` needs `-Wl,--flag` whereas `ld` needs
`--flag` directly. Only `-L` and `-l` are common to compiler & linker.

In all build systems `LDFLAGS` is for the compiler not the linker, cause
any linker flag `-x` can be passed as a compiler flag `-Wl,-x`, and there
are many compiler flags that affect the linker invocation, like `-fopenmp`,
`-fuse-ld=`, `-fsanitize=` etc.

So don't pass `LDFLAGS` to the linker directly.

This way users can set `ldflags: -Wl,--allow-shlib-undefined` in compilers.yaml
to work around an issue where the linker tries to resolve the `libcuda.so.1`
stub lib which cannot be located by design in `cuda`.
2024-04-26 09:19:03 +02:00
..
aocc
arm
case-insensitive
cce Cray support: use linux platform for newer craype versions (#29392) 2022-11-04 14:52:11 -07:00
clang
fj
gcc
intel
nag
nvhpc
oneapi
pgi
rocmcc rocmcc compiler: initial commit based on aocc and clang (#28575) 2022-03-03 14:34:22 -07:00
xl
xl_r
c89
c99
c++
cc ldflags=* are compiler flags, not linker flags (#43820) 2024-04-26 09:19:03 +02:00
cpp
f77
f90
f95
fc
ftn
ld
ld.gold
ld.lld