Embedded Linux really needs Dlang for the IOT market
Radu
void at null.pt
Fri Mar 9 14:30:44 UTC 2018
On Friday, 9 March 2018 at 11:35:58 UTC, aberba wrote:
> On Friday, 9 March 2018 at 09:12:28 UTC, Radu wrote:
>> On Friday, 9 March 2018 at 03:09:16 UTC, dangbinghoo wrote:
>>> [...]
>>
>> I'm working in BAS(Building Automation System) sector, and I
>> use Dlang daily for some advance products targeting ARM/Mips
>> boards.
>>
>> D on Glibc/Linux/ARM works great today! It is well supported
>> and getting LDC to cross-compile is as easy as those 100 and
>> so words say! I'm using Ubuntu shell on Windows (WSL) and this
>> makes things even more exciting. Actually the hardest part is
>> getting the C cross tool-chain for your system, not LDC, I
>> find this pretty amusing.
>
> A tutorial or guide on "cross tool-chain for your system" will
> be very helpful. Say in ARM. Not that obvious to someone like
> me.
>
>>
>> Recently I had to port the software to uClibc/Linux/ARM, hence
>> my latest efforts on the port have followed with some patches
>> for Druntime, Phobos and LDC. I think, minus 2 PRs, it is
>> pretty close to complete. On my target system I've got it
>> working including vibe.d.
>
> Nice. Vibe.d sound great!! Especially for IoT stuff. Get some
> Pi to talk to APIs and services.
>
>>
>> I suggest that you give it a try, and if you find issues
>> contribute!
For LDC on ubuntu is is pretty straight forward
1. Get cross tools for ARM, let's say ARM HF (hardware floating
point)
> sudo apt-get install gcc-arm-linux-gnueabihf
2. Install LDC
3. Build cross libraries for LDC
From https://wiki.dlang.org/Building_LDC_runtime_libraries:
>mkdir ldc-arm-linux-hf
>cd ldc-arm-linux-hf
>CC=arm-linux-gnueabihf-gcc ldc-build-runtime
>--dFlags="-w;-mtriple=arm-linux-gnueabihf"
>--targetSystem="Linux;UNIX"
Your cross compiled druntime and phobos libs will be the result
of this step, they are located in the
`/path/to/ldc-arm-linux-hf/lib` folder.
4. Compile your code
>ldc2 -mtriple=arm-linux-gnueabihf -gcc=arm-linux-gnueabihf-gcc
>-L=-L/path/to/ldc-arm-linux-hf/lib awesome.d
You now have an linux arm hf binary that can run on your target
device.
More information about the Digitalmars-d
mailing list