Skip to content

Commit

Permalink
[builtins] Fix floattitf.c etc. compilation on Solaris/SPARC (#70058)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
rorth committed Oct 24, 2023
1 parent 9f592cb commit ad7611d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/floattitf.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "fp_lib.h"
#include "int_lib.h"

#if defined(CRT_HAS_TF_MODE)
#define SRC_I128
#define DST_QUAD
#include "int_to_fp_impl.inc"
Expand All @@ -29,7 +30,6 @@
// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

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

#endif
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/floatuntitf.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "fp_lib.h"
#include "int_lib.h"

#if defined(CRT_HAS_TF_MODE)
#define SRC_U128
#define DST_QUAD
#include "int_to_fp_impl.inc"
Expand All @@ -29,7 +30,6 @@
// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm

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

#endif

0 comments on commit ad7611d

Please sign in to comment.