Repository: spack/spack

Issue:
Installation issue: llvm-openmp for M1
### Steps to reproduce the issue

On the new macOS M1 (aarch64) systems with BigSur, compiling llvm-openmp does not work with the provided Xcode (AppleClang 12.0.5).

```console
space install llvm-openmp
```

leads to:
```
cd /private/var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc
            /spack-build-ikuqdzd/runtime/src && /Users/axel/src/spack/lib/spack/env/clang/clang -Domp_EXPORTS -I/private/var/folders/wy/w22w0mkx67711r3
            m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spack-build-ikuqdzd/runtime/src -I/var/fo
            lders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spack-src/runtime
            /src -I/var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spa
            ck-src/runtime/src/i18n -I/var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcs
            ubvgb24rkhwq7wc/spack-src/runtime/src/include -I/var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9
            .0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spack-src/runtime/src/thirdparty/ittnotify -O2 -g -DNDEBUG -arch arm64 -isysroot /Library/Developer/C
            ommandLineTools/SDKs/MacOSX11.3.sdk -fPIC   -D _GNU_SOURCE -D _REENTRANT -x assembler-with-cpp -MD -MT runtime/src/CMakeFiles/omp.dir/z_Lin
            ux_asm.S.o -MF CMakeFiles/omp.dir/z_Linux_asm.S.o.d -o CMakeFiles/omp.dir/z_Linux_asm.S.o -c /var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn
            /T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spack-src/runtime/src/z_Linux_asm.S
  >> 221    /var/folders/wy/w22w0mkx67711r3m3t98_g7m0000gn/T/axel/spack-stage/spack-stage-llvm-openmp-9.0.0-ikuqdzdhbfgvj7lcsubvgb24rkhwq7wc/spack-src/
            runtime/src/z_Linux_asm.S:1546:5: error: unknown directive
     222        .size __kmp_unnamed_critical_addr,8
     223        ^
  >> 224    make[2]: *** [runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o] Error 1
     225    make[2]: *** Waiting for unfinished jobs....
  >> 226    make[1]: *** [runtime/src/CMakeFiles/omp.dir/all] Error 2
  >> 227    make: *** [all] Error 2
```

### Information on your system

* **Spack:** 0.16.3-4508-2b5893c932
* **Python:** 3.9.7
* **Platform:** darwin-bigsur-m1
* **Concretizer:** clingo

`compilers.yaml:`
```
compilers:
- compiler:
    spec: apple-clang@12.0.5
    paths:
      cc: /usr/bin/clang
      cxx: /usr/bin/clang++
      f77: /opt/homebrew/Cellar/gcc/11.2.0/bin/gfortran
      fc: /opt/homebrew/Cellar/gcc/11.2.0/bin/gfortran
    flags: {}
    operating_system: bigsur
    target: aarch64
    modules: []
    environment: {}
    extra_rpaths: []
```

### Additional information

* [spack-configure-args.txt](https://github.com/spack/spack/files/7248062/spack-configure-args.txt)
* [spack-build-01-cmake-out.txt](https://github.com/spack/spack/files/7248058/spack-build-01-cmake-out.txt)
* [spack-build-02-build-out.txt](https://github.com/spack/spack/files/7248059/spack-build-02-build-out.txt)
* [spack-build-env.txt](https://github.com/spack/spack/files/7248060/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/7248061/spack-build-out.txt)


### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
I tried the latest LLVM OpenMP release (11.0.0) on the homepage:
```diff
diff --git a/var/spack/repos/builtin/packages/llvm-openmp/package.py b/var/spack/repos/builtin/packages/llvm-openmp/package.py
index d7534ff453..cb7e380148 100755
--- a/var/spack/repos/builtin/packages/llvm-openmp/package.py
+++ b/var/spack/repos/builtin/packages/llvm-openmp/package.py
@@ -13,6 +13,8 @@ class LlvmOpenmp(CMakePackage):
     homepage = "https://openmp.llvm.org/"
     url      = "https://releases.llvm.org/9.0.0/openmp-9.0.0.src.tar.xz"
 
+    version('11.0.0', sha256='2d704df8ca67b77d6d94ebf79621b0f773d5648963dd19e0f78efef4404b684c',
+            url='https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz')
     version('9.0.0', sha256='9979eb1133066376cc0be29d1682bc0b0e7fb541075b391061679111ae4d3b5b')
     version('8.0.0', sha256='f7b1705d2f16c4fc23d6531f67d2dd6fb78a077dd346b02fed64f4b8df65c9d5')
```
and the same error persists.
Looking at home-brew, there seems to be a 12.0.1 version, too:
https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/openmp-12.0.1.src.tar.xz

That one works. PR incoming.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/llvm-openmp/package.py b/var/spack/repos/builtin/packages/llvm-openmp/package.py
--- a/var/spack/repos/builtin/packages/llvm-openmp/package.py
+++ b/var/spack/repos/builtin/packages/llvm-openmp/package.py
@@ -13,6 +13,7 @@ class LlvmOpenmp(CMakePackage):
     homepage = "https://openmp.llvm.org/"
     url      = "https://releases.llvm.org/9.0.0/openmp-9.0.0.src.tar.xz"
 
+    version('12.0.1', sha256='60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091')
     version('9.0.0', sha256='9979eb1133066376cc0be29d1682bc0b0e7fb541075b391061679111ae4d3b5b')
     version('8.0.0', sha256='f7b1705d2f16c4fc23d6531f67d2dd6fb78a077dd346b02fed64f4b8df65c9d5')
 
@@ -21,6 +22,14 @@ class LlvmOpenmp(CMakePackage):
     variant('multicompat', default=False,
             description="Support gomp and the Intel openMP runtime library.")
 
+    def url_for_version(self, version):
+        if version >= Version('9.0.1'):
+            url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-{0}/openmp-{0}.src.tar.xz"
+        else:
+            url = "https://releases.llvm.org/{0}/openmp-{0}.src.tar.xz"
+
+        return url.format(version.dotted)
+
     def cmake_args(self):
 
         # Disable LIBOMP_INSTALL_ALIASES, otherwise the library is installed as


Test patch: