Skip to content

Conversation

@topolarity
Copy link
Member

Somewhat of a companion to #60248.

For a small application that has just started up fork() is not a huge concern, but it's quite heavy-handed for Julia- as-a-library scenarios where resident memory may already be large. Many soft-embedded targets also do not support fork() well, so it is good for our compatibility to adjust this.

Rather than relying on the linker to do all of the heavy lifting, this changes our libstdcxx probe sequence to directly parse the ld.so.cache and libstdc++.so.6 files. As long as we can expect /etc/ld.so.cache to be the same path on all Linux systems, this seems to be a reliable way to locate system libraries.

@topolarity topolarity added the system:linux Affects only Linux label Nov 26, 2025
@topolarity topolarity marked this pull request as draft November 26, 2025 17:26
@topolarity topolarity force-pushed the ct/forkless-libstdcxx-probe branch 3 times, most recently from 79f02b0 to b668d14 Compare November 26, 2025 17:42
@topolarity topolarity marked this pull request as ready for review November 26, 2025 17:46
@topolarity topolarity force-pushed the ct/forkless-libstdcxx-probe branch from b668d14 to 535e217 Compare November 27, 2025 01:16
Rather than relying on the linker to do all of the heavy lifting, this
changes our probing technique to directly parse the `ld.so.cache` and
`libstdc++.so.6` files. As long as we can expect `ld.so.cache` to be
available in `/etc` on all systems, this seems to be a reliable way to
locate system libraries on Linux systems.

That allows us to avoid `fork()`. For a small application that has just
started up `fork()` is no big deal, but it's quite heavy-handed for Julia-
as-a-library scenarios where resident memory may already be large.

Many soft-embedded targets also do not support fork() well, so it is
good for our compatibility to adjust this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant