From nobody Fri Dec 19 21:23:55 2025 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 4dY0sD2ZZtz6KKWQ for ; Fri, 19 Dec 2025 21:24:00 +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 4dY0sD24xyz3SXZ for ; Fri, 19 Dec 2025 21:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766179440; 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=s0VZQREOC0pxvR9kJZXiFWrNlM1CaWtsSMBDbwbZIwocCtFYSsD6RBLYV/QOPWW5QKh3mE n6+8DloeHyk1DfI76f9ol2JYOmIHLAZKXoeJwTIbEnM8TvIVbE3fhPSNGecAJkyOgwJtzH 9KpBIXiWIhNRSB4+hRxkhsacDf7rBvjMUSVlkQGKPggMHaY5D6lyn3oiQvTkfhmsH+7tZQ iOgLQFCqHfX+U0F8LSjEkN8bei5keCL5rftOWXUGr5ps/jPPQK+BaGDUDBP20DWTVbQuH2 Ku5Aqg0VHnvf0eBSxErd760jrHZAFSuBN2CXQbHGS8/lY0/ZDmmOwDH0JZcUAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766179440; 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=oyEJpSopyNT/Uw0CP5rnipqJHHplCcKGQPlM7YZJPEwOljlNdBDaM4rjAlZHRVmat/VDAf E1PfuCuZ9CJrMGCmmYQn0JW5j/zG39NRHAw56Q+c9Qlhb3Q3D2274r4CSRf+KYWYm+ffQ/ JFaxBIzphVkqGx4c+Ei2tZDwnIDK2lAFDDQa9eZIXATOAu+rd8Dj7EUSW0zasCJulh6ns9 0peKa4K/1HVXHnRZ0vEOEVAHDYHK94iUVjJx2Wb5AB3fqgaxOK4c/5QhmU5RV6bc8lV6BG 8ofvfl1daUNsXL+rHT+80BHSXmh2Wcjww8uXynF5R++FXcuCNtUGo+nsJP3skg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766179440; a=rsa-sha256; cv=none; b=NNFtHb1sT5/zdAtRsAvDJsrEllgx6gI/AJZ5AI2m5uK9PEz5wgCeB2GMEXh/gNb4CQAwjx 3nzQ2hmpd0B4SuBwU1sT8jZlaUULmiw8vUkkfmkFRRJlALFzjzb/ud2HxZ2dggwUk4fVBR tyegVV78DqWjE3DylKYzc1cAvChcHhZINxydiz38JHT70WvCTYqZySQN8jJN1DjZ0VwGQ+ BdtScq3LD28w8EUm6nY/S0P4P3y5xoWZdj9GkQ/4hFwcyEmJ6gm7sCj88HPj65Xj3Jx+VR NDqZUJ3sCZP41wBwsXEmMUOLWg4DetwuVCpAkOM4g9szRnr8xLC5QJ92WYsY1Q== 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 4dY0sD1gg7z9LC for ; Fri, 19 Dec 2025 21:24:00 +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 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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