summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrank Willmore <frankwillmore@gmail.com>2021-05-13 23:31:20 -0500
committerGitHub <noreply@github.com>2021-05-13 21:31:20 -0700
commitb70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c (patch)
tree62280d39b42de6b0df2d3cccec974d810b035a91 /lib
parentb91f24fa8aa105bd1218e40e2da6677040271c6e (diff)
downloadspack-b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c.tar.gz
spack-b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c.tar.bz2
spack-b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c.tar.xz
spack-b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c.zip
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.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc8
-rw-r--r--lib/spack/spack/test/cc.py9
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 4d8c4644cb..bd479f05ec 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -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
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index fa61a5e9e6..20ec946835 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -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