On Mon, Oct 22, 2012 at 12:00 AM, Jan Beich <jbe...@tormail.org> wrote:
> Marcel Moolenaar <mar...@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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to