Minseong Kim via llvm-dev
2017-Mar-23 04:29 UTC
[llvm-dev] Linking android with lld: aarch64 target
It would be great if anyone can share your thoughts about the cause and possibly fix of the error below ? I would like to know why it is caused and how it can be fixed (if possible) ? The error message is: ~/llvm/build/install_android/linux-x86/clang-3688880/bin/ld.lld: error: external/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S:1202: can't create dynamic relocation R_AARCH64_PREL64 against symbol 'OPENSSL_armcap_P' defined in out/target/product/hikey/obj/STATIC_LIBRARIES/libcrypto_ intermediates/libcrypto.a(sha1-armv8.o) clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation) cheers, -- Min -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170323/270b1595/attachment-0001.html>
Peter Smith via llvm-dev
2017-Mar-23 12:35 UTC
[llvm-dev] Linking android with lld: aarch64 target
Hello Min, This error message occurs when the linker would have to create a dynamic relocation in a read-only part of the program, which isn't usually allowed when making a position independent shared-library or position independent executable. In practice this usually means that one or more of the objects hasn't been compiled to be position independent -fPIC. It is difficult to tell much more without knowing the compiler and linker options. The R_AARCH64_PREL64 relocation is a relative relocation, this can require a dynamic relocation if the symbol it refers to is preemptible (i.e another definition of the symbol could potentially override it at load-time). Given that the file sha1-armv8.S is an assembler file, and I assume that the link with the same inputs works on ld.bfd and ld.gold, I can only think that it will either be lld is selecting a different object, or ld.bfd and ld.gold are resolving the R_AARCH64_PREL64 relocation in this case and lld is not. Peter On 23 March 2017 at 04:29, Minseong Kim via llvm-dev <llvm-dev at lists.llvm.org> wrote:> It would be great if anyone can share your thoughts about the cause and > possibly fix of the error below ? > > I would like to know why it is caused and how it can be fixed (if possible) > ? > > The error message is: > > ~/llvm/build/install_android/linux-x86/clang-3688880/bin/ld.lld: error: > external/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S:1202: can't create > dynamic relocation R_AARCH64_PREL64 against symbol 'OPENSSL_armcap_P' > defined in > out/target/product/hikey/obj/STATIC_LIBRARIES/libcrypto_intermediates/libcrypto.a(sha1-armv8.o) > clang-5.0: error: linker command failed with exit code 1 (use -v to see > invocation) > > cheers, > -- Min > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Minseong Kim via llvm-dev
2017-Mar-24 07:18 UTC
[llvm-dev] Linking android with lld: aarch64 target
On 23 March 2017 at 21:35, Peter Smith <peter.smith at linaro.org> wrote:> Hello Min, > > This error message occurs when the linker would have to create a > dynamic relocation in a read-only part of the program, which isn't > usually allowed when making a position independent shared-library or > position independent executable. In practice this usually means that > one or more of the objects hasn't been compiled to be position > independent -fPIC. >OK~ I will check the objects to be linked, if they are compiled (with -fPIC or not). It is difficult to tell much more without knowing the compiler and> linker options. The R_AARCH64_PREL64 relocation is a relative > relocation, this can require a dynamic relocation if the symbol it > refers to is preemptible (i.e another definition of the symbol could > potentially override it at load-time). > > Given that the file sha1-armv8.S is an assembler file, and I assume > that the link with the same inputs works on ld.bfd and ld.gold, I can > only think that it will either be lld is selecting a different object, > or ld.bfd and ld.gold are resolving the R_AARCH64_PREL64 relocation in > this case and lld is not. >Yes, both ld.bfd and ld.gold works with the same inputs. I will keep looking for the cause with your suggestions in mind. Thanks again, Peter. cheers, -- Min> Peter > > On 23 March 2017 at 04:29, Minseong Kim via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > It would be great if anyone can share your thoughts about the cause and > > possibly fix of the error below ? > > > > I would like to know why it is caused and how it can be fixed (if > possible) > > ? > > > > The error message is: > > > > ~/llvm/build/install_android/linux-x86/clang-3688880/bin/ld.lld: error: > > external/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S:1202: can't > create > > dynamic relocation R_AARCH64_PREL64 against symbol 'OPENSSL_armcap_P' > > defined in > > out/target/product/hikey/obj/STATIC_LIBRARIES/libcrypto_ > intermediates/libcrypto.a(sha1-armv8.o) > > clang-5.0: error: linker command failed with exit code 1 (use -v to see > > invocation) > > > > cheers, > > -- Min > > > > > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170324/e2942412/attachment.html>