From nobody Fri Jan 16 08:49:47 2026 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 4dstp36Z6Tz6NyNt for ; Fri, 16 Jan 2026 08:49:47 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dstp33wQJz3Vqt for ; Fri, 16 Jan 2026 08:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768553387; 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=J1jR9dybXPyUWsio2bHUxOnBylc9KJK4XIJZVPDciSU=; b=HYHWn6/eH3pZkCACYQFVk5AGf3lkU2aEA0NRYV4+RVD8GOgMFBdk1q6nt3EVv3bIH2cH4u zM8XxGgW6NZAa/Vx8hMhyFsUkQPoZ2Ehggp759Q4uMJytt2DLNZIwOAh6Judi+6MDMwlsT Fkciy9McbS5KMDUh+XSZcmORIzoehY+2+e4jMNXF07Z/svULfT5Ne4nBYYqTKOJhE9U+IU lIFWZvef1fCjpxL9HGtdwq4jY/+pPtlqA0s//5WDMqcGz59+Ra8+v0VaFOjN89yGMmULwI dR6NsMhFEfsAP64Ar+msvrYVEoNQ74+pyBJLzECenSJzcvGJprvd1sHof0kRyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768553387; 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=J1jR9dybXPyUWsio2bHUxOnBylc9KJK4XIJZVPDciSU=; b=MtjZc73W6G8X2eXNCmvPfDMCuTejxp+qqOHbK2n+1kaIKueAZHmMvqp1sWdAvm7O4SonaS w+ICeOh6NG2fw1y9+FSoZFbcoJtERwM0XSskuDN3IJU5IPgaxS0wftVhoEvv9r/8k3eWCY C1cebtQ0Ne4s2cfeR6dmpbEuF/uauWogILXfOU68GF7XtTvdU1NGZxr77gwZtf6TwEfENw uuauajv3ImRrE/h0xibixWAo0vrDmmT0gxTh5Ec2SWSn3Mq4qsH03hZ9A8EBlCPzje/dsM Yh0MWHb4bXgcY/GSJntghCu/CDXHtakcqxEytZ6dkrOo75pJGbsJMaIEWIG/zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768553387; a=rsa-sha256; cv=none; b=kjbUF+FFrnNFa3sD+zf7zV6oZE6/7i6j/U4uadYNMhLHnxt3bUgeWMJA8QG8BabUO6V/Q9 2hIDHWjC3B+FSnAwdAGNFZr1ta/CYaHwp0zVPUH4QyimMxdL5AAc25tc5fDftWLunkE7YO 9n4sp8uMxE8lUDxUOuJTYWjWWqoJuWtD+DF26dmWptkKqzVJ89vr0jBdj7W9B/JovzBObJ RuhZnNXoFEIjJiVyjSl5fnXPB7FTMai0+QrNf1jI7YlXefbKF15CvFMWe1RgPm4tPEdoW2 Ewrwf+mZvrPMPYxBXxT9IIo/N2Un5QIu9ePL2GAjSsDVymJLrRINTNIKrOgEbA== 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 4dstp33WLXz16DJ for ; Fri, 16 Jan 2026 08:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id add1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 16 Jan 2026 08:49:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 9755a8036354 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 9755a80363549cc5504b4bb2d18a4a12e34ded28 Auto-Submitted: auto-generated Date: Fri, 16 Jan 2026 08:49:47 +0000 Message-Id: <6969fbab.add1.66e69a1d@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9755a80363549cc5504b4bb2d18a4a12e34ded28 commit 9755a80363549cc5504b4bb2d18a4a12e34ded28 Author: Bjoern A. Zeeb AuthorDate: 2025-09-15 23:52:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-01-16 08:48:47 +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 Reviewed by: brooks, emaste (without the sys/modules/Makefile change) Differential Revision: https://reviews.freebsd.org/D54297 (cherry picked from commit 34892a8e30055000352d9612ad985be550c82bea) --- sys/compat/linuxkpi/common/include/linux/bitops.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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)