gentoo / dlang

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

Various fixes #124

Closed the-horo closed 11 months ago

the-horo commented 1 year ago

A bunch of small features and improvements, no major fixes.

744442c6d16962c09d24a336ef2bd92087f35735 is a little more interesting than the others. Since ldc2 uses the CommandLine llvm utility, passing multiple arguments for the same option causes an error (even if all those arguments have the same value). So, by embedding -relocation-model=pic into the executable it will be impossible to pass the -relocation-model flag at runtime lest an error occurs. This is actually what happens in dmd, and because the failure wasn't caught by the ebuild, it would continue to try to build phobos and druntime where is shold have failed. Instead, the build script fell back to using /usr/bin/dmd, without outputting any messages that it did or that it was compiling anything and it happened to work. I only noticed the bug because of the weird line:

ldc2: for the --relocation-model option: may only occur zero or one times!

which I assumed was a warning because I couldn't see any error but the truncated long hinted at a bigger problem. A proper check has been added in 52fbe825e5cd9252ce80e3297aebc9805ec5f57d making sure that the build script finished succesfully. ldc2 defaults to pic on linux anyway so nothing is lost if we don't add the flag ourselves.