Bug 272235 - devel/llvm-devel: Build error on CURRENT due to cpuset size change
Summary: devel/llvm-devel: Build error on CURRENT due to cpuset size change
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-26 21:30 UTC by John F. Carr
Modified: 2023-06-27 17:45 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (brooks)


Attachments
cpuset is 1024 rather than 256 since FreeBSD version 1400090 (882 bytes, text/plain)
2023-06-26 21:30 UTC, John F. Carr
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2023-06-26 21:30:21 UTC
Created attachment 243022 [details]
cpuset is 1024 rather than 256 since FreeBSD version 1400090

The sanitizer libraries in llvm-devel fail to build on CURRENT because of the recent change to the size of cpuset.  See LLVM bug https://github.com/llvm/llvm-project/issues/63485


The build error looks like

/wrkdirs/usr/ports/devel/llvm-devel/work-default/llvm-project-9d1bcb70ec8830ad85c0756a03022d3811537284/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp:569:1: error: static assertion failed due to requirement 'sizeof(__sanitizer::__sanitizer_cpuset) >= sizeof(_cpuset)': 
COMPILER_CHECK(sizeof(__sanitizer_cpuset_t) >= sizeof(cpuset_t));
^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I attached a fix to make it build.  I have not tested the sanitizer libraries built with this patch.

In the context of the llvm sanitizer libraries it does not seem to be possible to include the correct header files to get the cpuset size definition.  The sanitizer libraries wrap library calls and the wrappers definitions conflict.
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-06-27 17:26:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d1f8dd148d220f4a205bb9ca39040616db9b7254

commit d1f8dd148d220f4a205bb9ca39040616db9b7254
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-06-27 17:12:15 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-06-27 17:24:48 +0000

    devel/llvm-devel: fix compiler-rt build on current

    Bump cpuset size to 1024 on newer current. Newly added sanitizer
    support for cpuset_getaffinity(2) hardcodes the size so bump it to
    match CPU_MAXSIZE (it's not obviously possible to extract it from
    sys/_cpuset.h).

    PR:             272235
    Issue:          https://github.com/llvm/llvm-project/issues/63485
    Submitted by:   jfc@mit.edu

 ...er__common_sanitizer__platform__limits__freebsd.h (new) | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2023-06-27 17:45:31 UTC
Thanks for the submission and upstream bug report! I mostly test on 13 to so missed this...