Page MenuHomeFreeBSD

LinuxKPI: conditionally add __flex_counter()
ClosedPublic

Authored by bz on Tue, Apr 14, 3:33 PM.
Tags
None
Referenced Files
F153506284: D56393.id.diff
Tue, Apr 21, 12:37 PM
Unknown Object (File)
Tue, Apr 21, 5:14 AM
Unknown Object (File)
Tue, Apr 21, 2:58 AM
Unknown Object (File)
Mon, Apr 20, 4:41 AM
Unknown Object (File)
Sun, Apr 19, 10:13 AM
Unknown Object (File)
Sat, Apr 18, 7:57 AM
Unknown Object (File)
Sat, Apr 18, 7:57 AM
Unknown Object (File)
Sat, Apr 18, 6:12 AM
Subscribers

Details

Summary

flex_counter() is used by overflow.h and needed for "flex allocations".
It is either a void * typed 0 (NULL) (like this for _Generic checks),
or uses
builtin_counted_by_ref.

The latter was added to gcc and llvm fairly recently and while for gcc
the __has_builtin() check suffices, clang had parts broken until recently
so needs an extra check for the next major version. The fixed hash is
currently not part of any tag to use, so we play it save (and hope 23
will have it). It will be a while until we will see the builting to be
used but at least we will be prepared for it. See inline comments for
the commit hashes and versions which added the feature.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable