Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

xlocale.h not found #36569

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37596
Status NEW
Importance P normal
Reported by Brian Vandenberg (phantall@gmail.com)
Reported on 2018-05-25 15:28:33 -0700
Last modified on 2018-05-25 18:27:02 -0700
Version 6.0
Hardware Sun Solaris
CC llvm-bugs@lists.llvm.org, mclow.lists@gmail.com, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Building on Solaris 10 / sparcv9 hardware:

    cmake ../src/llvm \
    -DCMAKE_C_COMPILER=gcc-7.2.0 \
    -DCMAKE_CXX_COMPILER=g++-7.2.0 \
    -DGCC_INSTALL_PREFIX=$(dirname $(dirname $(which gcc-7.2.0))) \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo

    make -j32

... with libcxx/libcxxabi un-tarred & appropriately renamed in
../src/llvm/projects.

I get the following compile error:

    In file included from (...)/projects/libcxx/include/ios:216:0,
                     from (...)/projects/libcxx/include/ostream:138,
                     from (...)/projects/libcxx/include/istream:163,
                     from (...)/projects/libcxx/include/rnadom:1646,
                     from (...)/projects/libcxx/src/algorithm.cpp:11:
    (...)/projects/libcxx/include/__locale:33:11: fatal error: xlocale.h: No such file or directory
Quuxplusone commented 6 years ago

Does this compile if you add defined(sun) to the list of cases for which we avoid including in __locale?

Quuxplusone commented 6 years ago
I can give it a shot, but there /is/ an xlocale.h for solaris:

    projects/libcxx/include/support/solaris/xlocale.h

My bet is something in the build should be adding
projects/libcxx/include/support/solaris to the inclusion list, but I'm not sure
where to add that if I'm correct.
Quuxplusone commented 6 years ago
Here's what trunk __locale says:

[...]
#elif defined(__sun__)
# include <xlocale.h>
# include <support/solaris/xlocale.h>
#elif defined(_NEWLIB_VERSION)
# include <support/newlib/xlocale.h>
#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
    || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
[...]

... so we explicitly include that support/solaris/xlocale.h header, but *first*
try to pick up a nonexistent version from the machine. =(

It looks like support/solaris/xlocale.h doesn't do anything useful -- it
defines the locale-specific versions of various functions as simply ignoring
the specified locale. =(

Can you try removing the <xlocale.h> include from the defined(__sun__) block
and see if that helps?
Quuxplusone commented 6 years ago
It results in a bunch of "locale_t not defined" errors.

It looks like xlocale.h comes from glibc.  If you look at the history for
include/support/solaris/xlocale.h, on Jan 23 2015 a commit was pushed titled
"Get libc++ building on Sun Solaris. Patch from C Bergstrom" that, among other
things, removed this line:

typedef struct _LC_locale_t* locale_t;

My bet is anyone who's able to get it building in Solaris either has a patch
installed I don't know about or they're using Solaris 11.

I'm going to put that line back in and see what happens.
Quuxplusone commented 6 years ago

It looks like I'm running into the problem referred to in this thread:

http://lists.llvm.org/pipermail/llvm-dev/2016-July/102072.html