[cfe-commits] r151058 - /cfe/trunk/lib/Headers/unwind.h

Jeffrey Yasskin jyasskin at google.com
Tue Feb 28 10:22:59 PST 2012


Hm, what if you link Firefox against libunwind's .so instead of
libgcc_s's? Is there a way to define headers so they work either
statically or dynamically linked? Is this a bug in libunwind's
headers?

2012/2/28 Rafael Espíndola <rafael.espindola at gmail.com>:
> Sorry, I was wrong and did broke firefox build with clang if libunwind
> is installed. Unlike gcc's version of teh header, the one in libunwind
> doesn't set the visibility and the build fails with
>
> /home/espindola/inst/binutils/bin/ld: error:
> /home/espindola/mozilla-mozilla-central/obj-x86_64-unknown-linux-gnu/toolkit/library/../../xpcom/base/nsStackWalk.o:
> requires dynamic R_X86_64_PC32 reloc against '_Unwind_Backtrace' which
> may overflow at runtime; recompile with -fPIC
>
> You can probably fix it by using push/pop visibility. Can you take a look at it?
>
> On 21 February 2012 11:20, Jeffrey Yasskin <jyasskin at google.com> wrote:
>> Author: jyasskin
>> Date: Tue Feb 21 10:20:12 2012
>> New Revision: 151058
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=151058&view=rev
>> Log:
>> Allow linux builds to take advantage of libunwind to get unwind.h if
>> that's installed.
>>
>> Modified:
>>    cfe/trunk/lib/Headers/unwind.h
>>
>> Modified: cfe/trunk/lib/Headers/unwind.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/unwind.h?rev=151058&r1=151057&r2=151058&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Headers/unwind.h (original)
>> +++ cfe/trunk/lib/Headers/unwind.h Tue Feb 21 10:20:12 2012
>> @@ -23,9 +23,19 @@
>>
>>  /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
>>
>> -#if defined(__APPLE__) && __has_include_next(<unwind.h>)
>> -/* Darwin typically has its own unwind.h; use it. */
>> -#  include_next <unwind.h>
>> +#if __has_include_next(<unwind.h>)
>> +/* Darwin and libunwind provide an unwind.h. If that's available, use
>> + * it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
>> + * so define that around the include.*/
>> +# ifndef _GNU_SOURCE
>> +#  define _SHOULD_UNDEFINE_GNU_SOURCE
>> +#  define _GNU_SOURCE
>> +# endif
>> +# include_next <unwind.h>
>> +# ifdef _SHOULD_UNDEFINE_GNU_SOURCE
>> +#  undef _GNU_SOURCE
>> +#  undef _SHOULD_UNDEFINE_GNU_SOURCE
>> +# endif
>>  #else
>>
>>  #include <stdint.h>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list