ARM Cortex-M - Static array dyamically allocated

Mike none at none.com
Fri Dec 20 17:58:49 PST 2013


On Saturday, 21 December 2013 at 00:07:17 UTC, Mike wrote:
> On Friday, 20 December 2013 at 20:18:43 UTC, Timo Sintonen 
> wrote:
>>> Object.d seems to be a special case in many ways.
>>> When building minlibd I was not able to have an empty or my 
>>> own object.d and it had to be named object_.d
>>> I do not remember any more what all the problems were.
>>>
>>> Object.d (or .di) is always imported even if it is not 
>>> mentioned. In this case gdc may find another object.d from 
>>> the standard library. Current directory is not searched 
>>> unless you put -I. to the command line. There may now be two 
>>> conflicting files.
>>
>> Actually, the situation may also be the opposite:
>> object.d is found in the current directory and imported twice, 
>> but the current directory is not in the include search path 
>> and so the file is not accepted as a valid library file.
>
> Thanks Timo,
>
> You're right: object.d and/or object.di are imported 
> automatically from the current directory with or without the 
> -I. option.  Therefore, removing object.d from my compile line 
> got rid of the duplicate messages, but one instance still 
> remains.
>
> Here's my new compile line:
> arm-none-eabi-gdc -I. -march=armv7e-m -mcpu=cortex-m4 
> -mtune=cortex-m4 -mthumb -fno-emit-moduleinfo -c 
> -ffunction-sections -fno-exceptions -fdata-sections start.d
>
> notice I've removed object.d, but the file still exists in the 
> same folder as start.d
>
> I tried:
> 1) adding the -I. to the compile line to make my object.d 
> *official*
> 2) moving my object.d to my default include folder
> 3) renaming object.d to object.di and repeating 1. and 2.
> 4) renaming object.d to object_.d and repeating 1. and 2.
>
> All of these still produce the same error messages.  The 
> interesting thing is I was able to compile my code with my 
> build from the *official* GDC 4.8 branch; but Johannes's 
> arm-old backport gives me the object.d errors.  So, something 
> must have changed since the 4.8 branch.
>
> If object.d is special, please let me know how its handled.  Is 
> this actually a question for the DMD folks?
>
> Thanks,
> Mike

I should probably add that if I remove my object.d file from the 
file system, I get:

cc1d: error: cannot find source code for runtime library file 
'object.d'
cc1d: note: dmd might not be correctly installed. Run 'dmd -man' 
for installation instructions.

I compiled gdc with the without the default phobos/runtime 
library, so my default include and lib folders are empty.

object.d: Can't compile with it; can't compile without it.


More information about the D.gnu mailing list