{"action":"created","issue":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/2322","repository_url":"https://api.github.com/repos/ldc-developers/ldc","labels_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2322/labels{/name}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2322/comments","events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2322/events","html_url":"https://github.com/ldc-developers/ldc/issues/2322","id":256537636,"number":2322,"title":"Cross compiling for Raspberry Pi on Windows","user":{"login":"andre2007","id":1451047,"avatar_url":"https://avatars2.githubusercontent.com/u/1451047?v=4","gravatar_id":"","url":"https://api.github.com/users/andre2007","html_url":"https://github.com/andre2007","followers_url":"https://api.github.com/users/andre2007/followers","following_url":"https://api.github.com/users/andre2007/following{/other_user}","gists_url":"https://api.github.com/users/andre2007/gists{/gist_id}","starred_url":"https://api.github.com/users/andre2007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre2007/subscriptions","organizations_url":"https://api.github.com/users/andre2007/orgs","repos_url":"https://api.github.com/users/andre2007/repos","events_url":"https://api.github.com/users/andre2007/events{/privacy}","received_events_url":"https://api.github.com/users/andre2007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-09-10T20:26:43Z","updated_at":"2017-09-11T18:02:26Z","closed_at":null,"author_association":"NONE","body":"I try to cross compile to Raspberry Pi from Windows with almost no knowledge on LLVM/CMake/GCC..\r\n\r\nSteps done:\r\n- I use ldc2-1.4.0-beta1-win32-msvc\r\n- Zip file ldc-1.4.0-beta1-src is downloaded and extracted (--ldcSrcDir switch)\r\n- ninja / cmake are installed and in PATH environment variable\r\n- GCC toolchain installed from here http://gnutoolchains.com/raspberry/ (2016-09-23-raspbian-jessie)\r\n\r\nI execute following comands\r\nset CC=arm-linux-gnueabihf-gcc\r\nldc-build-runtime --ldcSrcDir=\"ldc-1.4.0-beta1-src\" --ninja\r\n\r\nPlease 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..\r\n\r\n[log.txt](https://github.com/ldc-developers/ldc/files/1290909/log.txt)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments/328609653","html_url":"https://github.com/ldc-developers/ldc/issues/2322#issuecomment-328609653","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/2322","id":328609653,"user":{"login":"kinke","id":1889215,"avatar_url":"https://avatars0.githubusercontent.com/u/1889215?v=4","gravatar_id":"","url":"https://api.github.com/users/kinke","html_url":"https://github.com/kinke","followers_url":"https://api.github.com/users/kinke/followers","following_url":"https://api.github.com/users/kinke/following{/other_user}","gists_url":"https://api.github.com/users/kinke/gists{/gist_id}","starred_url":"https://api.github.com/users/kinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinke/subscriptions","organizations_url":"https://api.github.com/users/kinke/orgs","repos_url":"https://api.github.com/users/kinke/repos","events_url":"https://api.github.com/users/kinke/events{/privacy}","received_events_url":"https://api.github.com/users/kinke/received_events","type":"User","site_admin":false},"created_at":"2017-09-11T18:02:26Z","updated_at":"2017-09-11T18:02:26Z","author_association":"MEMBER","body":"> how do I now create an executable from e.g. sieve.d?\r\n[...]\r\nldc2 -c sieve.d\r\narm-linux-gnueabihf-gcc sieve.obj -o executable\r\n[...]\r\nsieve.obj: file not recognized: File format not recognized\r\n\r\nFirstly, it should be clear by now that you need to tell LDC to cross-compile to ARM via `-mtriple=arm-linux-gnueabihf`, it obviously targets native Win32 by default.\r\nThen for linking, you need to specify the cross-compiled runtime libs: `gcc -L.../ldc-build-runtime.tmp/lib -ldruntime-ldc -lphobos2-ldc`. The other option is to link via LDC, telling it about your cross-gcc and runtime libs directory: `ldc2 -mtriple=arm-linux-gnueabihf helloWorld.d -gcc=.../gcc.exe -L-L.../ldc-build-runtime.tmp/lib`."}}
{"actor":{"display_login":"kinke"}}