libcxx fails to build with g++ as of version 4.9.0

Hi Marshall

I’m just drawing your attention to this since I think you might have missed it in your lists inbox.
I probably should have just posted it here to begin with. Sorry.

Thanks

Hi Marshall

I thought you might want to know that libcxx has stopped being buildable with g++ as of 4.9.0.
The error output of the build is shown below.

The main error is:

c:/libcxx/include/string:1895:1: error: inlining failed in call to always_inline 'std::__1::basic_string<_CharT, _Traits,
_Allocator>::basic_string() [with _CharT = char; _Traits = std::__1::char_traits; _Allocator = std::__1::allocator<c

]': function body not available

Look for it in the full error output shown below.

If you need me to try out a patch, let me know. Sorry if I end up being a little slow in replying though, I don’t always follow so closely these days.
If I don’t hear anything in a day or two, I’ll post this on cfe-dev, assuming you’ve missed this email in the list deluge.

Thanks.

c:\libcxx_build>ninja
[10/29] Building CXX object lib/CMakeFiles/cxx.dir/__/src/exception.cpp.obj
c:/libcxx/src/exception.cpp:118:9: warning: #warning is a GCC extension

warning uncaught_exception not yet implemented

^
c:/libcxx/src/exception.cpp:118:9: warning: #warning uncaught_exception not yet implemented [-Wcpp]
c:/libcxx/src/exception.cpp:191:9: warning: #warning is a GCC extension

warning exception_ptr not yet implemented

^
c:/libcxx/src/exception.cpp:191:9: warning: #warning exception_ptr not yet implemented [-Wcpp]
c:/libcxx/src/exception.cpp:210:9: warning: #warning is a GCC extension

warning exception_ptr not yet implemented

^
c:/libcxx/src/exception.cpp:210:9: warning: #warning exception_ptr not yet implemented [-Wcpp]
c:/libcxx/src/exception.cpp:235:9: warning: #warning is a GCC extension

warning exception_ptr not yet implemented

^
c:/libcxx/src/exception.cpp:235:9: warning: #warning exception_ptr not yet implemented [-Wcpp]
c:/libcxx/src/exception.cpp:279:9: warning: #warning is a GCC extension

warning exception_ptr not yet implemented

^
c:/libcxx/src/exception.cpp:279:9: warning: #warning exception_ptr not yet implemented [-Wcpp]
c:/libcxx/src/exception.cpp:301:9: warning: #warning is a GCC extension

warning exception_ptr not yet implemented

^
c:/libcxx/src/exception.cpp:301:9: warning: #warning exception_ptr not yet implemented [-Wcpp]
[22/29] Building CXX object lib/CMakeFiles/cxx.dir//src/ios.cpp.obj
FAILED: \mingw\bin\g++.exe -pipe -march=native -O3 -fno-exceptions -std=c++1y -nostdinc++ -std=c++0x -Werror=return-typ
e -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-long-long -Wno-error -pedantic -D_DEBUG -UNDEBUG -D_LIBCPP_BUILD_STA
TIC -O3 -DNDEBUG -Ic:/libcxx/include -MMD -MT lib/CMakeFiles/cxx.dir/
/src/ios.cpp.obj -MF "lib/CMakeFiles/cxx.dir//src
/ios.cpp.obj.d" -o lib/CMakeFiles/cxx.dir/
/src/ios.cpp.obj -c c:/libcxx/src/ios.cpp
In file included from c:/libcxx/include/__locale:15:0,
from c:/libcxx/include/ios:216,
from c:/libcxx/src/ios.cpp:12:
c:/libcxx/include/string: In member function ‘_InputIterator std::__1::num_get<_CharT, _InputIterator>::__do_get_signed(st
d::__1::num_get<_CharT, _InputIterator>::iter_type, std::__1::num_get<_CharT, _InputIterator>::iter_type, std::__1::ios_ba
se&, std::__1::ios_base::iostate&, _Signed&) const [with _Signed = long int; _CharT = char; _InputIterator = std::__1::ist
reambuf_iterator<char, std::__1::char_traits >; std::__1::num_get<_CharT, _InputIterator>::iter_type = std::__1::ist
reambuf_iterator<char, std::__1::char_traits >; std::__1::ios_base::iostate = unsigned int]’:
c:/libcxx/include/string:1895:1: error: inlining failed in call to always_inline 'std::__1::basic_string<_CharT, _Traits,
_Allocator>::basic_string() [with _CharT = char; _Traits = std::__1::char_traits; _Allocator = std::__1::allocator<c

]': function body not available
basic_string<_CharT, _Traits, _Allocator>::basic_string()
^
In file included from c:/libcxx/include/ostream:133:0,
from c:/libcxx/include/istream:156,
from c:/libcxx/src/ios.cpp:14:
c:/libcxx/include/locale:1006:12: error: called from here
string buf;
^
[22/29] Building CXX object lib/CMakeFiles/cxx.dir/
/src/locale.cpp.obj
FAILED: \mingw\bin\g++.exe -pipe -march=native -O3 -fno-exceptions -std=c++1y -nostdinc++ -std=c++0x -Werror=return-typ
e -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-long-long -Wno-error -pedantic -D_DEBUG -UNDEBUG -D_LIBCPP_BUILD_STA
TIC -O3 -DNDEBUG -Ic:/libcxx/include -MMD -MT lib/CMakeFiles/cxx.dir//src/locale.cpp.obj -MF "lib/CMakeFiles/cxx.dir//
src/locale.cpp.obj.d" -o lib/CMakeFiles/cxx.dir/__/src/locale.cpp.obj -c c:/libcxx/src/locale.cpp
In file included from c:/libcxx/src/locale.cpp:18:0:
c:/libcxx/include/string: In function ‘std::__1::string* std::__1::init_weeks()’:
c:/libcxx/include/string:1895:1: error: inlining failed in call to always_inline 'std::__1::basic_string<_CharT, _Traits,
_Allocator>::basic_string() [with _CharT = char; _Traits = std::__1::char_traits; _Allocator = std::1::allocator<c
]': function body not available
basic_string<_CharT, _Traits, _Allocator>::basic_string()
^
c:/libcxx/src/locale.cpp:4444:27: error: called from here
static string weeks[14];
^
[22/29] Building CXX object lib/CMakeFiles/cxx.dir/
/src/strstream.cpp.obj
c:/libcxx/src/strstream.cpp: In member function ‘virtual std::__1::basic_streambuf::pos_type std::__1::strstreambuf:
:seekoff(std::__1::basic_streambuf::off_type, std::__1::ios_base::seekdir, std::__1::ios_base::openmode)’:
c:/libcxx/src/strstream.cpp:267:24: warning: ‘newoff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
newoff += off;
^
[22/29] Building CXX object lib/CMakeFiles/cxx.dir/
/src/string.cpp.obj
ninja: build stopped: subcommand failed.

c:\libcxx_build>popd

c:\Users\GM\Downloads>notepad2 c:/libcxx/include/__locale

c:\Users\GM\Downloads>

Hi Marshall

I’m just drawing your attention to this since I think you might have missed it in your lists inbox.
I probably should have just posted it here to begin with. Sorry.

Actually, I did see it; but it took me a couple days to get a 4.9 install.
But thanks for sending it to me and posting it here.

— Marshall