Skip to content

[core] Avoid linking against private Apple library with ACLiC - #23620

Merged
dpiparo merged 1 commit into
root-project:v6-40-00-patchesfrom
dpiparo:libffi_macos27
Oct 6, 2026
Merged

dpiparo merged 1 commit into
root-project:v6-40-00-patchesfrom
dpiparo:libffi_macos27

Conversation

@dpiparo

@dpiparo dpiparo commented Oct 6, 2026

Copy link
Copy Markdown
Member

Partial BP of #22963

`TSystem::CompileMacro`, aka `ACLiC`, can generate a shared library from a ROOT macro. While doing so, it links the target library against all loaded libraries at time of calling.

When running from Python e.g. via `ProcessLine(".L macro.C+")`, the loaded libraries include those dynamically loaded by the Python interpreter.

When run on a MacOS system, these may also include so-called "private" Apple libraries. These libraries cannot be linked against by third-party code: the linker will fail with an error saying "product being built is not an allowed client of it".

One such situation has surfaced in a bug report to the homebrew distribution of ROOT Homebrew/homebrew-core#272324 related to the `libffi` library, but the issue is actually generic.

Unfortunately, Apple does not provide an authoritative list of "private" libraries and there is no direct way to ask a library whether linking against it will produce a linker error or not.

Aside from manually checking the list of allowed clients of each of the loaded libraries before linking, manually vetoing known "private" libraries seems the next-best thing. This commit proposes to remove the `libffi` library from the list of libraries `ACLiC` will link against when run on MacOS.
@dpiparo dpiparo self-assigned this Oct 6, 2026
@dpiparo
dpiparo requested a review from pcanal as a code owner October 6, 2026 06:56

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to merge as is (it is effective even-though the original still need to be improved to move the filtering alongside the other similar filtering)

@dpiparo
dpiparo merged commit b460244 into root-project:v6-40-00-patches Oct 6, 2026
34 of 37 checks passed
@dpiparo
dpiparo deleted the libffi_macos27 branch October 6, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants