You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.subsections_via_symbols directive causes invalid symbol pruning in macOS x86-64 kernels #6089
OpenBLAS built with make TARGET=NEHALEM NOFORTRAN=1 (on Apple Silicon, the full invocation is arch -x86_64 make -j6 ARCH=x86_64 BINARY=64 CC="clang -arch x86_64" HOSTCC="clang -arch x86_64" TARGET=NEHALEM NOFORTRAN=1 shared) with Apple clang 21.0.0
The problem is that even without -Wl,-dead-strip the linker will still try to deduplicate labels unless -Wl,-no_deduplicate is provided explicitly. This happens to .L998 and .L999 in the sasum_k kernel.
I am testing via Rosetta on AArch64 macOS hardware, but I suspect this reproduces on proper x86-64 macOS targets.
Not sure what to make of this - your PRs look way too invasive for what may well be a bug in a specific linker version on an obsolescent target that (if I understand you correctly) gets triggered only by very specific non-default build options.
Agreed. The PRs are much bigger and more invasive than I would like...
I hope I can clarify the motivation. The goal for #6088 / #6087 is to allow the linker to remove unused code - #6090 is only needed to enable code pruning on macOS.
a bug in a specific linker version on an obsolescent target
x86_64-darwin happens to trigger this issue w/o dead-strip, but the problem is broader than that. The issue here happens as soon as you enable .subsections_via_symbols with a new enough clang, on any macOS target AFAIK and so dead-strip breaks OpenBLAS on macOS (incl. arm64) without #6090
The first two PRs apply to all platforms (--Wl,--gc-sections on Linux / MinGW + -Wl,-dead-strip on macOS) and they are trying to allow the linker to strip code under DYNAMIC_ARCH. Without them, gotoblas references all kernels even if you e.g. only rely on dgemm.
Activity
topolarity commentedon Oct 2, 2026
Looks like this problem is specific to Apple's new linker from 2023. Building with
-Wl,-ld_classicalso works around the issue.martin-frbg commentedon Oct 2, 2026
Not sure what to make of this - your PRs look way too invasive for what may well be a bug in a specific linker version on an obsolescent target that (if I understand you correctly) gets triggered only by very specific non-default build options.
topolarity commentedon Oct 2, 2026
Agreed. The PRs are much bigger and more invasive than I would like...
I hope I can clarify the motivation. The goal for #6088 / #6087 is to allow the linker to remove unused code - #6090 is only needed to enable code pruning on macOS.
x86_64-darwinhappens to trigger this issue w/o dead-strip, but the problem is broader than that. The issue here happens as soon as you enable.subsections_via_symbolswith a new enoughclang, on any macOS target AFAIK and so dead-strip breaks OpenBLAS on macOS (incl. arm64) without #6090The first two PRs apply to all platforms (
--Wl,--gc-sectionson Linux / MinGW +-Wl,-dead-stripon macOS) and they are trying to allow the linker to strip code underDYNAMIC_ARCH. Without them,gotoblasreferences all kernels even if you e.g. only rely on dgemm.fix(docker): pin the OpenBLAS build that keeps macOS x86_64 kernels w…
feat(build): build OpenBLAS 0.3.34 with every arm64 kernel