Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2012 00:24:43 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Jan Beich <jbeich@tormail.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar <marcel@freebsd.org>, Dimitry Andric <dim@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r241823 - in head: . etc etc/atf etc/mtree lib lib/atf lib/atf/libatf-c lib/atf/libatf-c++ libexec libexec/atf libexec/atf/atf-check share share/atf share/doc share/doc/atf share/exampl...
Message-ID:  <CAGH67wTgsk6UJBvSNtR6Vux=Aa-QcsB-3vqZLjGvX-LKbHxZ4w@mail.gmail.com>
In-Reply-To: <1TQC0L-000AZG-Q5@internal.tormail.org>
References:  <201210220118.q9M1Ifh5098857__14926.3614825488$1350868751$gmane$org@svn.freebsd.org> <1TQC0L-000AZG-Q5@internal.tormail.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 22, 2012 at 12:00 AM, Jan Beich <jbeich@tormail.org> wrote:
> Marcel Moolenaar <marcel@FreeBSD.org> writes:
>
>> Author: marcel
>> Date: Mon Oct 22 01:18:41 2012
>> New Revision: 241823
>> URL: http://svn.freebsd.org/changeset/base/241823
>>
>> Log:
>>   Add ATF to the build. This is may be a bit rought around the egdes,
>>   but committing it helps to get everyone on the same page and makes
>>   sure we make progress.
> [...]
>
> atf-run fails to link when using -stdlib=libc++. It works if I remove
> `throw' from check_stream(). Any clue?
>
> test-program.o: In function `(anonymous namespace)::check_stream(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)':
> /usr/src/usr.bin/atf/atf-run/../../../contrib/atf/atf-run/test-program.cpp:76: undefined reference to `std::__1::basic_ios<char, std::__1::char_traits<char> >::clear(unsigned int)'
> clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Is it a bug in libc++ where it's doing the wrong thing inlining some
values for basic_ios (my guess is based on the snippet example at:
http://www.cplusplus.com/reference/iostream/ios/clear/ ):

$ p4 diff -du ios
--- //depot/user/gcooper/atf-head/src/contrib/libc++/include/ios
 2012-05-20 04:37:04.000000000 0000
+++ /scratch/p4/user/gcooper/atf-head/src/contrib/libc++/include/ios
 2012-05-20 04:37:04.000000000 0000
@@ -575,10 +575,10 @@
     _LIBCPP_ALWAYS_INLINE
         _LIBCPP_EXPLICIT
         operator bool() const {return !fail();}
-    _LIBCPP_ALWAYS_INLINE bool operator!() const    {return  fail();}
-    _LIBCPP_ALWAYS_INLINE iostate rdstate() const   {return
ios_base::rdstate();}
-    _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit)
{ios_base::clear(__state);}
-    _LIBCPP_ALWAYS_INLINE void setstate(iostate __state)
{ios_base::setstate(__state);}
+    _LIBCPP_INLINE_VISIBILITY bool operator!() const    {return  fail();}
+    _LIBCPP_INLINE_VISIBILITY iostate rdstate() const   {return
ios_base::rdstate();}
+    void clear(iostate __state = goodbit) {ios_base::clear(__state);}
+    _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state)
{ios_base::setstate(__state);}
     _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();}
     _LIBCPP_ALWAYS_INLINE bool eof() const  {return ios_base::eof();}
     _LIBCPP_ALWAYS_INLINE bool fail() const {return ios_base::fail();}

I'm building clang and libc++ in my VM to confirm.

Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wTgsk6UJBvSNtR6Vux=Aa-QcsB-3vqZLjGvX-LKbHxZ4w>