From nobody Fri Dec 19 21:23:55 2025 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 4dY0s735mnz6KKfQ for ; Fri, 19 Dec 2025 21:23:55 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dY0s72J9Rz3SD2 for ; Fri, 19 Dec 2025 21:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766179435; 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=FXRLCauoI4YgUI9EFpv1cCFGtWhP7clQejbvR9RqDws=; b=i+Ht9qLtwnPlwWnDVNw+6d0OIrGrhB49vDNbjkDxtQiLY1nuAeHVopUXAx+IpudBE27tzl 1z+8UJTTi2YhB24IgmL/r/XDXjF/Uy8m0s6rZ9J/28dcDLWxGY9grflyR4J7g9E0xAK27J GGTYiGmbgof/aO8dxx2w6AwAZv4UwVgkObyMZrU3gsvYuKjfviy8gCFYPUzx1C/hwcD5i8 Sc8m6SxiphMH4p3dz/q7TzF7OrXWYyq58tGMrg12FW3ehz23ehU9AbMktehrwahNVfnBDq x0D4He3qWIRnCwstoDjBXcXPhpto3zoYlV5Lxs+eJkAvQt7/edO8Hm5GYc4Ptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766179435; 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=FXRLCauoI4YgUI9EFpv1cCFGtWhP7clQejbvR9RqDws=; b=mHp4LDxJpKh8sTlQflcfWE+v4P6WXkJYw6Sby4fq2J2+0qT2umxTk0xZJLuCQZUNPnNbnH AmEToLRAOFL6P2c2RtO8XQukn+eyHWYbJgo8ldclWGQrUiC9ynPz+ZCsxhTo90GNGV/7uG Cgt2crrleG+I5FAsNgwAKNJOPzYYw8oAeu2K+O9f0hVn66EPkoCgQ+cwZvnc1fd2FYkrMy BgZeGNdIXD8WYEoiYi/mGk0VL4E9K/XMCzgMHqgphJDocembubqs+52Riwc1uyjjH3powQ c7FJ0XT7bj85PX6gvEFm491fyu2OgBaUjgaMGA6lypehDmTyDUno+XKBk+ftlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766179435; a=rsa-sha256; cv=none; b=UUGTJ1t/PR10b1UskpIWXBDgRiphfVYzl1RnyiBH6ggyBW0bqONoZ9D2UpM3bQKYfZfZnC HE9TuMHsgeQpGSSRY1BDIV25Xd9TNSqve8dYABeAYRUVhXYy5SyBydpWNsiAU+/TzdF6st tYzhib/GuKK0+oq86tl4sdX4at662j/cSaU58uE5ddgNrSvpuA1HLF3w0lG8YSNDoYw3vC LpBwgklTZGZPMnWV6uqHq3G2I0DTKx0yXnhCB0B0Ux3N/f0kkvsuyV6eBuXe+gk4pClMt6 BUI8rTup3+w3WIBbpgn0mTNc4S9Vh1kn2M8cLhFULW2yo+6bbSzFLmopeCgxeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dY0s71ht1z92H for ; Fri, 19 Dec 2025 21:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3eb1f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Dec 2025 21:23:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 34892a8e3005 - main - LinuxKPI: bitcount fix builds with gcc and older llvm 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34892a8e30055000352d9612ad985be550c82bea Auto-Submitted: auto-generated Date: Fri, 19 Dec 2025 21:23:55 +0000 Message-Id: <6945c26b.3eb1f.3982f226@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=34892a8e30055000352d9612ad985be550c82bea commit 34892a8e30055000352d9612ad985be550c82bea Author: Bjoern A. Zeeb AuthorDate: 2025-09-15 23:52:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-12-19 21:19:28 +0000 LinuxKPI: bitcount fix builds with gcc and older llvm LLVM before 19 and gcc before 14 do not support __builtin_popcountg(). Use __const_bitcount from sys/bitcount.h as a replacement in these cases. This should still allow drm-kmod to build where the size needs to be known at compile-time. Remove the conditional for gcc around the iwlwifi modules build, which was collateral damage in all this. Sponsored by: The FreeBSD Foundation Fixes: 7cbc4d875971, 5e0a4859f28a MFC after: 3 days Reviewed by: brooks, emaste (without the sys/modules/Makefile change) Differential Revision: https://reviews.freebsd.org/D54297 --- sys/compat/linuxkpi/common/include/linux/bitops.h | 8 ++++++++ sys/modules/Makefile | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index a5a7abd55287..8fac80820f30 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -57,10 +57,18 @@ #define hweight64(x) bitcount64(x) #define hweight_long(x) bitcountl(x) +#if __has_builtin(__builtin_popcountg) #define HWEIGHT8(x) (__builtin_popcountg((uint8_t)(x))) #define HWEIGHT16(x) (__builtin_popcountg((uint16_t)(x))) #define HWEIGHT32(x) (__builtin_popcountg((uint32_t)(x))) #define HWEIGHT64(x) (__builtin_popcountg((uint64_t)(x))) +#else +/* LLVM before 19, gcc before 14. */ +#define HWEIGHT8(x) (__const_bitcount8((uint8_t)(x))) +#define HWEIGHT16(x) (__const_bitcount16((uint16_t)(x))) +#define HWEIGHT32(x) (__const_bitcount32((uint32_t)(x))) +#define HWEIGHT64(x) (__const_bitcount64((uint64_t)(x))) +#endif static inline int __ffs(int mask) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index bf3588926acf..83099c5fff14 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -582,10 +582,7 @@ _mlx5ib= mlx5ib _ena= ena _gve= gve _igc= igc -# gcc13 and earlier lack __builtin_bitcountg used by linux emulation -.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 140000) _iwlwifi= iwlwifi -.endif _rtw88= rtw88 _rtw89= rtw89 _vmware= vmware