Page MenuHomeFreeBSD

libc: Fix build on case-insensitive file systems
ClosedPublic

Authored by jrtc27 on Sep 10 2021, 12:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 11:50 AM
Unknown Object (File)
Mar 22 2024, 12:42 AM
Unknown Object (File)
Feb 9 2024, 10:45 AM
Unknown Object (File)
Jan 27 2024, 12:03 AM
Unknown Object (File)
Dec 20 2023, 3:50 AM
Unknown Object (File)
Dec 12 2023, 7:22 AM
Unknown Object (File)
Nov 20 2023, 10:20 AM
Unknown Object (File)
Nov 11 2023, 11:51 PM
Subscribers

Details

Summary

On case-insensitive file systems (most likely to be seen on macOS, where
it is the default), _Fork.o for the new POSIX _Fork function conflicts
with _fork.o for the PSEUDO file. This results in non-determinsitic
behaviour in terms of which ends up being present; if _Fork.o wins then
the build fails to link libc.so due to missing __sys_fork, and if
_fork.o wins then libc silently fails to include the implementation of
_Fork. A similar issue occurred in the past for C99's _Exit conflicting
with exit(2) and was fixed in cb1cb6a2a83f, so this adds a fix based on
that.

As a longer-term solution it might be better to instead make the
generated files use a different prefix that's less likely to conflict
with other things (such as __sys_foo.o given they always contain that)
but that's a rather more invasive change.

Fixes: 49ad342cc10c ("Add _Fork()")
MFC after: 1 week

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41455
Build 38344: arc lint + arc unit

Event Timeline

Please just rename _Fork.c to something else, if it makes an issue. Next people to complain would be somebody without symlinks, like new and improved MacOSX users.

In D31895#719630, @kib wrote:

Please just rename _Fork.c to something else, if it makes an issue. Next people to complain would be somebody without symlinks, like new and improved MacOSX users.

Well you're SOL if your system doesn't support symlinks, that's an extremely hard requirement of our build... but sure I can do that, just figured it was best to copy an existing "solution"

Just rename the file rather than adding a symlink at build time

This revision is now accepted and ready to land.Sep 10 2021, 12:16 AM