Re: Mysterious linker warning "direct access … to global weak symbol … cannot be overridden at runtime"
Re: Mysterious linker warning "direct access … to global weak symbol … cannot be overridden at runtime"
- Subject: Re: Mysterious linker warning "direct access … to global weak symbol … cannot be overridden at runtime"
- From: Ken Thomases <email@hidden>
- Date: Wed, 19 Oct 2016 12:26:25 -0500
On Oct 19, 2016, at 11:41 AM, Jens Alfke <email@hidden> wrote:
>
> I’ve been getting about ten copies of the following linker warning every time I build one of the targets in my project, and today I’m trying to get rid of it, but to no avail. This is when building a simple 64-bit Mac command-line tool target (with Xcode 8.0), which imports a static library built by another target. I’ve never seen this particular warning before…
>
> First to make it more readable, here’s the warning with the details redacted:
>> ld: warning: direct access in function ‘…' from file ‘…' to global weak symbol ‘…' from file ‘…' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
>
> And here’s the full warning with the filenames and symbol names:
>> ld: warning: direct access in function 'Catch::extractClassName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' from file 'Build/Intermediates/LiteCore.build/Debug/LiteCoreCppTests.build/Objects-normal-asan/x86_64/main.o' to global weak symbol 'std::__1::char_traits<char>::eq(char, char)' from file 'Build/Products/Debug/libLiteCore-static.a(Tokenizer.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
>
> I get ten copies of this warning, all identical except for the “direct access in function ‘…’” naming a different function, i.e. they all name the same global weak symbol (which looks like part of the STL.)
>
> I have looked at the symbol visibility setting (GCC_SYMBOLS_PRIVATE_EXTERN) but changing it in either target has no effect.
Do the two targets have different deployment targets?
-Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden