RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

Mike via Digitalmars-d digitalmars-d at puremagic.com
Wed May 6 05:50:43 PDT 2015


On Tuesday, 5 May 2015 at 08:13:21 UTC, Mike wrote:
> On Tuesday, 5 May 2015 at 06:39:42 UTC, Dan Olson wrote:
>
>>
>>> LDC Folks:  https://github.com/ldc-developers/ldc/issues/781 
>>> is
>>> currently preventing me from supporting LDC with this runtime.
>>
>> I looked at this and found a workaround and noted it in the 
>> above issue
>> link.
>
> Many Thanks!
>
> I've gotten further thanks to your help, but now I'm stuck on
> https://github.com/ldc-developers/ldc/issues/925.
>
> Mike

I've gotten even further thanks to everyone's help, but LDC is 
still giving me a little grief.  Take a look at these undefined 
references (abbreviated for this forum):

(_D10TypeInfo_l6__vtblZ+0x8): undef ref 
`_D6object8TypeInfo8toStringMxFNaNbNfZAya'
(_D10TypeInfo_l6__vtblZ+0x10): undef ref 
`_D6object8TypeInfo6toHashMxFNbNeZm'
(_D10TypeInfo_l6__vtblZ+0x18): undef ref 
`_D6object8TypeInfo5opCmpMFC6ObjectZi'
(_D10TypeInfo_l6__vtblZ+0x20): undef ref 
`_D6object8TypeInfo8opEqualsMFC6ObjectZb'
(_D10TypeInfo_l6__vtblZ+0x28): undef ref 
`_D6object8TypeInfo7getHashMxFNbNexPvZm'
(_D10TypeInfo_l6__vtblZ+0x30): undef ref 
`_D6object8TypeInfo6equalsMxFxPvxPvZb'
(_D10TypeInfo_l6__vtblZ+0x38): undef ref 
`_D6object8TypeInfo7compareMxFxPvxPvZi'
(_D10TypeInfo_l6__vtblZ+0x40): undef ref 
`_D6object8TypeInfo5tsizeMxFNaNbNdNiNfZm'
(_D10TypeInfo_l6__vtblZ+0x48): undef ref 
`_D6object8TypeInfo4swapMxFPvPvZv'
(_D10TypeInfo_l6__vtblZ+0x50): undef ref 
`_D6object8TypeInfo4nextMNgFNaNbNdNiZNgC8TypeInfo'
(_D10TypeInfo_l6__vtblZ+0x58): undef ref 
`_D6object8TypeInfo4initMxFNaNbNiNfZAxv'
(_D10TypeInfo_l6__vtblZ+0x60): undef ref 
`_D6object8TypeInfo5flagsMxFNaNbNdNiNfZk'
(_D10TypeInfo_l6__vtblZ+0x68): undef ref 
`_D6object8TypeInfo5offTiMxFZAxS6object14OffsetTypeInfo'
(_D10TypeInfo_l6__vtblZ+0x70): undef ref 
`_D6object8TypeInfo7destroyMxFPvZv'
(_D10TypeInfo_l6__vtblZ+0x78): undef ref 
`_D6object8TypeInfo8postblitMxFPvZv'
(_D10TypeInfo_l6__vtblZ+0x80): undef ref 
`_D6object8TypeInfo6talignMxFNaNbNdNiNfZm'
(_D10TypeInfo_l6__vtblZ+0x88): undef ref 
`_D6object8TypeInfo8argTypesMFNbNfJC8TypeInfoJC8TypeInfoZi'
(_D10TypeInfo_l6__vtblZ+0x90): undef ref 
`_D6object8TypeInfo6rtInfoMxFNaNbNdNiNfZPyv'
  In function `_D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv':
(.text._D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv[_D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x1c): 
undef ref `_D3std5stdio6stdoutS3std5stdio4File'
(.text._D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv[_D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x41): 
undef ref `fprintf'
(.text._D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv[_D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x81): 
undef ref 
`_D3std9exception14__T7enforceTbZ7enforceFNaNfbLAxaAyamZb'
  In function `_Dmain':
(.text._Dmain+0x36): undef ref `memset'
(_D27TypeInfo_S4main10TestStruct6__initZ[_D27TypeInfo_S4main10TestStruct6__initZ]+0x70): 
undef ref `_D10TypeInfo_g6__initZ'
(_D4main9TestClass6__vtblZ+0x8): undef ref 
`_D6object6Object8toStringMFZAya'
(_D4main9TestClass6__vtblZ+0x10): undef ref 
`_D6object6Object6toHashMFNbNeZm'
(_D4main9TestClass6__vtblZ+0x18): undef ref 
`_D6object6Object5opCmpMFC6ObjectZi'
(_D4main9TestClass6__vtblZ+0x20): undef ref 
`_D6object6Object8opEqualsMFC6ObjectZb'
(_D12TypeInfo_Axm6__initZ[_D12TypeInfo_Axm6__initZ]+0x0): undef 
ref `_D14TypeInfo_Array6__vtblZ'
(_D11TypeInfo_xm6__initZ[_D11TypeInfo_xm6__initZ]+0x10): undef 
ref `_D10TypeInfo_m6__initZ'
(_D11TypeInfo_ya6__initZ[_D11TypeInfo_ya6__initZ]+0x10): undef 
ref `_D10TypeInfo_a6__initZ'
(_D12TypeInfo_xAa6__initZ[_D12TypeInfo_xAa6__initZ]+0x10): undef 
ref `_D12TypeInfo_Axa6__initZ'
(_D11TypeInfo_xb6__initZ[_D11TypeInfo_xb6__initZ]+0x10): undef 
ref `_D10TypeInfo_b6__initZ'
(_D11TypeInfo_xi6__initZ[_D11TypeInfo_xi6__initZ]+0x10): undef 
ref `_D10TypeInfo_i6__initZ'
(_D11TypeInfo_xa6__initZ[_D11TypeInfo_xa6__initZ]+0x10): undef 
ref `_D10TypeInfo_a6__initZ'
(_D11TypeInfo_xh6__initZ[_D11TypeInfo_xh6__initZ]+0x10): undef 
ref `_D10TypeInfo_h6__initZ'
(_D11TypeInfo_xk6__initZ[_D11TypeInfo_xk6__initZ]+0x10): undef 
ref `_D10TypeInfo_k6__initZ'
(_D13TypeInfo_xAya6__initZ[_D13TypeInfo_xAya6__initZ]+0x10): 
undef ref `_D12TypeInfo_Aya6__initZ'

This is far more than what I get with DMD and GDC.  You can see 
why TypeInfo is a major pain, and as far as I can tell, I don't 
have any code that needs it.

But what's most surprising is the call to fprintf for 
std.writeln, even though my implementation is actually a system 
call in assembly:  
https://github.com/JinShil/minimal_druntime_experiment/blob/master/source/ports/posix/linux/phobos/phobosPort.d#L6

I'm compiling with: ldc2 -c -defaultlib=  -release

Are there any compiler flags I can add to help trim the fat?

Thanks,
Mike



More information about the Digitalmars-d mailing list