From 379fe632a382a97e7a374f81aac7ae131e758a74 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 30 Oct 2025 18:52:23 +0500 Subject: [PATCH] build-all.py - switch to dynamic_lookup 1) `-undefined,suppress` is deprecated and linking is sending warnings about it and it seems to be superseded by `dynamic_lookup` 2) `-flat_namespace` is not compatible with GMP when building for intel, for some reason and results in horrible errors during linking: Example error: ``` ld: branch8 out of range 366651 in ___gmpn_add_nc final section layout: __TEXT addr=0x00000000, size=0x02d09000, fileOffset=0x00000000 __text addr=0x00001400, size=0x0264a5e4, fileOffset=0x00001400 __stubs addr=0x0264b9e4, size=0x0000423c, fileOffset=0x0264b9e4 __stub_helper addr=0x0264fc20, size=0x00006c58, fileOffset=0x0264fc20 __gcc_except_tab addr=0x02656878, size=0x002efc04, fileOffset=0x02656878 __const addr=0x02946480, size=0x001cdc18, fileOffset=0x02946480 __cstring addr=0x02b140a0, size=0x0014324b, fileOffset=0x02b140a0 __unwind_info addr=0x02c572ec, size=0x0008d2d0, fileOffset=0x02c572ec __eh_frame addr=0x02ce45c0, size=0x00024a30, fileOffset=0x02ce45c0 __DATA_CONST addr=0x02d09000, size=0x0022b000, fileOffset=0x02d09000 __got addr=0x02d09000, size=0x00001dc8, fileOffset=0x02d09000 __mod_init_func addr=0x02d0adc8, size=0x00000690, fileOffset=0x02d0adc8 __const addr=0x02d0b460, size=0x00227fd0, fileOffset=0x02d0b460 __DATA addr=0x02f34000, size=0x000c3000, fileOffset=0x02f34000 __la_symbol_ptr addr=0x02f34000, size=0x000056a0, fileOffset=0x02f34000 __data addr=0x02f396a0, size=0x0005f7b8, fileOffset=0x02f396a0 __thread_vars addr=0x02f98e58, size=0x000006d8, fileOffset=0x02f98e58 __thread_ptrs addr=0x02f99530, size=0x00000178, fileOffset=0x02f99530 __thread_data addr=0x02f996b0, size=0x000000d8, fileOffset=0x02f996b0 __thread_bss addr=0x02f99790, size=0x00018850, fileOffset=0x02f99790 __bss addr=0x02fb1fe0, size=0x0003b0c0, fileOffset=0x00000000 __common addr=0x02fed0a0, size=0x00009098, fileOffset=0x00000000 __LINKEDIT addr=0x02ff7000, size=0x0148e000, fileOffset=0x02fb2000 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` --- nix/build-all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/build-all.py b/nix/build-all.py index 4a8f2729fa..4b87fd2bf6 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -1452,7 +1452,7 @@ if "IfcOpenShell-Python" in targets: # On OSX the actual Python library is not linked against. ADDITIONAL_ARGS = "" if platform.system() == "Darwin": - ADDITIONAL_ARGS = "-Wl,-flat_namespace,-undefined,suppress" + ADDITIONAL_ARGS = "-Wl,-undefined,dynamic_lookup" if "wasm" in flags: ADDITIONAL_ARGS = "-Wl,-undefined,suppress"