Installing GDC on macOS via Homebrew
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
- We stripped section manipulation according to https://stackoverflow.com/questions/20907946/error-unknown-directive-type-func-function .
-
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
.
- We disabled libgphobos.dylib / libgdruntime.dylib warning.
- This is combined as https://github.com/cielavenir/homebrew-ciel/blob/master/patch/gcc9.patch and testing formula is in https://github.com/cielavenir/homebrew-ciel/blob/master/patch/gcc.rb .
PR is at https://github.com/Homebrew/homebrew-core/pull/39712 .
Bottles are in https://dl.bintray.com/cielavenir/homebrew/ . For ease, I have upload the same file for high_sierra and mojave as well as sierra.
Author And Source
この問題について(Installing GDC on macOS via Homebrew), 我々は、より多くの情報をここで見つけました https://qiita.com/cielavenir/items/432cfe684341f568a9d7著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .