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.
-Joe
···
On Feb 20, 2016, at 8:06 PM, Dmitri Gribenko <gribozavr@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.
OK. So what's the way forward? Obviously, we can't leave Swift
broken on Ubuntu 16.04.
Dmitri
···
On Mon, Feb 22, 2016 at 9:07 AM, Joe Groff <jgroff@apple.com> wrote:
On Feb 20, 2016, at 8:06 PM, Dmitri Gribenko <gribozavr@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.
Let's make sure it isn't our bug first. Is _Tvs19_emptyStringStorageVs6UInt32 defined in any of the .o or .a files that get linked into the core?
-Joe
···
On Feb 22, 2016, at 9:28 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 9:07 AM, Joe Groff <jgroff@apple.com <mailto:jgroff@apple.com>> wrote:
On Feb 20, 2016, at 8:06 PM, Dmitri Gribenko <gribozavr@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.
is there a reliable way to trigger the error? I haven’t seen this on any of my machines (all Ubuntu 14.04 or 15.<whatever>)
Try building on Ubuntu 16.04 or Debian Sid.
16.04 isn't released till April, right?
Right.
Any chance we can report this problem to them and hopefully get a fix before then?
Possibly. Someone other than me should do this, though. William, if
you are interested, could you do this? It would be best if we could
create a simple example that demonstrates the issue.
Dmitri
···
On Mon, Feb 22, 2016 at 10:39 AM, Joe Groff <jgroff@apple.com> wrote:
On Feb 22, 2016, at 10:33 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 10:27 AM, William Dillon >> <william@housedillon.com> wrote:
On Feb 22, 2016, at 10:58 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 10:39 AM, Joe Groff <jgroff@apple.com> wrote:
On Feb 22, 2016, at 10:33 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 10:27 AM, William Dillon >>> <william@housedillon.com> wrote:
is there a reliable way to trigger the error? I haven’t seen this on any of my machines (all Ubuntu 14.04 or 15.<whatever>)
Try building on Ubuntu 16.04 or Debian Sid.
16.04 isn't released till April, right?
Right.
Any chance we can report this problem to them and hopefully get a fix before then?
Possibly. Someone other than me should do this, though. William, if
you are interested, could you do this? It would be best if we could
create a simple example that demonstrates the issue.
So, I was able to reproduce Dmitri’s error on 16.04. Adding -Bsymbolic to the linker arguments in cmake/modules/AddSwift.cmake makes it go away. Of course, it is unsatisfying to have this regression after Joe’s excellent work making them obsolete.
- Will
···
On Feb 22, 2016, at 11:11 AM, William Dillon via swift-dev <swift-dev@swift.org> wrote:
I’ll see what I can find. I’m bringing up a VM.
On Feb 22, 2016, at 10:58 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 10:39 AM, Joe Groff <jgroff@apple.com> wrote:
On Feb 22, 2016, at 10:33 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:
On Mon, Feb 22, 2016 at 10:27 AM, William Dillon >>>> <william@housedillon.com> wrote:
is there a reliable way to trigger the error? I haven’t seen this on any of my machines (all Ubuntu 14.04 or 15.<whatever>)
Try building on Ubuntu 16.04 or Debian Sid.
16.04 isn't released till April, right?
Right.
Any chance we can report this problem to them and hopefully get a fix before then?
Possibly. Someone other than me should do this, though. William, if
you are interested, could you do this? It would be best if we could
create a simple example that demonstrates the issue.
Thanks for trying it out, Will. I agree that requiring -Bsymbolic is unfortunate, but it's good to know we have a workaround in case this can't be fixed in time for 16.04.
-Joe
···
On Feb 23, 2016, at 8:31 AM, William Dillon via swift-dev <swift-dev@swift.org> wrote:
Geez, VMs are slow… :)
So, I was able to reproduce Dmitri’s error on 16.04. Adding -Bsymbolic to the linker arguments in cmake/modules/AddSwift.cmake makes it go away. Of course, it is unsatisfying to have this regression after Joe’s excellent work making them obsolete.