No runtime attribute?

Mike via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 10 04:28:00 PST 2014


On Wednesday, 10 December 2014 at 12:18:47 UTC, Mike wrote:
> On Wednesday, 10 December 2014 at 11:15:44 UTC, Stefan Koch 
> wrote:
>
>> It would be very nice if we could subsitute individual 
>> functions of the runtime library by  other functions or 
>> function pointers.
>
> I believe this is already possible with DMD because all 
> druntime functions are compiled as weak symbols.  I don't 
> believe this is the case for LDC and GDC, however.  If LDC and 
> GDC provided something equivalent to GCC's weak attribute, and 
> the runtime functions were decorated with it, then the same 
> method would work for all compilers.


Actually, I just remembered I've done this before with GDC and 
LDC.  You do it with ld's -wrap switch.

Example: 
http://forum.dlang.org/post/gqyzyldgdqhamtouyvcl@forum.dlang.org
LD's documentation: 
http://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html 
(see the bottom of the page)

Mike


More information about the Digitalmars-d mailing list