Skip to content

Commit ad7611d

Browse files
authored
[builtins] Fix floattitf.c etc. compilation on Solaris/SPARC (#70058)
69660cc broke the [Solaris/sparcv9 buildbot](https://lab.llvm.org/staging/#/builders/12/builds/264): `compiler-rt/lib/builtins/int_to_fp.h` unconditionally uses `*int128_t` which don't exist on 32-bit SPARC. As suggested in #67540, this patch fixes this by moving the `CRT_HAS_TF_MODE` guard up which does the necessary checks. Tested on `sparcv9-sun-solaris2.11`.
1 parent 9f592cb commit ad7611d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler-rt/lib/builtins/floattitf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "fp_lib.h"
1717
#include "int_lib.h"
1818

19+
#if defined(CRT_HAS_TF_MODE)
1920
#define SRC_I128
2021
#define DST_QUAD
2122
#include "int_to_fp_impl.inc"
@@ -29,7 +30,6 @@
2930
// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
3031
// mmmm mmmm mmmm
3132

32-
#if defined(CRT_HAS_TF_MODE)
3333
COMPILER_RT_ABI fp_t __floattitf(ti_int a) { return __floatXiYf__(a); }
3434

3535
#endif

compiler-rt/lib/builtins/floatuntitf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "fp_lib.h"
1717
#include "int_lib.h"
1818

19+
#if defined(CRT_HAS_TF_MODE)
1920
#define SRC_U128
2021
#define DST_QUAD
2122
#include "int_to_fp_impl.inc"
@@ -29,7 +30,6 @@
2930
// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
3031
// mmmm mmmm mmmm
3132

32-
#if defined(CRT_HAS_TF_MODE)
3333
COMPILER_RT_ABI fp_t __floatuntitf(tu_int a) { return __floatXiYf__(a); }
3434

3535
#endif

0 commit comments

Comments
 (0)