Skip to content

Commit 9971e98

Browse files
committed
[builtins] Avoid using long double in FreeBSD standalone environment
After 05a4212 a number of long double related declarations are enabled in `int_types.h`, whenever the CPU architecture and platform support it. However, this does not work with FreeBSD's standalone environment, which disallows any use of floating point. In add98b2 this was made conditional with `CRT_HAS_FLOATING_POINT`, so use that macro to also determine whether `HAS_80_BIT_LONG_DOUBLE` can be turned on.
1 parent 7433b1c commit 9971e98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/builtins/int_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ typedef struct {
156156
// still makes it 80 bits. Clang will match whatever compiler it is trying to
157157
// be compatible with. On 32-bit x86 Android, long double is 64 bits, while on
158158
// x86_64 Android, long double is 128 bits.
159-
#if (defined(__i386__) || defined(__x86_64__)) && \
159+
#if !CRT_HAS_FLOATING_POINT
160+
#define HAS_80_BIT_LONG_DOUBLE 0
161+
#elif (defined(__i386__) || defined(__x86_64__)) && \
160162
!(defined(_MSC_VER) || defined(__ANDROID__))
161163
#define HAS_80_BIT_LONG_DOUBLE 1
162164
#elif defined(__m68k__) || defined(__ia64__)

0 commit comments

Comments
 (0)