This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/22296] New: glibc 2.26: signbit build issue with Gcc 5.5.0 on x86_64


https://sourceware.org/bugzilla/show_bug.cgi?id=22296

            Bug ID: 22296
           Summary: glibc 2.26: signbit build issue with Gcc 5.5.0 on
                    x86_64
           Product: glibc
           Version: 2.26
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: romain.naour at gmail dot com
  Target Milestone: ---

Created attachment 10527
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10527&action=edit
gcc config.log

Hi,

I'm using a toolchain with gcc 5.5.0, glibc-2.26 (latest stable commit) and
binutils 2.27.

Mesa fail to build with the following error:

In file included from ../../include/c99_math.h:37:0,
                 from ../../src/gallium/auxiliary/util/u_math.h:44,
                 from ../../src/mesa/main/macros.h:35,
                 from glsl_types.cpp:25:
../../src/mesa/main/macros.h: In the function ‘GLboolean
DIFFERENT_SIGNS(GLfloat, GLfloat)’:
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘float’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : ‘__builtin_types_compatible_p’ was
not declared in this scope
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘double’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : expected primary-expression before
‘long’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : ‘__builtin_choose_expr’ was not
declared in this scope
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : ‘__builtin_choose_expr’ was not
declared in this scope
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : redeclaration of
‘<typeprefixerror>__builtin_choose_expr’
../../src/mesa/main/macros.h:794:11: note : previous declaration
‘<typeprefixerror>__builtin_choose_expr’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : ‘__builtin_choose_expr’ was not
declared in this scope
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:11: error : redeclaration of
‘<typeprefixerror>__builtin_choose_expr’
../../src/mesa/main/macros.h:794:11: note : previous declaration
‘<typeprefixerror>__builtin_choose_expr’
    return signbit(x) != signbit(y);
           ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
                         ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘float’
    return signbit(x) != signbit(y);
                         ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
                         ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘double’
    return signbit(x) != signbit(y);
                         ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘__typeof’
    return signbit(x) != signbit(y);
                         ^
../../src/mesa/main/macros.h:794:25: error : expected primary-expression before
‘long’
    return signbit(x) != signbit(y);
                         ^

It seems related to this code in glibc math/math.h :

/* Return nonzero value if sign of X is negative.  */
# if __GNUC_PREREQ (6,0)
#  define signbit(x) __builtin_signbit (x)
# elif __GNUC_PREREQ (4,0)
#  define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
# else
#  define signbit(x) __MATH_TG ((x), __signbit, (x))
# endif

The macro __MATH_TG is defined latter in this file:

#ifdef __NO_LONG_DOUBLE_MATH
[...]
#elif __HAVE_DISTINCT_FLOAT128
# if __HAVE_GENERIC_SELECTION
[...]
# else
#  define __MATH_TG(TG_ARG, FUNC, ARGS)                                 \
     __builtin_choose_expr                                              \
     (__builtin_types_compatible_p (__typeof (TG_ARG), float),          \
      FUNC ## f ARGS,                                                   \
      __builtin_choose_expr                                             \
      (__builtin_types_compatible_p (__typeof (TG_ARG), double),        \
       FUNC ARGS,                                                       \
       __builtin_choose_expr                                            \
       (__builtin_types_compatible_p (__typeof (TG_ARG), long double),  \
        FUNC ## l ARGS,                                                 \
        FUNC ## f128 ARGS)))
# endif
#else
[...]

For some reason, the macros __builtin_choose_expr and
__builtin_types_compatible_p are not defined with gcc 5.5.0.
It look like an issue with float128 support.

Best regards,
Romain

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]