Quantcast

Libc++ failures on linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Libc++ failures on linux

Boost - Dev mailing list
So I tried to add my first linux regression runner using libc++ with clang,
and I'm seeing the following error saying it can't find <cstddef>:
http://www.boost.org/development/tests/develop/developer/output/teeks99-02-dc3-9-1z-lc-Docker-64on64-boost-bin-v2-libs-accumulators-test-count-test-clang-linux-3-9~c++1z~lc-debug-link-static.html

  "clang++-3.9" -c -x c++ -Wno-c99-extensions -std=c++1z -stdlib=libc++ -O0
-g -fno-inline -Wall -g -m64  -DBOOST_ALL_NO_LIB=1
-DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CHRONO_THREAD_DISABLED
-DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1
-DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_TIMER_STATIC_LINK=1 -I".." -o
"/var/boost/run/results/boost/bin.v2/libs/accumulators/test/count.test/clang-linux-3.9~c++1z~lc/debug/link-static/count.o"
"../libs/accumulators/test/count.cpp"

In file included from ../libs/accumulators/test/count.cpp:6:
In file included from ../boost/test/unit_test.hpp:18:
In file included from ../boost/test/test_tools.hpp:17:
In file included from ../boost/config.hpp:44:
../boost/config/select_stdlib_config.hpp:18:12: fatal error: 'cstddef' file
not found
#  include <cstddef>
           ^
1 error generated.


However when I try to compile the following program on the same docker
image (teeks99/boost-build:clang-3.9)

// basic.cpp
#include <cstddef>

int main(int argc, char* argv[])
{
   size_t three = 3;
   return three;
}

with:

$ clang++-3.9 -stdlib=libc++ -std=c++1z basic.cpp

It works fine
$ ./a.out
$ echo $?
3

I can build this sample file fine with the whole command line shown above,
so it doesn't seem to be one of the other options conflicting.

Any thoughts on why boost code wouldn't be able to find this but some basic
stuff would?

One relevant detail, I'm building with clang 3.9, however the libc++
version that I'm using (ubuntu default) is the one that shipped with clang
3.7. That shouldn't preclude including a file!

I also found a couple old threads with the same error, but never any good
resolution.
http://lists.boost.org/boost-testing/2012/07/7075.php
http://lists.boost.org/boost-users/2012/11/76659.php

Tom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
On Sat, Mar 11, 2017 at 1:33 AM, Tom Kent via Boost
<[hidden email]> wrote:
> So I tried to add my first linux regression runner using libc++ with clang,
> and I'm seeing the following error saying it can't find <cstddef>:
> http://www.boost.org/development/tests/develop/developer/output/teeks99-02-dc3-9-1z-lc-Docker-64on64-boost-bin-v2-libs-accumulators-test-count-test-clang-linux-3-9~c++1z~lc-debug-link-static.html

That page currently shows a different error:

/usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT,
_Traits, _Allocator>' is missing exception specification 'noexcept'
basic_string<_CharT, _Traits, _Allocator>::basic_string(const
allocator_type& __a)
                                           ^
/usr/include/c++/v1/string:1326:40: note: previous declaration is here
    _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)

This happens after boost/config.hpp is included, which means that
cstddef is found. Indeed, cstddef is in /usr/include/c++/v1 on my
system, so the compiler clearly looks there.

The error itself looks like a bug in libc++.

/usr/include/c++/v1/cxxabi.h:21:10: fatal error: '__cxxabi_config.h'
file not found
#include <__cxxabi_config.h>

This error is more interesting. I can see this #include in my local
libc++ as well, yet I can't find this file on my system.

Both errors indicate that libc++ is broken on Ubuntu (or Linux in
general) - either in upstream or in packaging. If that's the case, we
can probably stop this testing effort right here and report the bugs
to libc++ devs.

PS: If you're still having problems with cstddef, you can try seeing
if the compiler looks in /usr/include/c++/v1 as described here:

http://stackoverflow.com/questions/11946294/dump-include-paths-from-g

If it doesn't, try adding it as an include path. Although, that path
obviously should be used by default when libc++ is enabled.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
Am 11.03.2017 um 00:22 schrieb Andrey Semashev via Boost:

> On Sat, Mar 11, 2017 at 1:33 AM, Tom Kent via Boost
> <[hidden email]> wrote:
>> So I tried to add my first linux regression runner using libc++ with clang,
>> and I'm seeing the following error saying it can't find <cstddef>:
>> http://www.boost.org/development/tests/develop/developer/output/teeks99-02-dc3-9-1z-lc-Docker-64on64-boost-bin-v2-libs-accumulators-test-count-test-clang-linux-3-9~c++1z~lc-debug-link-static.html
>
> That page currently shows a different error:
>
> /usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT,
> _Traits, _Allocator>' is missing exception specification 'noexcept'
> basic_string<_CharT, _Traits, _Allocator>::basic_string(const
> allocator_type& __a)
>                                            ^
> /usr/include/c++/v1/string:1326:40: note: previous declaration is here
>     _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
>
> This happens after boost/config.hpp is included, which means that
> cstddef is found. Indeed, cstddef is in /usr/include/c++/v1 on my
> system, so the compiler clearly looks there.
>
> The error itself looks like a bug in libc++.

This is a known error on Ubuntu/Debian:
https://bugs.launchpad.net/ubuntu/+source/libc++/+bug/1610168

And the fix is simple, presuming one can modify header-files of the
libc++ installation:
http://stackoverflow.com/a/38385967


>
> /usr/include/c++/v1/cxxabi.h:21:10: fatal error: '__cxxabi_config.h'
> file not found
> #include <__cxxabi_config.h>
>
> This error is more interesting. I can see this #include in my local
> libc++ as well, yet I can't find this file on my system.
>

On my Ubuntu machine I was able to fix this error by adding the
following path to the include-search-path: /usr/include/libcxxabi

If you do not have this path on your Ubuntu/Debian machine, you need to
install libc++abi, too. (DEB-Package: libc++abi-dev)


> Both errors indicate that libc++ is broken on Ubuntu (or Linux in
> general) - either in upstream or in packaging. If that's the case, we
> can probably stop this testing effort right here and report the bugs
> to libc++ devs.

It is at least broken on Ubuntu/Debian regarding the problem with the
string header.
Regarding the second error, I think the user is expected to have
libc++abi installed (and possibly explicit link to it, too):
http://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-on-linux

> PS: If you're still having problems with cstddef, you can try seeing
> if the compiler looks in /usr/include/c++/v1 as described here:
>
> http://stackoverflow.com/questions/11946294/dump-include-paths-from-g
>
> If it doesn't, try adding it as an include path. Although, that path
> obviously should be used by default when libc++ is enabled.
>

Hope that helps,
Deniz


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
On Sat, Mar 11, 2017 at 3:32 AM, Deniz Bahadir via Boost
<[hidden email]> wrote:

> Am 11.03.2017 um 00:22 schrieb Andrey Semashev via Boost:
>>
>> /usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT,
>> _Traits, _Allocator>' is missing exception specification 'noexcept'
>> basic_string<_CharT, _Traits, _Allocator>::basic_string(const
>> allocator_type& __a)
>>                                            ^
>> /usr/include/c++/v1/string:1326:40: note: previous declaration is here
>>     _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type&
>> __a)
>>
>> This happens after boost/config.hpp is included, which means that
>> cstddef is found. Indeed, cstddef is in /usr/include/c++/v1 on my
>> system, so the compiler clearly looks there.
>>
>> The error itself looks like a bug in libc++.
>
> This is a known error on Ubuntu/Debian:
> https://bugs.launchpad.net/ubuntu/+source/libc++/+bug/1610168
>
> And the fix is simple, presuming one can modify header-files of the libc++
> installation:
> http://stackoverflow.com/a/38385967

I guess, one could make a local change like that, but modifying system
headers is generally a bad idea and can't be recommended. I mean, even
if Tom makes the change on the test machine, that doesn't make Boost
actually work on users' machines. Which means libc++ can not be
officially supported.

>> /usr/include/c++/v1/cxxabi.h:21:10: fatal error: '__cxxabi_config.h'
>> file not found
>> #include <__cxxabi_config.h>
>>
>> This error is more interesting. I can see this #include in my local
>> libc++ as well, yet I can't find this file on my system.
>
> On my Ubuntu machine I was able to fix this error by adding the following
> path to the include-search-path: /usr/include/libcxxabi
>
> If you do not have this path on your Ubuntu/Debian machine, you need to
> install libc++abi, too. (DEB-Package: libc++abi-dev)

Right, which makes it a packaging bug, because the package should have
been pulled as a dependency of libc++-dev.

> Hope that helps,

It does, thanks.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On 10/03/17 22:33, Tom Kent via Boost wrote:
>
> One relevant detail, I'm building with clang 3.9, however the libc++
> version that I'm using (ubuntu default) is the one that shipped with clang
> 3.7. That shouldn't preclude including a file!

As mentioned, the default packaging for Ubuntu might not be what you
want.  There's http://apt.llvm.org/ - I haven't used it, I don't know if
it uses libc++ and if it does, which abi is used. It recommends
toolchain-test-r, which in my experience can break your system compiler
and make it very hard to revert those changes.

I recommend you either build clang yourself, or take the builds from
here: http://releases.llvm.org/download.html

You can just extract to any directory and clang will automatically find
the extracted libc++ (which uses libc++abi).

If you prefer to build it yourself, something like this should be
sufficient:

svn co
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_400/final/utils/release

release/test-release.sh -release 4.0.0 -final -triple
x86_64-linux-gnu-ubuntu-16.04

Ben




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
On Sat, Mar 11, 2017 at 9:34 AM, Ben Pope via Boost <[hidden email]>
wrote:

> On 10/03/17 22:33, Tom Kent via Boost wrote:
>
>>
>> One relevant detail, I'm building with clang 3.9, however the libc++
>> version that I'm using (ubuntu default) is the one that shipped with clang
>> 3.7. That shouldn't preclude including a file!
>>
>
> As mentioned, the default packaging for Ubuntu might not be what you
> want.  There's http://apt.llvm.org/ - I haven't used it, I don't know if
> it uses libc++ and if it does, which abi is used. It recommends
> toolchain-test-r, which in my experience can break your system compiler and
> make it very hard to revert those changes.
>
> I recommend you either build clang yourself, or take the builds from here:
> http://releases.llvm.org/download.html
>
> You can just extract to any directory and clang will automatically find
> the extracted libc++ (which uses libc++abi).
>
> If you prefer to build it yourself, something like this should be
> sufficient:
>
> svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_400/final
> /utils/release
>
> release/test-release.sh -release 4.0.0 -final -triple
> x86_64-linux-gnu-ubuntu-16.04
>

Yeah, I've been using the apt.llvm.org to build most of the clang docker
images. Unfortunately it doesn't include the libc++ packages, I've e-mailed
the guy who builds the packages (also the debian libc++ packager) to see if
that could be in the cards.

If those ducks can get in a row, that would be my preference, but failing
that, I may just move to grabbing those binaries from the releases section.
That seems like it would be about as easy, and works now.

Tom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
On Fri, Mar 10, 2017 at 7:43 PM, Andrey Semashev via Boost <
[hidden email]> wrote:

> On Sat, Mar 11, 2017 at 3:32 AM, Deniz Bahadir via Boost
> <[hidden email]> wrote:
> > Am 11.03.2017 um 00:22 schrieb Andrey Semashev via Boost:
> >>
> >> /usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT,
> >> _Traits, _Allocator>' is missing exception specification 'noexcept'
> >> basic_string<_CharT, _Traits, _Allocator>::basic_string(const
> >> allocator_type& __a)
> >>                                            ^
> >> /usr/include/c++/v1/string:1326:40: note: previous declaration is here
> >>     _LIBCPP_INLINE_VISIBILITY explicit basic_string(const
> allocator_type&
> >> __a)
> >>
> >> This happens after boost/config.hpp is included, which means that
> >> cstddef is found. Indeed, cstddef is in /usr/include/c++/v1 on my
> >> system, so the compiler clearly looks there.
> >>
> >> The error itself looks like a bug in libc++.
> >
> > This is a known error on Ubuntu/Debian:
> > https://bugs.launchpad.net/ubuntu/+source/libc++/+bug/1610168
> >
> > And the fix is simple, presuming one can modify header-files of the
> libc++
> > installation:
> > http://stackoverflow.com/a/38385967
>
> I guess, one could make a local change like that, but modifying system
> headers is generally a bad idea and can't be recommended. I mean, even
> if Tom makes the change on the test machine, that doesn't make Boost
> actually work on users' machines. Which means libc++ can not be
> officially supported.
>
> >> /usr/include/c++/v1/cxxabi.h:21:10: fatal error: '__cxxabi_config.h'
> >> file not found
> >> #include <__cxxabi_config.h>
> >>
> >> This error is more interesting. I can see this #include in my local
> >> libc++ as well, yet I can't find this file on my system.
> >
> > On my Ubuntu machine I was able to fix this error by adding the following
> > path to the include-search-path: /usr/include/libcxxabi
> >
> > If you do not have this path on your Ubuntu/Debian machine, you need to
> > install libc++abi, too. (DEB-Package: libc++abi-dev)
>
> Right, which makes it a packaging bug, because the package should have
> been pulled as a dependency of libc++-dev.
>
> > Hope that helps,
>
> It does, thanks.



Installing the baseline ubuntu libc++abi-dev *and* adding
`-I/usr/include/libcxxabi` to my user-config.jam file got rid of the file
not found #include <__cxxabi_config.h>
Once I get a chance to make a decent solution, I'm going to put a fix in my
docker image for the `/usr/include/c++/v1/string:1938:44: error:
'basic_string<...` issue.

Tom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Libc++ failures on linux

Boost - Dev mailing list
On Sat, Mar 11, 2017 at 9:43 PM, Tom Kent <[hidden email]> wrote:

>
>
> On Fri, Mar 10, 2017 at 7:43 PM, Andrey Semashev via Boost <
> [hidden email]> wrote:
>
>> On Sat, Mar 11, 2017 at 3:32 AM, Deniz Bahadir via Boost
>> <[hidden email]> wrote:
>> > Am 11.03.2017 um 00:22 schrieb Andrey Semashev via Boost:
>> >>
>> >> /usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT,
>> >> _Traits, _Allocator>' is missing exception specification 'noexcept'
>> >> basic_string<_CharT, _Traits, _Allocator>::basic_string(const
>> >> allocator_type& __a)
>> >>                                            ^
>> >> /usr/include/c++/v1/string:1326:40: note: previous declaration is here
>> >>     _LIBCPP_INLINE_VISIBILITY explicit basic_string(const
>> allocator_type&
>> >> __a)
>> >>
>> >> This happens after boost/config.hpp is included, which means that
>> >> cstddef is found. Indeed, cstddef is in /usr/include/c++/v1 on my
>> >> system, so the compiler clearly looks there.
>> >>
>> >> The error itself looks like a bug in libc++.
>> >
>> > This is a known error on Ubuntu/Debian:
>> > https://bugs.launchpad.net/ubuntu/+source/libc++/+bug/1610168
>> >
>> > And the fix is simple, presuming one can modify header-files of the
>> libc++
>> > installation:
>> > http://stackoverflow.com/a/38385967
>>
>> I guess, one could make a local change like that, but modifying system
>> headers is generally a bad idea and can't be recommended. I mean, even
>> if Tom makes the change on the test machine, that doesn't make Boost
>> actually work on users' machines. Which means libc++ can not be
>> officially supported.
>>
>> >> /usr/include/c++/v1/cxxabi.h:21:10: fatal error: '__cxxabi_config.h'
>> >> file not found
>> >> #include <__cxxabi_config.h>
>> >>
>> >> This error is more interesting. I can see this #include in my local
>> >> libc++ as well, yet I can't find this file on my system.
>> >
>> > On my Ubuntu machine I was able to fix this error by adding the
>> following
>> > path to the include-search-path: /usr/include/libcxxabi
>> >
>> > If you do not have this path on your Ubuntu/Debian machine, you need to
>> > install libc++abi, too. (DEB-Package: libc++abi-dev)
>>
>> Right, which makes it a packaging bug, because the package should have
>> been pulled as a dependency of libc++-dev.
>>
>> > Hope that helps,
>>
>> It does, thanks.
>
>
>
> Installing the baseline ubuntu libc++abi-dev *and* adding
> `-I/usr/include/libcxxabi` to my user-config.jam file got rid of the file
> not found #include <__cxxabi_config.h>
> Once I get a chance to make a decent solution, I'm going to put a fix in
> my docker image for the `/usr/include/c++/v1/string:1938:44: error:
> 'basic_string<...` issue.
>

Seems to have worked out now. I've got the fix into my docker builds, and
the libc++ runners are cycling. See teeks99-02-dc3.0-1z-lc and
teeks99-02-mc3.9-1z-lc for develop and master tests.

Tom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...