<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/185650>185650</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Build failure: "_Float16 is not supported on this target"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          shahab-vahedi
      </td>
    </tr>
</table>

<pre>
    ### Expected behaviour
Usage of `-D LLVM_ENABLE_PROJECTS=...;compiler-rt;...` is breaking the build. The tool gives a warning about that:

```
CMake Warning at CMakeLists.txt:188 (message):
  Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a
  fatal error in a future release.  Please use
 -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at
 https://compiler-rt.llvm.org/ for building the runtimes.
```
But it should actually abort the configuration. See the next sections on how this unfolds.

### Build error
```
In file included from /tmp/llvm-project/compiler-rt/lib/builtins/extendhfsf2.c:11:
In file included from /tmp/llvm-project/compiler-rt/lib/builtins/fp_extend_impl.inc:38:
/tmp/llvm-project/compiler-rt/lib/builtins/fp_extend.h:57:9: error: _Float16 is not supported on this target
   57 | typedef _Float16 src_t;
      |         ^
```

### Steps
```
$ git clone --depth 100 https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ git log -1
 2e5e38cd5ed3e4b894b63e8af10c9be9abdbf7d9
  [AMDGPU] Update register class numbers in some tests (#185623)

$ CC=clang CXX=clang++ \
  cmake -S llvm                                  \
        -B build                                 \
        -D LLVM_TARGETS_TO_BUILD="X86"           \
        -D LLVM_ENABLE_PROJECTS="llvm;clang;lld" \
        -D LLVM_ENABLE_RUNTIMES=compiler-rt      \
        -D CMAKE_BUILD_TYPE=Release \
        -G Ninja
$ cd build
$ ninja
```

### Interesting lines from configuring
```
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at CMakeLists.txt:188 (message):
 Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a
  fatal error in a future release.  Please use
 -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at
 https://compiler-rt.llvm.org/ for building the runtimes.
...
-- Performing Test COMPILER_RT_HAS_VERSION_SCRIPT - Success
-- Looking for __i386__
-- Looking for __i386__ - found
-- Compiler-RT supported architectures: x86_64;i386
...
-- Performing Test COMPILER_RT_HAS_ARM_FP
-- Performing Test COMPILER_RT_HAS_ARM_FP - Failed
-- Performing Test COMPILER_RT_HAS_i386_FLOAT16
-- Performing Test COMPILER_RT_HAS_i386_FLOAT16 - Success
-- Performing Test COMPILER_RT_HAS_x86_64_FLOAT16
-- Performing Test COMPILER_RT_HAS_x86_64_FLOAT16 - Success
-- Builtin supported architectures: i386;x86_64
-- Performing additional configure checks with target flags:  -Werror=unguarded-availability-new -nodefaultlibs -Werror=array-bounds -Werror=uninitialized -Werror=shadow -Werror=empty-body -Werror=sizeof-pointer-memaccess -Werror=sizeof-array-argument -Werror=suspicious-memaccess -Werror=builtin-memcpy-chk-size -Werror=array-bounds-pointer-arithmetic -Werror=return-stack-address -Werror=sizeof-array-decay -Werror=format-insufficient-args -Wformat -nostdinc++ -m32
-- Performing Test COMPILER_RT_HAS_i386_BFLOAT16
-- Performing Test COMPILER_RT_HAS_i386_BFLOAT16 - Failed
-- For i386 builtins preferring i386/fp_mode.c to fp_mode.c
-- For i386 builtins preferring i386/ashldi3.S to ashldi3.c
-- For i386 builtins preferring i386/ashrdi3.S to ashrdi3.c
-- For i386 builtins preferring i386/divdi3.S to divdi3.c
-- For i386 builtins preferring i386/floatdidf.S to floatdidf.c
-- For i386 builtins preferring i386/floatdisf.S to floatdisf.c
-- For i386 builtins preferring i386/floatundidf.S to floatundidf.c
-- For i386 builtins preferring i386/floatundisf.S to floatundisf.c
-- For i386 builtins preferring i386/lshrdi3.S to lshrdi3.c
-- For i386 builtins preferring i386/moddi3.S to moddi3.c
-- For i386 builtins preferring i386/muldi3.S to muldi3.c
-- For i386 builtins preferring i386/udivdi3.S to udivdi3.c
-- For i386 builtins preferring i386/umoddi3.S to umoddi3.c
-- For i386 builtins preferring i386/floatdixf.S to floatdixf.c
-- For i386 builtins preferring i386/floatundixf.S to floatundixf.c
-- Performing additional configure checks with target flags:  -Werror=unguarded-availability-new ...
```

### Environment
On an x86_64 Ubuntu 24.04 LTS with host `clang` :
```
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```

### Correct usage

Users must use

```
        ...
        -D LLVM_ENABLE_PROJECTS="llvm;clang;lld" \
        -D LLVM_ENABLE_RUNTIMES=compiler-rt      \
 ...
```
instead of
```
        ...
        -D LLVM_ENABLE_PROJECTS="llvm;clang;lld;compiler-rt" \
        ...
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWEtz47gR_jXwpYssCpRk6aCDnhMn9thlybuTkwokmiLWIMDCw5b316dAUrYsr2dGu9nKJSodSKK_fuFDowFmrdgpxAkZzMhgccG8K7WZ2JKVLIueWIlcXGSav0wITds_LPc15g45ZFiyJ6G9Icn0wbIdgi6ADJNoAdfXv9xsl1-ns-vl9u7-9p_L-WZN0kUcxySd5bqqhUQTGUfSWfg2TEBYyAyyR6F24EqEzAvJY9iUCE5rCTvxhBYYPDOjggzLtHfgSuZIOiVJ8x8m3T-Zzm_YI8KvB2EHzYdrYZ2N3T5geqMREDqq0AbXCR23egAebIB8EsGR78FljrXBnIVsKP1M6ByY4vAspIQMc10hsEZnwRyTgMZoA0IBg8I7bxAMSmQWY4C75gG8xQCIFsf27x--bq5ulqf2tQGL2GRLKOuMz53QygJzQUXpXG1DTHRF6OoIF0v5VMXa7AhdQaFNm-pD3o1XTlRo45OEzrwD4cCW2ksOLHeeSfkSpsG4BphrVYidNyw4EcO680zh3oHFzjWtoNTP4EphwatCS94aSqZv_JoFd9pcnfhw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