Bug 95180 - rasterizer/memory/Convert.h:170:9: error: ‘__builtin_isnan’ is not a member of ‘std’
Summary: rasterizer/memory/Convert.h:170:9: error: ‘__builtin_isnan’ is not a member o...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-04-28 05:55 UTC by Vinson Lee
Modified: 2016-05-27 04:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vinson Lee 2016-04-28 05:55:32 UTC
mesa: 32cb7d61a908c519641959158de0a44fd2c8a6e7 (master 11.3.0-devel)

  CXX      rasterizer/memory/libswrAVX_la-ClearTile.lo
In file included from rasterizer/memory/ClearTile.cpp:34:0:
./rasterizer/memory/Convert.h: In function ‘uint16_t Convert32To16Float(float)’:
./rasterizer/memory/Convert.h:170:9: error: ‘__builtin_isnan’ is not a member of ‘std’
     if (std::isnan(val))
         ^
./rasterizer/memory/Convert.h:170:9: note: suggested alternative:
<built-in>: note:   ‘__builtin_isnan’
Comment 1 Tim Rowley 2016-04-28 11:10:30 UTC
That's odd - "std:isnan" is C++11, and I don't see any macros in the mesa tree that would be messing it up.  What compiler/platform are you building on?
Comment 2 Jose Fonseca 2016-04-28 11:30:26 UTC
I wonder if there's a

  #include <cmath>

missing somewhere.

Also, per https://cgit.freedesktop.org/mesa/mesa/commit/?id=649704f1f7c9e1d0990d34a76154b2eb656bee42 , it sounds that GLIBC prior to 2.23 does not have isnan in std namespace.  That might be the problem.


The easiest way to check GLIBC version is `ldd --version`
Comment 3 Ilia Mirkin 2016-04-28 14:41:49 UTC
From the sounds of it, there's a

#define isnan __builtin_isnan

somewhere which is converting

std::isnan

into

std::__builtin_isnan
Comment 4 Vinson Lee 2016-04-30 01:26:00 UTC
I am building with GCC 5.3 on Ubuntu 16.10.

$ gcc --version
gcc (Ubuntu 5.3.1-16ubuntu2) 5.3.1 20160424
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu3) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Comment 5 Vinson Lee 2016-05-27 04:10:27 UTC
commit 8d639138c712c5bbe0b9ea8adbc810b23a2e8d1b
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon May 9 16:02:12 2016 -0700

    swr: [rasterizer] Include cmath for std::isnan and std::isinf.
    
    This patch fixes this build error.
    
      CXX      rasterizer/memory/libswrAVX_la-ClearTile.lo
    In file included from rasterizer/memory/ClearTile.cpp:34:0:
    ./rasterizer/memory/Convert.h: In function ‘uint16_t Convert32To16Float(float)’:
    ./rasterizer/memory/Convert.h:170:9: error: ‘__builtin_isnan’ is not a member of ‘std’
         if (std::isnan(val))
             ^
    ./rasterizer/memory/Convert.h:170:9: note: suggested alternative:
    <built-in>: note:   ‘__builtin_isnan’
    ./rasterizer/memory/Convert.h:176:14: error: ‘__builtin_isinf_sign’ is not a member of ‘std’
         else if (std::isinf(val))
                  ^
    ./rasterizer/memory/Convert.h:176:14: note: suggested alternative:
    <built-in>: note:   ‘__builtin_isinf_sign’
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95180
    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
    Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>


bug/show.html.tmpl processed on Mar 25, 2017 at 07:37:50.
(provided by the Example extension).