cc: change mode to ccld for loopopt edit (#23482)
For configure (e.g. for hdf5) to pass, this option needs to be pulled out when invoked in ccld mode. I thought it had fixed the issue but I still saw it after that. After some digging, my guess is that I was able to get hdf5 to build with ifort instead of ifx. Lot of overlapping changes occurring at the time, as it were. There are still outstanding issues building hdf5 with ifx, and Intel is looking into what appears to be a compiler bug, but this manifests during build and is likely a separate issue. I have verified that the making the edit in 'ccld' mode removes the -loopopt=0 and enables hdf5 to pass configure. It should be fine to make the edit in 'ld' mode as well, but I have not tested that and didn't include an -or- condition for it.
This commit is contained in:
parent
b91f24fa8a
commit
b70bf073b5
8
lib/spack/env/cc
vendored
8
lib/spack/env/cc
vendored
@ -319,11 +319,13 @@ while [ $# -ne 0 ]; do
|
||||
fi
|
||||
;;
|
||||
-l*)
|
||||
# -loopopt=0 is passed to the linker erroneously in
|
||||
# autoconf <= 2.69. Filter it out.
|
||||
# -loopopt=0 is generated erroneously in autoconf <= 2.69,
|
||||
# and passed by ifx to the linker, which confuses it with a
|
||||
# library. Filter it out.
|
||||
# TODO: generalize filtering of args with an env var, so that
|
||||
# TODO: we do not have to special case this here.
|
||||
if [ "$mode" = "ld" ] && [ "$1" != "${1#-loopopt}" ]; then
|
||||
if { [ "$mode" = "ccld" ] || [ $mode = "ld" ]; } \
|
||||
&& [ "$1" != "${1#-loopopt}" ]; then
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
|
@ -632,7 +632,14 @@ def test_linker_strips_loopopt(wrapper_flags):
|
||||
result = result.strip().split('\n')
|
||||
assert '-loopopt=0' not in result
|
||||
|
||||
# ensure that -loopopt=0 is present in compile mode
|
||||
# ensure that -loopopt=0 is not present in ccld mode
|
||||
result = cc(*(test_args + ["-loopopt=0"]), output=str)
|
||||
result = result.strip().split('\n')
|
||||
assert '-loopopt=0' not in result
|
||||
|
||||
# ensure that -loopopt=0 *is* present in cc mode
|
||||
# The "-c" argument is needed for cc to be detected
|
||||
# as compile only (cc) mode.
|
||||
result = cc(*(test_args + ["-loopopt=0", "-c", "x.c"]), output=str)
|
||||
result = result.strip().split('\n')
|
||||
assert '-loopopt=0' in result
|
||||
|
Loading…
Reference in New Issue
Block a user