www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - LDC and ARM 32 status?

reply Thomas Muldowney <d thomas.muldowneyclan.com> writes:
I've been trying to play with using LDC to compile to the target 
`arm-none-eabi` or `thumb-none-eabi`.  While I can get these 
targets to work with clang and my full llvm installation, I can 
not get my LDC to properly target them.

I played a fair deal with the target selector code in LDC.  Even 
trying to replace it largely with how clang does the selection, 
but I almost always ended up at the error:

Error: target 'thumb-none--eabi' is not yet supported

Any pointers on a direction to continue digging, or if this is 
just an area that's not ready yet, I'd love some info!

Thanks!
Nov 05 2016
next sibling parent Adrian Matoga <dlang.spam matoga.info> writes:
On Saturday, 5 November 2016 at 15:09:15 UTC, Thomas Muldowney 
wrote:
 I've been trying to play with using LDC to compile to the 
 target `arm-none-eabi` or `thumb-none-eabi`.  While I can get 
 these targets to work with clang and my full llvm installation, 
 I can not get my LDC to properly target them.

 I played a fair deal with the target selector code in LDC.  
 Even trying to replace it largely with how clang does the 
 selection, but I almost always ended up at the error:

 Error: target 'thumb-none--eabi' is not yet supported

 Any pointers on a direction to continue digging, or if this is 
 just an area that's not ready yet, I'd love some info!

 Thanks!
I would first try to compile with "-c -mtriple=arm-linux-eabi", then link the object(s) using GNU ld as you would with none-eabi target. You'll still need to provide at least empty stubs for some runtime features.
Nov 08 2016
prev sibling parent Adrian Matoga <dlang.spam matoga.info> writes:
On Saturday, 5 November 2016 at 15:09:15 UTC, Thomas Muldowney 
wrote:
 I've been trying to play with using LDC to compile to the 
 target `arm-none-eabi` or `thumb-none-eabi`.  While I can get 
 these targets to work with clang and my full llvm installation, 
 I can not get my LDC to properly target them.

 I played a fair deal with the target selector code in LDC.  
 Even trying to replace it largely with how clang does the 
 selection, but I almost always ended up at the error:

 Error: target 'thumb-none--eabi' is not yet supported

 Any pointers on a direction to continue digging, or if this is 
 just an area that's not ready yet, I'd love some info!

 Thanks!
Specifying only the architecture with "-march=thumb" or "-march=arm" should also work, see [1]. There are also some DConf presentations worth watching: [2] [3]. 1. https://wiki.dlang.org/Minimal_semihosted_ARM_Cortex-M_"Hello_World" 2. http://dconf.org/2014/talks/ruppe.html 3. http://dconf.org/2014/talks/franklin.html
Nov 08 2016