From nobody Fri Oct 20 15:45:24 2023 X-Original-To: dev-commits-src-main@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 4SBpnc6h5Gz4xw9J; Fri, 20 Oct 2023 15:45:24 +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 4SBpnc4cZYz3D0c; Fri, 20 Oct 2023 15:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697816724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80sp9s9+ftXJUEUk69n5Q911SA4AW4QZMXGRh6GespE=; b=Yy3KguKWTwLlHw5FrzfWVmqpeLdSpVIX/ORbbByJdMA1TIlFs/RObvE/1jpx94/kahMPJA s9P2u/GopyvR1Vi9OzWj2ZufftJIAGYsuApn6uA0E4Rj7ZuG0pO2l5xRaNwPf6R2gGlmoS pC5OHvaG6P4vLJ0wsw54ExtbkJmWNAfa8C2DrAqe9iLgU/LLLcg+sAT02OALz3tQ+bFzTn X/Q6RHPek/kbeGkveqTYmkiIDCPIYJWuW+JsrUZmXE94I2FpfzflhNsM398rbad+T2SqT4 J9m3x4ZOrD8TyRCiCcyiYXUrOBS/c8jC7r21ueM0gw55cPX96OPrghtpD7V4pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697816724; a=rsa-sha256; cv=none; b=hYd7jUqWnm86ZP+9r1QMy9SEuKhEmoaqT7Vycj0sL+Lf7X2/ZwYWfLETgT27HM9evNXUNv fTIkLLGvNPW1sZlSO3IQOeqruQh8dM3vrjR6InsGIpM8oUl0CNElNi941x4e/z5eCm/82A 6mIoBrH+V0+eOK305fyf5LacRq3WmDeLOvZXGz2S1hOy4f73dLO2X2SSJ+me5Cf+RXcKqK Wl8o3qlouNdLZX3Y/IqltN9/Zy2/L0DT1kE7j6iwwrQiXXPszPQPWIjczj+ZIbbpZbT1vP j2NFlwWvUMYHwT8+e19xsdRut1HizLJp8H/z7VSYkLxtwBAla3IsN5FwGA+2+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697816724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80sp9s9+ftXJUEUk69n5Q911SA4AW4QZMXGRh6GespE=; b=QTe3I31J6v/0u66Nx0j7ZH4x83UTgp8Cu8dleHWSgbK+z4Cqd43ZHxeMw0Up9a5ZMjmU1C 2NgBkeYSfrR2f8Z3Bsx52HQ2r9CHX9Tm38kUMjggby8/RGDXHi6UWue/+fp60F8dkIUSez R67FccW2m4UjDm7lX7mH69q5mWe8fR7jC+QPDxt7t/Ht25zCQiGn8F1JbvGauEQjFsJLYT 7r8K5oEuFupcg5FwuVy4f641/qZPf/xQvm9kLvI8VpwPzDEWhB2+1NZjzQ+j+lehb0CvRR cxjC8PN+bkDCRn/md17IEn5v9Mav58laQf9VM+aq15RG1S0Lt+tXwHt6pLi48Q== 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 4SBpnc3PfHzf3l; Fri, 20 Oct 2023 15:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39KFjOSI005026; Fri, 20 Oct 2023 15:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39KFjOLA005023; Fri, 20 Oct 2023 15:45:24 GMT (envelope-from git) Date: Fri, 20 Oct 2023 15:45:24 GMT Message-Id: <202310201545.39KFjOLA005023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ceefd491c7f0 - main - tools/build: Support building with glibc 2.38 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ceefd491c7f0490515fadca2f3740cb24e3f449e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ceefd491c7f0490515fadca2f3740cb24e3f449e commit ceefd491c7f0490515fadca2f3740cb24e3f449e Author: Andrew Turner AuthorDate: 2023-10-20 15:45:06 +0000 Commit: Andrew Turner CommitDate: 2023-10-20 15:45:06 +0000 tools/build: Support building with glibc 2.38 Ubuntu 23.10 uses glibc 2.38. This adds strlcpy and strlcmp so we need to remove them from the cross build environment. Reviewed by: jrtc27 (earlier version), arichardson Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42303 --- tools/build/Makefile | 10 ++++++++-- tools/build/cross-build/include/linux/string.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index a19d2bf64bc6..668a7198e228 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -196,9 +196,15 @@ SRCS+= strtonum.c merge.c heapsort.c reallocf.c SRCS+= rpmatch.c .if ${.MAKE.OS} == "Linux" -# On Linux, glibc does not provide strlcpy,strlcat or strmode. +# On Linux, glibc does not provide strmode. It only provides strlcpy +# and strlcat from glibc 2.38. .PATH: ${LIBC_SRCTOP}/string -SRCS+= strlcpy.c strlcat.c strmode.c +SRCS+= strmode.c +# Assume if strlcpy exists so does strlcat +_WITH_EXPLICIT_STRLCPY!= cat ${HOST_INCLUDE_ROOT}/strings.h ${HOST_INCLUDE_ROOT}/string.h | grep -c strlcpy || true +.if ${_WITH_EXPLICIT_STRLCPY} == 0 +SRCS+= strlcpy.c strlcat.c +.endif # On Linux, glibc provides ffs* but not fls* SRCS+= fls.c flsl.c flsll.c # Compile the fgetln/fgetwln/closefrom fallback code from libbsd: diff --git a/tools/build/cross-build/include/linux/string.h b/tools/build/cross-build/include/linux/string.h index 87347df1e9bf..8fac9e0fe083 100644 --- a/tools/build/cross-build/include/linux/string.h +++ b/tools/build/cross-build/include/linux/string.h @@ -47,8 +47,11 @@ #include __BEGIN_DECLS +#if !defined(__GLIBC__) || \ + (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 38) || !defined(_GNU_SOURCE))) size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz); +#endif char *strnstr(const char *str, const char *find, size_t str_len); void strmode(mode_t mode, char *str);