From nobody Thu Aug 18 01:46:45 2022 X-Original-To: dev-commits-src-all@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 4M7SRT6nmlz4YvCM; Thu, 18 Aug 2022 01:46:45 +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 4M7SRT6D0rz3lTd; Thu, 18 Aug 2022 01:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660787205; 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=bXIWluRMhP68W0KQEOFfjONJMrHlEpzZp8jmmhaiZzI=; b=fJ7yRUGMobsUNnqCKvvXouHaJ+kTrUMJXAZIiztjqY5CJ4oi0MphX8Rgsq5WJIeOKCujXS 59en67tDZujz48mAs0/mk4kZcyQFrTeoOQOrZzUn2j9ixjcFaZ7t0CTBptecqdm/iTq6iC q4NQuHfEFnK8baryQJ9g/NtGD/OQwow2osfM7PWIHq9GQDDvhV3W1yNPbVv5J9eA/sW97/ MNYf4dU3owM3IK3CMm7HDaMYjjMsmneRW/LBwspQWjNa/TkLuKlJa/gUJF5HvKaCSf2DEV D12cfibKL+0wK6l/ELE+TM3wl0I4NETSBN25inPQ0h7DUzWiex4rBuCR/7U9cA== 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 4M7SRT5KyRz1B9g; Thu, 18 Aug 2022 01:46:45 +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 27I1kjob095095; Thu, 18 Aug 2022 01:46:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27I1kjJ4095094; Thu, 18 Aug 2022 01:46:45 GMT (envelope-from git) Date: Thu, 18 Aug 2022 01:46:45 GMT Message-Id: <202208180146.27I1kjJ4095094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 548f8a657bc1 - main - tools/build: Provide fls* when cross-building on Linux List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 548f8a657bc13dfa9c51b0c67ccdb33badfa916e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660787205; 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=bXIWluRMhP68W0KQEOFfjONJMrHlEpzZp8jmmhaiZzI=; b=vJBu5kUNrkgHdlWIrVtxbqu0li39GE6ap6Zvqn8nM39zGbSbnj1hMUVAZsWjyn27h50L8I j0JYaEMEPuLRueCZonGqvJ09a8CMF2D9tkkj334BBpEMj4D93Z2qI64QzI0nuykbk8ukkY idO259MuFrpGCmv7MKdrCToNu/shJw6LpVehjs9Owjv6i1Z8RbXEUexkDYCuqG6OaXUMnR toUV+KWGZoK49F984qMGNana8n7pH9cXGVnOZer+746Bf+xQYkfkLDgwB1ZFwbesAg5ZvH 8B7gPT7BeIBwfrBHd0vRYmtJi1nYCqROUfgrOIa3lIovARJvuz/FFi8R7puRZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660787205; a=rsa-sha256; cv=none; b=s1WpF5m3ELDm0rzD+9Tb1yPVcKAc0UxMh1baYpE/Hvx4gv+pyAPLaj4Nuo/bUA11FBJVU9 rXidhO65aXNDbZjsyBpn8j48s3xAUS1p716rYDKkvKUU+getGNV5RSsARMSBPoKXUJw0Tu 3hXJwmi+qqC3sT1yo84Wig7Iwe506hXZPhFDIl0r5V82+AingQT4qKkogww86GflXTz5cz MkRPbKf5BZ6i8gajdJGd2OIKp8tJ72+Z/w3H+NnGuMc2ktcAT9wwJQ8MrBK2CVuymrFy2s vKGgLuhWsRQdYH3OmZIi9uTo6d/9WIhkcS1F7lTjIbZa4pKZ/+GRSvLp0dC8Gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=548f8a657bc13dfa9c51b0c67ccdb33badfa916e commit 548f8a657bc13dfa9c51b0c67ccdb33badfa916e Author: Jessica Clarke AuthorDate: 2022-08-18 01:46:28 +0000 Commit: Jessica Clarke CommitDate: 2022-08-18 01:46:28 +0000 tools/build: Provide fls* when cross-building on Linux flsll is needed for makefs's new ZFS support, and the others are added for completeness. Reviewed by: emaste, arichardson Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36134 --- tools/build/Makefile | 2 ++ tools/build/cross-build/include/linux/strings.h | 40 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/tools/build/Makefile b/tools/build/Makefile index 75dc6ab60553..8c723e8be73c 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -190,6 +190,8 @@ SRCS+= rpmatch.c # On Linux, glibc does not provide strlcpy,strlcat or strmode. .PATH: ${LIBC_SRCTOP}/string SRCS+= strlcpy.c strlcat.c strmode.c +# On Linux, glibc provides ffs* but not fls* +SRCS+= fls.c flsl.c flsll.c # Compile the fgetln/fgetwln/closefrom fallback code from libbsd: SRCS+= fgetln_fallback.c fgetwln_fallback.c closefrom.c CFLAGS.closefrom.c+= -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \ diff --git a/tools/build/cross-build/include/linux/strings.h b/tools/build/cross-build/include/linux/strings.h new file mode 100644 index 000000000000..827ef23f1c82 --- /dev/null +++ b/tools/build/cross-build/include/linux/strings.h @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2022 Jessica Clarke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once +#include + +#include_next + +__BEGIN_DECLS + +int fls(int) __pure2; +int flsl(long) __pure2; +int flsll(long long) __pure2; + +__END_DECLS