Bug 101657

Summary: strtod.c:32:10: fatal error: xlocale.h: No such file or directory
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: jfonseca
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2017-06-30 06:51:37 UTC
mesa: 277621bbb724b0a627a0f5473bdeb82e02fdf389 (master 17.2.0-devel)

SCons build fails with glibc 2.26.

$ scons
[...]
  Compiling src/util/strtod.c ...
src/util/strtod.c:32:10: fatal error: xlocale.h: No such file or directory
 #include <xlocale.h>
          ^~~~~~~~~~~

glibc 2.26 removed xlocale.h. 

https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
Comment 1 Eric Engestrom 2017-06-30 16:26:56 UTC
To be clear, the bug here is that SCons (scons/gallium.py) defines HAVE_XLOCALE_H without actually checking that it does indeed have xlocale.h.

As far as I can tell, there is no way to perform such a check on SCons, so I think the define should be removed, and the corresponding functionality [1] will not work when built from scons.

Is there any other alternative?

[1]
/**
 * Wrapper around strtod which uses the "C" locale so the decimal
 * point is always '.'
 */
Comment 2 Emil Velikov 2017-06-30 16:41:41 UTC
http://scons.org/doc/0.97/HTML/scons-user/x2827.html

Above suggests that there may be a way. Although, I think we want to hunk/rework the implementation. But that for another day.
Comment 3 Eric Engestrom 2017-07-07 10:57:02 UTC
Fixed by:

commit c5d0dc7fa5566941a49ede8c83a0cfe0a33a3d7f
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Wed Jul 5 14:16:11 2017 -0700

    scons: Check for xlocale.h before defining HAVE_XLOCALE_H.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.