summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2022-11-23 10:27:44 -0600
committerGitHub <noreply@github.com>2022-11-23 09:27:44 -0700
commitf89cc96b0ca71d80351cc5c0ee4637f02a47d325 (patch)
tree3aee00acc829d26dc0a46935f93b391cfca2b9b3
parentcf952d41d8d5c8f7c55edfd3d39e80152bd29588 (diff)
downloadspack-f89cc96b0ca71d80351cc5c0ee4637f02a47d325.tar.gz
spack-f89cc96b0ca71d80351cc5c0ee4637f02a47d325.tar.bz2
spack-f89cc96b0ca71d80351cc5c0ee4637f02a47d325.tar.xz
spack-f89cc96b0ca71d80351cc5c0ee4637f02a47d325.zip
libelf: fix build on macOS arm64 (#34036)
-rw-r--r--var/spack/repos/builtin/packages/libelf/package.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/libelf/package.py b/var/spack/repos/builtin/packages/libelf/package.py
index fb3ec7c677..b581c8306d 100644
--- a/var/spack/repos/builtin/packages/libelf/package.py
+++ b/var/spack/repos/builtin/packages/libelf/package.py
@@ -29,8 +29,23 @@ class Libelf(AutotoolsPackage):
provides("elf@0")
+ # configure: error: neither int nor long is 32-bit
+ depends_on("automake", when="platform=darwin target=aarch64:", type="build")
+ depends_on("autoconf", when="platform=darwin target=aarch64:", type="build")
+ depends_on("libtool", when="platform=darwin target=aarch64:", type="build")
+ depends_on("m4", when="platform=darwin target=aarch64:", type="build")
+
+ @property
+ def force_autoreconf(self):
+ return self.spec.satisfies("platform=darwin target=aarch64:")
+
def configure_args(self):
- args = ["--enable-shared", "--disable-dependency-tracking", "--disable-debug"]
+ args = ["--enable-shared", "--disable-debug"]
+
+ # config.sub: invalid option -apple-darwin21.6.0
+ if self.spec.satisfies("platform=darwin target=aarch64:"):
+ args.append("--build=aarch64-apple-darwin")
+
return args
def install(self, spec, prefix):