0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Installing GDC on macOS via Homebrew

Last updated at Posted at 2019-05-12

210515

They added official gdc support to macOS on gcc11. Now official gcc package installs gdc.

original

From GCC 9, GDC (D frontend) is available on GCC. However, it is not stable on macOS and a little tweak is required.

  • gcc/config.gcc, gcc/config/darwin-d.c, gcc/config/t-darwin

    • We need to tell gcc that D configuration is ready.
  • gcc/d/modules.cc

    • Section name needs to be segment,section format.
    • As libphobos/libdruntime/gcc/sections/osx.d mentions it, we selected __DATA,__minfodata.
  • libphobos/configure

    • We disabled shared library.
    • Otherwise core/thread.d fails to compile.
    • By the way I have not heard of mach-dylib built with D.
  • libphobos/libdruntime/config/x86/switchcontext.S

  • libphobos/libdruntime/gcc/drtstuff.c

    • start_minfo / stop_minfo needs to be compiled also on mach.
    • As these two needs to be executable, we selected __TEXT,minfo.
  • libphobos/libdruntime/gcc/sections/osx.d

    • We disabled libgphobos.dylib / libgdruntime.dylib warning.
      • Please note that libgphobos.a / libgdruntime.a are not affected but the compile option would be complex because -static would not work on macOS.
    • Also we add temporal d_dso_registry.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?