From nobody Fri Jun 17 19:37:16 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 6F80285A674; Fri, 17 Jun 2022 19:37:17 +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 4LPq7K0v24z3PhB; Fri, 17 Jun 2022 19:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494637; 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=9FIM1QUBjo+649oHpXMAVgNLsuAFKCgfF/a7pgqhAjY=; b=UWAC++G7FgBibykP8huMQRhbEXXq78tszwhr1jzICbvKcP3oo43c7Lx3e080SM1Egkd9tY NH8u1fOSK5v4mBbye8Abl1QkRikvP2aXus5T7/r2UZOrUCkLr6Qrc94MCAHSKbe2Rwu8ks ESGGhqcioGnS+PovNC1KbmLJnnaKzP/z+8FQ3A3RmM3W1USfpjmgii3PcCW2aizsxSv90I EGz9MvBlJTzzkhVr/UMsR9CP7m7oH0q9A13+x7pRBR9mYY3b50HeKqrzp5JtSqvi71Y3X2 va3zoLQgh+SidQq7LJIrZX/OizXfswagAW9qlouDSv071PpXtKeOi3o1SeZNUQ== 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 99FC925AB5; Fri, 17 Jun 2022 19:37:16 +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 25HJbGj9013137; Fri, 17 Jun 2022 19:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJbGhO013136; Fri, 17 Jun 2022 19:37:16 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:16 GMT Message-Id: <202206171937.25HJbGhO013136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 85b2ff649628 - stable/13 - linux(4): Fix gcc buld. 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 85b2ff6496285c6768437884917414b9d64b4f1b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494637; 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=9FIM1QUBjo+649oHpXMAVgNLsuAFKCgfF/a7pgqhAjY=; b=kbkW1Wng367ezBRMgLDHcWKaPKUEjg68eGQR4lzliYWxbXVno6bgOBEF3peZWKLg1eWj2J f0RDpWkl8+X4ajIbzK3PxBM4zwgx37x9OWztnAq30Kq41tSxHDNxEnztAnVWvG6GC14a1O QnjzzK+onPR6U623B62CsDY3/V/XgBHIfyJeelYP7+ExEzS/fOd8Gesqvis6OrwEo7fxw/ 0sBcLs5tQRyFTxhF1dLKGUm7MO51+wTRrvvXooKrqn++hj0rFYGr6BGTlXCXsaV9/ez6Gg ueufSFpkb9bCjrKOFwrp7107pcWb4JO2lMS+h0Xi/8A8klPGTYjgAh/r92N4bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494637; a=rsa-sha256; cv=none; b=Mhz48LzJ6paTR3jysx7o18UTTieBSYiB9HYH+KnqXW/gHbPh/91yVTAMnIgN0jZdHmM/M+ WC7yldaGkpVZ6Ec2zwkQxZqKNojMEUo3RKpkMrgxLT/mkEN+aiI+RXt0wFV8Ub9l2j7xWJ Bu7QCSM8nsejEHKeCGmtmCDz1GR5Be7gapJmQPEC+eHEaPPkXysherCjiFbexyUZM01vjf ObVtw9Qrh8eD12/1orbyTCXuPM4P7wIz1Vq6LfPR39/F5ZniGHSTj7OH1YRGgMv7xNw8nF Wi3QoW2vHuO00KL+L3p9chOIdSuwg7WI3DAtxWR5N3Ub44yhDVKnDDGpoliqoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=85b2ff6496285c6768437884917414b9d64b4f1b commit 85b2ff6496285c6768437884917414b9d64b4f1b Author: Dmitry Chagin AuthorDate: 2021-07-29 06:52:33 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:14 +0000 linux(4): Fix gcc buld. gcc failed as it didn't inlined the builtins and generates calls to the libgcc, ld can't find libgcc as cross-toolchain libgcc is not installed. To avoid this add internal vDSO ffs functions without optimized builtins. Reported by: jhb MFC after: 2 weeks (cherry picked from commit f33794014468562100f6f02ab8147b58bd9f82c0) --- sys/amd64/linux/linux_vdso_gtod.c | 1 - sys/amd64/linux32/linux32_vdso_gtod.c | 1 - sys/arm64/linux/linux_vdso_gtod.c | 1 - sys/compat/linux/linux_vdso_gtod.inc | 34 ++++++++++++++++++++++++++++++++++ sys/i386/linux/linux_vdso_gtod.c | 1 - 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c index ad23dc33575a..57d3f4b45dd4 100644 --- a/sys/amd64/linux/linux_vdso_gtod.c +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #undef _KERNEL #include -#include #include #include diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c index f1573ca3c1b1..0caf787c9503 100644 --- a/sys/amd64/linux32/linux32_vdso_gtod.c +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #undef _KERNEL #include -#include #include #include diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c index 682735cf2fa1..6fdff8335f5d 100644 --- a/sys/arm64/linux/linux_vdso_gtod.c +++ b/sys/arm64/linux/linux_vdso_gtod.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #undef _KERNEL #include -#include #include #include diff --git a/sys/compat/linux/linux_vdso_gtod.inc b/sys/compat/linux/linux_vdso_gtod.inc index a90b7dc8efdf..52fab2bbc5d7 100644 --- a/sys/compat/linux/linux_vdso_gtod.inc +++ b/sys/compat/linux/linux_vdso_gtod.inc @@ -26,6 +26,40 @@ * SUCH DAMAGE. */ +static int +fls(int mask) +{ + + if (mask == 0) + return (0); + return ((__builtin_clz(mask) ^ 0x1f) + 1); +} + +#ifdef _LP64 +static int +ffsl(long mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; !(mask & 1); bit++) + mask = (unsigned long)mask >> 1; + return (bit); +} +#else +static int +ffsll(long long mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; !(mask & 1); bit++) + mask = (unsigned long long)mask >> 1; + return (bit); +} +#endif static int __vdso_native_to_linux_timespec(struct l_timespec *lts, diff --git a/sys/i386/linux/linux_vdso_gtod.c b/sys/i386/linux/linux_vdso_gtod.c index b1e4a4620ee4..046b864c54f5 100644 --- a/sys/i386/linux/linux_vdso_gtod.c +++ b/sys/i386/linux/linux_vdso_gtod.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #undef _KERNEL #include -#include #include #include