gentoo / dlang

[MIRROR] D programming language ebuild repository
https://gitweb.gentoo.org/repo/user/dlang.git
GNU General Public License v2.0
30 stars 23 forks source link

dmd.eclass: Properly assign DC when not selfhosting #123

Closed the-horo closed 1 year ago

the-horo commented 1 year ago

In 2adabe7 I added DC="${DMD}" to the dlang_compile_bin function. This only happens to be valid when the compiler is dmd. This is because dlang_compile_bin will pass arguments to the compiler thinking that said compiler is the actual compiler and not a wrapper script.

When compiling with ldc, so long as the user hasn't specified any LDCFLAGS, the build will work fine. For gdc however, the eclass always adds -shared-libphobos to GDCFLAGS which is a value gdmd doesn't understand and which will lead to a failure. When I tested the commit I only tested it for dmd and ldc (for which I had no flags in make.conf) and it seemed to work fine. Least to say I will try to do less such assumptions in the future.

mleise commented 1 year ago

Oh, good that you noticed it. Mostly people probably self-host or use the latest LDC2. So even if there was a bug in the commit, you fixed more than you broke. ;-)