From a07d42d35bacf721616b45466ce1227c47cb1618 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 21 Oct 2024 10:32:14 -0700 Subject: Devtools darwin (#46910) * stacks: add a stack for devtools on darwin After getting this whole mess building on darwin, let's keep it that way, and maybe make it so we have some non-ML darwin binaries in spack as well. * reuse: false for devtools * dtc: fix darwin dylib name and id On mac the convention is `lib..dylib`, while the makefile creates a num suffixed one by default. The id in the file is also a local name rather than rewritten to the full path, this fixes both problems. * node-js: make whereis more deterministic * relocation(darwin): catch Mach-O load failure The MachO library can throw an exception rather than return no headers, this happened in an elf file in the test data of go-bootstrap. Trying catching the exception and moving on for now. May also need to look into why we're trying to rewrite an elf file. * qemu: add darwin flags to clear out warnings There's a build failure for qemu in CI, but it's invisible because of the immense mass of warning output. Explicitly specify the target macos version and remove the extraneous unknown-warning-option flag. * dtc: libyaml is also a link dependency libyaml is required at runtime to run the dtc binary, lack of it caused the ci for qemu to fail when the library wasn't found. --- lib/spack/spack/relocate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 67e980625e..627c9e2b05 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -283,7 +283,11 @@ def modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): def macholib_get_paths(cur_path): """Get rpaths, dependent libraries, and library id of mach-o objects.""" - headers = macholib.MachO.MachO(cur_path).headers + headers = [] + try: + headers = macholib.MachO.MachO(cur_path).headers + except ValueError: + pass if not headers: tty.warn("Failed to read Mach-O headers: {0}".format(cur_path)) commands = [] -- cgit v1.2.3-70-g09d2