-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross compiling for Raspberry Pi on Windows #2322
Comments
|
Joakim has just gotten it to work to cross-compile from Wine to ARM using the Android NDK for Windows, see #2301. You'll essentially have to customize the flags he used to your toolchain (the NDK uses clang, you use gcc...). Appending the CMake vars |
|
You'll definitely also need |
|
Thanks a lot. With these commands: I get this output: I will try further whether I can solve this issue using the mentioned CMAKE_BUILD_WITH_INSTALL_RPATH variable. |
|
You can append |
|
Almost there:) I checked the tool chain. In the folder gcc\arm-linux-gnueabihf\4.9\include There is another folder "arm-linux-gnueabihf\sysroot\usr\lib\gcc\arm-linux-gnueabihf\4.9.2\include" which contains "unwind.h" and "unwind-arm-common.h". I will try to find out whether this is an issue with the toolchain.. |
|
Solved, I copied unwind.h from the folder where it exists to the other folder where it was missing. |
|
Great. :) Could you please specify your final command-line? |
|
Yes:) I created a post on the forum of the gcc toolchain site |
|
Alright, that's how short I hoped the command lines to be when using a cross-gcc. Can you try adding |
|
yes I will try. Maybe a question, how do I now create an executable from e.g. sieve.d? ldc2 creates an obj file. From the wiki example it seems a o file is created... |
|
The executable was created fine, just a few warnings. I have to copy it to my raspberry pi and will tell you the result |
Firstly, it should be clear by now that you need to tell LDC to cross-compile to ARM via |
|
It seems there are some issues with the testrunner on raspberry pi. If I run it with command sudo ./phobos2-test-runner-debug |
|
There's apparently at least a threading issue with the |
|
Calling the command for std.stdio suceeds. It is strange because if all tests are called there is an error in log (log3.txt). I also called the command for core.thread. Here the result: Maybe it is related to the missing unwind.h file which was missing and I needed to copy from another folder? |
|
Wasn't SIGUSR1 in use by the Android runtime somehow? https://github.com/ldc-developers/druntime/blob/4d3b8c17936089f542ddaee00db9abc34e8e260a/src/core/thread.d#L1975-L1978 |
|
(I.e. this might be expected, and you might need to |
|
I also now tried to run the phobos unittest executable which does not contain debug information. The result is quite different. A segmentation fault is occuring |
|
I just noticed that Raspberry Pi is a 64 Bit ARM system. As this is work in progress (#2153) maybe some issues are related to this. I also tried to add the cflag and linkerflag -pthread but that solved no of the issues. |
|
But you're not targeting AArch64 with |
|
Just ignore what I have said, I just validated that my raspberry pi 2 is 32 Bit. The new raspberry pi 3 is 64 Bit. |
|
For the |
|
@andre2007 note that even with RPi3 chances are that you would be using 32-bit ARMv6, because that's only thing that Raspbian supports. 64-bit support only recently started to emerge from SUSE. As to RPi3, I was able to compile LDC 1.1 natively on RPi3 and then use it to compile a small vibe.d application back in December last year without issues IIRC, though I haven't time to work with D on RPi since then. |
|
Is there anything left to do here? The |
|
You are right, this issue can be closed. |
I try to cross compile to Raspberry Pi from Windows with almost no knowledge on LLVM/CMake/GCC..
Steps done:
I execute following comands
set CC=arm-linux-gnueabihf-gcc
ldc-build-runtime --ldcSrcDir="ldc-1.4.0-beta1-src" --ninja
Please find attached the error log. If I understand it correctly, CMake tries to create a windows executable for test purposes. This seems rather strange and cannot work as the cross compiler is intended to create linux arm executables..
log.txt
The text was updated successfully, but these errors were encountered: