From 97ea57e59f879bba15223d10ba57ff6d7dcca16b Mon Sep 17 00:00:00 2001 From: Jordan Galby <67924449+Jordan474@users.noreply.github.com> Date: Fri, 27 Aug 2021 13:16:26 +0200 Subject: [PATCH] Add ld.gold and ld.lld compiler wrapper (#25626) The gcc compiler can be configured to use `ld.gold` by default. It will then call `ld.gold` explicitly when linking. When so, spack need to have a ld.gold wrapper in PATH to inject rpaths link flags etc... Also I wouldn't be surprised to see some package calling `ld.gold` directly. As for ld.gold, the argument could be made that we want to support any package that could call ld.lld. --- .gitignore | 1 + lib/spack/env/cc | 2 +- lib/spack/env/ld.gold | 1 + lib/spack/env/ld.lld | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 120000 lib/spack/env/ld.gold create mode 120000 lib/spack/env/ld.lld diff --git a/.gitignore b/.gitignore index c3d2670af4..c75b98089c 100644 --- a/.gitignore +++ b/.gitignore @@ -132,6 +132,7 @@ celerybeat.pid .env .venv env/ +!/lib/spack/env venv/ ENV/ env.bak/ diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 5157a5f381..2bcff42dfd 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -163,7 +163,7 @@ case "$command" in lang_flags=F debug_flags="-g" ;; - ld) + ld|ld.gold|ld.lld) mode=ld ;; *) diff --git a/lib/spack/env/ld.gold b/lib/spack/env/ld.gold new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/lib/spack/env/ld.gold @@ -0,0 +1 @@ +cc \ No newline at end of file diff --git a/lib/spack/env/ld.lld b/lib/spack/env/ld.lld new file mode 120000 index 0000000000..2652f5f42c --- /dev/null +++ b/lib/spack/env/ld.lld @@ -0,0 +1 @@ +cc \ No newline at end of file