[Issue 20144] New: standard pragma for weak linkage
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 19 23:16:19 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20144
Issue ID: 20144
Summary: standard pragma for weak linkage
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: turkeyman at gmail.com
Marking symbols with weak linkage is common, and necessary in a lot of designs.
Currently, describing weak linkage is implementation dependent, and also
platform dependent.
Since D doesn't have a preprocessor, and we have no aliasing mechanism for
attributes or pragmas, it's impossible to wrangle all of this into one
expression.
The language needs to specify a weak linkage pragma, which can be mapped
appropriately everywhere.
`pragma(weak, true) void fun() {}` for instance; please choose you preferred
name.
GDC/LDC will map this to their backend directly (where they currently expose
implementation defined attributes), DMD needs to implement this, which is
mostly trivial.
Posix just flags it in the output, and MS/Windows does this by embedding a
linker directive in the output.
We need this. It is time.
--
More information about the Digitalmars-d-bugs
mailing list