Page MenuHomeFreeBSD

LinuxKPI: bitcount fix gcc and older llvm builds
AcceptedPublic

Authored by bz on Thu, Dec 18, 10:28 PM.
Tags
None
Referenced Files
F140032027: D54297.id168371.diff
Fri, Dec 19, 7:43 AM
F140028703: D54297.id168371.diff
Fri, Dec 19, 6:30 AM
F140028584: D54297.id.diff
Fri, Dec 19, 6:27 AM
F140026817: D54297.diff
Fri, Dec 19, 5:50 AM
Subscribers

Details

Reviewers
dumbbell
imp
brooks
emaste
Group Reviewers
linuxkpi
Summary

LLVM before 19 and gcc before 14 do not support builtin_popcountg().
Use
const_bitcount<n> from sys/bitcount.h as a replacement in these
cases. This should still allow drm-kmod to build with size to be known
at compile-time.

Sponsored by: The FreeBSD Foundation
Fixes: 7cbc4d875971, 5e0a4859f28a
MFC after: 3 days
X-MFC: remove sys/modules/Makefile checks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69385
Build 66268: arc lint + arc unit

Event Timeline

bz requested review of this revision.Thu, Dec 18, 10:28 PM
bz planned changes to this revision.Thu, Dec 18, 10:41 PM

And that makes me find that __const_bitcount<n> is another local change; I'll update this in a minute

Adding @emaste as I found @dumbbell 's version through the stack of local changes you carry.

And for reference; pushing this out was triggered by https://reviews.freebsd.org/D54266

This revision is now accepted and ready to land.Fri, Dec 19, 9:55 AM