autotools.py: set lt_cv_apple_cc_single_mod=yes (#48671)
Since macOS 15 `ld -single_module` warns with a deprecation message, which makes configure scripts believe the flag is unsupported. That in turn triggers a code path where `archive_cmds` is set to ``` $CC -r -keep_private_externs -nostdlib ... -dynamiclib ``` instead of just ``` $CC -dynamiclib ... ``` This code path was meant to trigger only on ancient macOS <= 14.4 where libtool had to add `-single_module`, which is the default since macos 14.4, and is now apparently deprecated because the flag is a no-op for more than 15 years. The wrong `archive_cmds` causes actual problems combined with a bug in OpenMPI's compiler wrapper (`CC=mpicc`), which appends `-rpath` flags, which cause an error when combined with the `-r` flag added by the autotools. Spack's compiler wrapper doesn't do this, but it's likely there are other compiler wrappers out there that are not aware that `-r` and `-rpath` cannot be combined. The fix is to change defaults: `lt_cv_apple_cc_single_mod=yes`.
Please register or sign in to comment