From nobody Sun Oct 10 13:38:11 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 475C812DB571; Sun, 10 Oct 2021 13:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HS30N0ln0z4k4W; Sun, 10 Oct 2021 13:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB15B67FF; Sun, 10 Oct 2021 13:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19ADcBoX035849; Sun, 10 Oct 2021 13:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19ADcBe1035848; Sun, 10 Oct 2021 13:38:11 GMT (envelope-from git) Date: Sun, 10 Oct 2021 13:38:11 GMT Message-Id: <202110101338.19ADcBe1035848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d7b3f3c84e68 - stable/13 - libc: Fix build on case-insensitive file systems List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7b3f3c84e684a613b175624cb04d51f49c0a731 Auto-Submitted: auto-generated X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d7b3f3c84e684a613b175624cb04d51f49c0a731 commit d7b3f3c84e684a613b175624cb04d51f49c0a731 Author: Jessica Clarke AuthorDate: 2021-09-10 00:19:38 +0000 Commit: Jessica Clarke CommitDate: 2021-10-10 13:33:52 +0000 libc: Fix build on case-insensitive file systems 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()") Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31895 (cherry picked from commit 877175a17a0a5da3f4f43ca9f38adb04042f4cf5) --- lib/libc/sys/Makefile.inc | 2 +- lib/libc/sys/{_Fork.c => POSIX2x_Fork.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index d0fd7bda74f5..d2b39fe65c44 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -49,7 +49,7 @@ SRCS+= closefrom.c SRCS+= pipe.c SRCS+= shm_open.c SRCS+= vadvise.c -SRCS+= _Fork.c +SRCS+= POSIX2x_Fork.c SRCS+= compat-stub.c diff --git a/lib/libc/sys/_Fork.c b/lib/libc/sys/POSIX2x_Fork.c similarity index 100% rename from lib/libc/sys/_Fork.c rename to lib/libc/sys/POSIX2x_Fork.c