[all-commits] [llvm/llvm-project] f64404: [builtins] Fix divtc3.c etc. compilation on Solari...

Rainer Orth via All-commits all-commits at lists.llvm.org
Tue Sep 10 07:44:51 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f64404e32187a6f45771e72e1b65e99be82acaba
      https://github.com/llvm/llvm-project/commit/f64404e32187a6f45771e72e1b65e99be82acaba
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2024-09-10 (Tue, 10 Sep 2024)

  Changed paths:
    M compiler-rt/lib/builtins/divtc3.c
    M compiler-rt/lib/builtins/multc3.c

  Log Message:
  -----------
  [builtins] Fix divtc3.c etc. compilation on Solaris/SPARC with gcc (#101662)

`compiler-rt/lib/builtins/divtc3.c` and `multc3.c` don't compile on
Solaris/sparcv9 with `gcc -m32`:
```
FAILED: projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins-sparc.dir/divtc3.c.o
[...]
compiler-rt/lib/builtins/divtc3.c: In function ‘__divtc3’:
compiler-rt/lib/builtins/divtc3.c:22:18: error: implicit declaration of function ‘__compiler_rt_logbtf’ [-Wimplicit-function-declaration]
   22 |   fp_t __logbw = __compiler_rt_logbtf(
      |                  ^~~~~~~~~~~~~~~~~~~~
```
and many more. It turns out that while the definition of `__divtc3` is
guarded with `CRT_HAS_F128`, the `__compiler_rt_logbtf` and other
declarations use `CRT_HAS_128BIT && CRT_HAS_F128` as guard. This only
shows up with `gcc` since, as documented in Issue #41838, `clang`
violates the SPARC psABI in not using 128-bit `long double`, so this
code path isn't used.

Fixed by changing the guards to match.

Tested on `sparcv9-sun-solaris2.11`.

(cherry picked from commit 63a7786111c501920afc4cc27a4633f76cdaf803)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list