felipeprov / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

Documentation should mention that REQUIRES_RTTI=1 is required when building iwyu, at least on OS X #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?  Give the *exact* arguments passed
to include-what-you-use, and attach the input source file that gives the
problem (minimal test-cases are much appreciated!)
1. Try to build on OS X

What is the expected output? What do you see instead?

Should work. Instead, I get several errors about typeid not working with 
-fno-rtti in the system's tr1 headers.

If I run `make REQUIRES_RTTI=1`, things work fine (I ran it for both building 
llvm and iwyu; not sure if it's required for both).

What version of the product are you using? On what operating system?

trunk as of now, os x 10.6

Please provide any additional information below.

Original issue reported on code.google.com by thakis@google.com on 5 Feb 2011 at 3:29

GoogleCodeExporter commented 9 years ago
Sorry, title should read "Documentation should mention that REQUIRES_RTTI=1 is 
required when building iwyu, at least on OS X".

Original comment by thakis@google.com on 5 Feb 2011 at 3:30

GoogleCodeExporter commented 9 years ago
This should not require rtti on any system.  What are the exact errors that you 
get?  Please include the exact compile output.

Original comment by csilv...@gmail.com on 7 Feb 2011 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by csilv...@gmail.com on 7 Feb 2011 at 6:36

GoogleCodeExporter commented 9 years ago
To be clear, iwyu itself doesn't require ftti, but it uses tr1, which needs it 
in the OS X implementation:

llvm[0]: Compiling iwyu.cc for Release+Asserts build
In file included from /usr/include/c++/4.2.1/tr1/tuple:159,
                 from iwyu.cc:134:
/usr/include/c++/4.2.1/tr1/functional: In static member function ‘static bool 
std::tr1::_Function_base::_Base_manager<_Functor>::_M_manager(std::tr1::_Any_dat
a&, const std::tr1::_Any_data&, std::tr1::_Manager_operation)’:
/usr/include/c++/4.2.1/tr1/functional:907: error: cannot use typeid with 
-fno-rtti
/usr/include/c++/4.2.1/tr1/functional: In static member function ‘static bool 
std::tr1::_Function_base::_Ref_manager<_Functor>::_M_manager(std::tr1::_Any_data
&, const std::tr1::_Any_data&, std::tr1::_Manager_operation)’:
/usr/include/c++/4.2.1/tr1/functional:985: error: cannot use typeid with 
-fno-rtti
In file included from /usr/include/c++/4.2.1/tr1/repeat.h:74,
                 from /usr/include/c++/4.2.1/tr1/functional:1098,
                 from /usr/include/c++/4.2.1/tr1/tuple:159,
                 from iwyu.cc:134:
/usr/include/c++/4.2.1/tr1/functional_iterate.h: In static member function 
‘static bool std::tr1::_Function_handler<void ()(), _Member 
_Class::*>::_M_manager(std::tr1::_Any_data&, const std::tr1::_Any_data&, 
std::tr1::_Manager_operation)’:
/usr/include/c++/4.2.1/tr1/functional_iterate.h:572: error: cannot use typeid 
with -fno-rtti
/usr/include/c++/4.2.1/tr1/functional_iterate.h: In member function ‘const 
std::type_info& std::tr1::function<_Res ()()>::target_type() const’:
/usr/include/c++/4.2.1/tr1/functional_iterate.h:880: error: cannot use typeid 
with -fno-rtti
/usr/include/c++/4.2.1/tr1/functional_iterate.h: In member function 
‘_Functor* std::tr1::function<_Res ()()>::target()’:
/usr/include/c++/4.2.1/tr1/functional_iterate.h:889: error: cannot use typeid 
with -fno-rtti
/usr/include/c++/4.2.1/tr1/functional_iterate.h: In member function ‘const 
_Functor* std::tr1::function<_Res ()()>::target() const’:
/usr/include/c++/4.2.1/tr1/functional_iterate.h:909: error: cannot use typeid 
with -fno-rtti

Original comment by thakis@chromium.org on 7 Feb 2011 at 4:13

GoogleCodeExporter commented 9 years ago
The right fix for this is to just not use tr1, I think.  It's only a minor 
convenience in the code, and not worth the hassle.  I'll draw up a patch.

Original comment by csilv...@gmail.com on 8 Feb 2011 at 6:13

GoogleCodeExporter commented 9 years ago
Fixed in r22.  You should no longer require REQUIRES_RTTI=1 to build iwyu.

Original comment by csilv...@gmail.com on 11 Feb 2011 at 11:09