annotating (object/library files) with compilation metadata to avoid incompatible libraries

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 31 10:48:22 PST 2016


On 20 December 2016 at 13:04, Timothee Cour via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> Could dmd/ldc/gdc produce user defined attributes embedded (eg as json
> string) embedded in some section of the object file/static/shared library,
> eg:
>
> ```
> {"compiler" : "dmd", "version" : "2.072", "flags" : "-O -debug"}
> ```
>

Object file, yes. Static library, no. Shared library, maybe, but you
probably won't read them anyway.

I toyed about with such an idea to support pragma(lib), but I shelved
it when I realised that it would only work for sources being built
(there is an .o passed on the command-line), and not for external
libraries.


More information about the Digitalmars-d mailing list