[Issue 20220] pragma(crt_constructor) does not work with clang 9

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 13 01:48:43 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20220

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #7 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MaskRay created dlang/dmd pull request #10562 "Use .init_array/.fini_array
instead of .ctors/.dtors" fixing this issue:

- Use .init_array/.fini_array instead of .ctors/.dtors

  Fix Issue 20220.

  dmd places global constructors in .ctors sections. When such sections
  are linked by lld, the executable will not run constructors on most
  modern Linux distributions (musl does not support .ctors/glibc is
  usually configured with NO_CTORS_DTORS_SECTIONS).

  GNU ld and gold convert .ctors/.dtors to .init_array/.fini_array by
  default, so programs linked by them are fine. lld does not support the
  feature and it probably makes little sense to add the support
  (https://bugs.llvm.org/show_bug.cgi?id=31224):
  .init_array has been supported by glibc for 20 years and adopted by most
  ELF platforms.

https://github.com/dlang/dmd/pull/10562

--


More information about the Digitalmars-d-bugs mailing list