Skip to content

macOS linking -flat_namespace changes user-facing behavior #11937

@Axel-Naumann

Description

@Axel-Naumann

From @henryiii :

ROOT can't pass homebrew's audit any more because it is now injecting -flat_namespace. Flat namespaces have been deprecated since the move to Intel. I believe this was done due to -undefined dynamic_lookup producing a warning - Apple plans to add something to replace this in the future, but it's not the old -flat_namespace. See Homebrew/homebrew-core#114543 (comment)
Flat namespace makes major changes to the layout, is more deprecated than dynamic_lookup, and isn't supposed to even work in conda-forge. See also pybind/pybind11#4301 .
-undefined dynamic_lookup does silence the linker on missing symbols, that's what it's for. The problem is that the method it uses is deprecated, producing a warning (and already broken in iOS) -flat_namespace doesn't just silence the linker, it changes the binary layout for every symbol. You could always just silence the warning -Wl,-w or -Wl,-no_fixup_chains; this will eventually break, but is less deprecated than -flat_namespace.
Apple's official statement is basically "live with the warning for now, we'll find a way to not break all CPython extensions eventually" from what I gather.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions