Closed Bug 1787629 Opened 2 years ago Closed 2 years ago

Spidermonkey standalone build failure on i686 because our internal definition of `double_t` disagrees with GCC and Glibc

Categories

(Core :: JavaScript Engine, defect)

Firefox 91
defect

Tracking

()

RESOLVED DUPLICATE of bug 1729459

People

(Reporter: xry111, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15

Steps to reproduce:

Build Spidermonkey on i686 with GCC (the default if Clang is not installed, or the user perferring GCC may specify CC=gcc).

Actual results:

conflicting types for ‘double_t’; have ‘long double’

Expected results:

Spidermonkey build successfully.

In modules/fdlibm/src/math_private.h we have:

typedef double      __double_t;
typedef __double_t  double_t;

But in Glibc-2.36 math.h:

# if __GLIBC_FLT_EVAL_METHOD == 0 || __GLIBC_FLT_EVAL_METHOD == 16
typedef float float_t;
typedef double double_t;
# elif __GLIBC_FLT_EVAL_METHOD == 1
typedef double float_t;
typedef double double_t;
# elif __GLIBC_FLT_EVAL_METHOD == 2
typedef long double float_t;
typedef long double double_t;

We have __GLIBC_FLT_EVAL_METHOD == 0 with i686 Clang, giving the same typedef double double_t. But with i686 GCC, we have __GLIBC_FLT_EVAL_METHOD == 2.

Clang considers SSE enough for __FLT_EVAL_METHOD__ to be zero, while GCC disagrees and believes SSE2 is needed for it (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82626#c3). We (as downstream packagers) may force -msse2 -mfpmath=sse with i686 GCC, but technically early i686 models don't support SSE2. (The term "technically" used because currently i686 rustc generates SSE2 so Spidermonkey is already broken on those early i686 processors like Pentium Pro.)

Dup.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.