[swift-dev] Issues when building swift using GNU 2.26 related to protected symbols

Dmitri Gribenko gribozavr at gmail.com
Mon Feb 22 11:28:11 CST 2016


On Mon, Feb 22, 2016 at 9:07 AM, Joe Groff <jgroff at apple.com> wrote:
>
>> On Feb 20, 2016, at 8:06 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>>
>> Hi,
>>
>> I was running some tests using newer GNU ld, and I hit this issue:
>>
>> /usr/bin/ld: stdlib/public/core/linux/x86_64/Swift.o: relocation
>> R_X86_64_PC32 against protected symbol
>> `_Tvs19_emptyStringStorageVs6UInt32' can not be used when making a
>> shared object
>>
>> I could work around that issue by moving the definition into a C++
>> file, but that didn't get me far -- I got the same error, but about
>> '_TMPSa' (generic type metadata pattern for Swift.Array).
>>
>> Does it seem like a bug in LLVM codegen or another bug in GNU ld that
>> was introduced recently?
>>
>> This issue will prevent Swift from compiling on Ubuntu 16.04 or a recent Debian.
>
> Smells like a GNU ld bug to me. That relocation ought to be resolvable within the dynamic library, unless for some reason _Tvs19_emptyStringStorageVs6UInt32 is not defined in the standard library or runtime.

OK.  So what's the way forward?  Obviously, we can't leave Swift
broken on Ubuntu 16.04.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-dev mailing list