r189535 - Add missing definitions to unwind.h.

Peter Collingbourne peter at pcc.me.uk
Thu Aug 29 11:45:51 PDT 2013


On Thu, Aug 29, 2013 at 08:26:01AM -0600, Charles Davis wrote:
> 
> On Aug 29, 2013, at 2:57 AM, Alexey Samsonov wrote:
> 
> > Hi!
> > 
> > This is causing Android build failures on our bot:
> > 
> > [  0%] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.android.dir/sanitizer_posix.cc.o
> > In file included from /build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:43:
> > /build/llvm_build64/bin/../lib/clang/3.4/include/unwind.h:71:19: error: typedef redefinition with different types ('uintptr_t' (aka 'unsigned int') vs 'unsigned long *')
> > typedef uintptr_t _Unwind_Ptr;
> >                   ^
> > /build/../../../android-ndk/standalone/sysroot/usr/include/link.h:47:28: note: previous definition is here
> > typedef long unsigned int* _Unwind_Ptr;
> What's that even doing there? Is there some sort of macro that the Android NDK defines when it defines that type? We may need to protect our own definitions with it.

https://github.com/android/platform_bionic/blob/master/libc/include/link.h

Nothing other than the header guard.  We will probably either have
to protect our definition like this:

#if !defined(__ANDROID__) || !defined(__arm) || !defined(_LINK_H_)

or declare that Android's header is broken, and modify compiler-rt
to avoid including both headers in the same TU.  I'm tending towards
the latter given that GCC's unwind.h has a similar "problem".

Thanks,
-- 
Peter



More information about the cfe-commits mailing list