Writing a Linux driver in the D ecosystem

welkam wwwelkam at gmail.com
Tue Oct 23 13:20:27 UTC 2018


On Tuesday, 23 October 2018 at 12:06:48 UTC, Eduard Staniloiu 
wrote:
>    * how should the makefiles be changed
>    * Is gdc the best option to create an object file that can 
> link with the existing objects (that were generated by using 
> gcc)?
>  * if everything goes well, how can we insert the generated 
> module? Would/Should it just work with insmod?

The only experience I have with C and D linking is DMD compiler. 
Parts of it are still in C and when I tried to compile DMD with 
clang/ldc and clang/dmd everything linked and worked without any 
change because both emit C ABI and ELF object files.

If you write your code with -betterC and mark your functions with 
extern (C) the linker should treat your object file as it was 
compiled from C code


More information about the Digitalmars-d mailing list