[Bug 268196] devel/llvm1[2-5]: fix build with clang 15

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 06 Dec 2022 14:11:59 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268196

            Bug ID: 268196
           Summary: devel/llvm1[2-5]: fix build with clang 15
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: dim@FreeBSD.org

When building llvm12 through llvm15 with clang 15 as host compiler (see bug
265425), and when compiler-rt is enabled, there will be errors due to float16
support, similar to:

    In file included from
/wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/extendhfsf2.c:11:
    In file included from
/wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/fp_extend_impl.inc:38:
   
/wrkdirs/usr/ports/devel/llvm15/work/llvm-project-15.0.6.src/compiler-rt/lib/builtins/fp_extend.h:44:9:
error: _Float16 is not supported on this target
    typedef _Float16 src_t;
            ^

This is because compiler-rt's CMake infrastructure detects float16 support at
configure time, while targeting 'pure' x86_64, but then builds parts of its
tree also targeting i386.

To work around this, modify compiler-rt's top-level CMakeLists.txt to move
setting the -DCOMPILER_RT_HAS_FLOAT16 compilation flag to the arch-specific for
loop, so it only gets enabled for x86_64, and not for
i386.

For llvm15, also add another modification that removes the bfloat16 source
files from the i386_SOURCES list, so these are not built for i386.

-- 
You are receiving this mail because:
You are the assignee for the bug.