digitalmars.D.learn - Trying to cross compile from windows to android
- Jerry (11/11) Jan 20 2022 Hello, followed the guide at
- H. S. Teoh (13/24) Jan 20 2022 You're trying to use bfd as your linker, and I think that only exists on
- evilrat (5/8) Jan 21 2022 Here I documented some of the quirks I've hit during android
- Jerry (2/15) Jan 21 2022 Thank you mate, got it working now. With the ld linker.
- Jerry (4/5) Jan 21 2022 Found ld linker as you described.
- Jerry (3/8) Jan 21 2022 Or atleast that's what I thought, it links, but won't run,
Hello, followed the guide at https://wiki.dlang.org/Build_D_for_Android but got stuck on figuring out what linker to use. "../ldc_android/ldc/bin/ldc2.exe" -mtriple=armv7a--linux-andro ideabi main.d clang: error: invalid linker name in argument '-fuse-ld=bfd' Error: ldc_android/android_ndk/toolchains/llvm/prebuilt/windows-x86_64/bin /aarch64-linux-android21-clang.cmd failed with status: 1 Do I need to install a GNU linker with cross compile compatabilities or is my system not configured properly?
Jan 20 2022
On Thu, Jan 20, 2022 at 07:10:40PM +0000, Jerry via Digitalmars-d-learn wrote:Hello, followed the guide at https://wiki.dlang.org/Build_D_for_Android but got stuck on figuring out what linker to use. "../ldc_android/ldc/bin/ldc2.exe" -mtriple=armv7a--linux-andro ideabi main.d clang: error: invalid linker name in argument '-fuse-ld=bfd' Error: ldc_android/android_ndk/toolchains/llvm/prebuilt/windows-x86_64/bin /aarch64-linux-android21-clang.cmd failed with status: 1 Do I need to install a GNU linker with cross compile compatabilities or is my system not configured properly?You're trying to use bfd as your linker, and I think that only exists on the Linux version of the NDK. Maybe try looking somewhere under ldc_android/android_ndk/toolchains/x86_64-*/prebuilt/windows-x86_64/bin to see what linkers are shipped with your NDK, and specify that instead? On Linux, I see a bunch of binaries named x86_64-linux-android-*, including *-ld, *-ld.bfd, *-ld.gold, which are the 3 linkers that can be used via -fuse-ld=bfd, -fuse-ld=gold, etc.. I'm not sure how it works on Windows, but there should be corresponding binaries that might give a hint as to what's the correct -fuse-ld=... option you need to use. T -- Famous last words: I *think* this will work...
Jan 20 2022
On Thursday, 20 January 2022 at 19:31:06 UTC, H. S. Teoh wrote:I'm not sure how it works on Windows, but there should be corresponding binaries that might give a hint as to what's the correct -fuse-ld=... option you need to use.Here I documented some of the quirks I've hit during android prototyping. Works like this, no idea if it is still up to date though. https://github.com/Superbelko/android-sdl-d/blob/master/guide/README.md
Jan 21 2022
On Thursday, 20 January 2022 at 19:31:06 UTC, H. S. Teoh wrote:On Thu, Jan 20, 2022 at 07:10:40PM +0000, Jerry via Digitalmars-d-learn wrote: You're trying to use bfd as your linker, and I think that only exists on the Linux version of the NDK. Maybe try looking somewhere under ldc_android/android_ndk/toolchains/x86_64-*/prebuilt/windows-x86_64/bin to see what linkers are shipped with your NDK, and specify that instead? On Linux, I see a bunch of binaries named x86_64-linux-android-*, including *-ld, *-ld.bfd, *-ld.gold, which are the 3 linkers that can be used via -fuse-ld=bfd, -fuse-ld=gold, etc.. I'm not sure how it works on Windows, but there should be corresponding binaries that might give a hint as to what's the correct -fuse-ld=... option you need to use. TThank you mate, got it working now. With the ld linker.
Jan 21 2022
On Thursday, 20 January 2022 at 19:31:06 UTC, H. S. Teoh wrote:TFound ld linker as you described. Slapped on the --linker=ld flag and now everything is working. Thanks! :D
Jan 21 2022
On Friday, 21 January 2022 at 09:52:10 UTC, Jerry wrote:On Thursday, 20 January 2022 at 19:31:06 UTC, H. S. Teoh wrote:Or atleast that's what I thought, it links, but won't run, apparently bfd linker is required. So I installed that one.TFound ld linker as you described. Slapped on the --linker=ld flag and now everything is working. Thanks! :D
Jan 21 2022