@@ -58,6 +58,8 @@ struct Compiler
5858
5959 bool usesIncremental = false ;
6060
61+ // /Currently unused. Was used before for checking whether --start-group should be emitted or not. Since it is emitted
62+ // /by default, only on webAssembly which is not, it lost its usage for now.
6163 bool usesGnuLinker = false ;
6264
6365
@@ -218,12 +220,13 @@ Compiler getCompiler(string compilerOrPath = "dmd", string compilerAssumption =
218220 ret.usesGnuLinker = compilersInfo[" defaultsToGnuLd" ].boolean;
219221
220222 // Checks for ldc.conf switches to see if it is using gnu linker by default
221- if (ret.compiler == AcceptedCompiler.ldc2)
222- {
223- int res = isUsingGnuLinker(ret.binOrPath, arch);
224- if (res != UsesGnuLinker.unknown)
225- ret.usesGnuLinker = res == UsesGnuLinker.yes ? true : false ;
226- }
223+ // /TODO: Might be reactivated if that issue shows again.
224+ // if(ret.compiler == AcceptedCompiler.ldc2)
225+ // {
226+ // int res = isUsingGnuLinker(ret.binOrPath, arch);
227+ // if(res != UsesGnuLinker.unknown)
228+ // ret.usesGnuLinker = res == UsesGnuLinker.yes ? true : false;
229+ // }
227230
228231
229232 return ret;
@@ -236,28 +239,28 @@ Compiler getCompiler(string compilerOrPath = "dmd", string compilerAssumption =
236239 * arch = Which architecture this compiler run is running with
237240 * Returns: -1 for can't tell. 0 if false and 1 if true
238241 */
239- private UsesGnuLinker isUsingGnuLinker (string ldcPath, string arch)
240- {
241- import redub.misc.ldc_conf_parser;
242- import std.file ;
243- import std.algorithm.searching ;
244- ConfigSection section = getLdcConfig(std.file.getcwd (), ldcPath, arch);
245- if (section == ConfigSection.init)
246- return UsesGnuLinker.unknown;
247- string * switches = " switches" in section.values ;
248- if (! switches)
249- return UsesGnuLinker.unknown;
250- string s = * switches;
251- ptrdiff_t linkerStart = s.countUntil(" -link" );
252- if (linkerStart == - 1 )
253- return UsesGnuLinker.unknown;
254- s = s[linkerStart.. $];
255-
256- if (countUntil(s, " -link-internally" ) != - 1 || countUntil(s, " -linker=lld" ))
257- return UsesGnuLinker.no;
258-
259- return countUntil (s, " -linker=ld" ) != - 1 ? UsesGnuLinker.yes : UsesGnuLinker.unknown;
260- }
242+ // private UsesGnuLinker isUsingGnuLinker(string ldcPath, string arch)
243+ // {
244+ // import redub.misc.ldc_conf_parser;
245+ // import std.file;
246+ // import std.algorithm.searching;
247+ // ConfigSection section = getLdcConfig(std.file.getcwd(), ldcPath, arch);
248+ // if(section == ConfigSection.init)
249+ // return UsesGnuLinker.unknown;
250+ // string* switches = "switches" in section.values;
251+ // if(!switches)
252+ // return UsesGnuLinker.unknown;
253+ // string s = *switches;
254+ // ptrdiff_t linkerStart = s.countUntil("-link");
255+ // if(linkerStart == -1)
256+ // return UsesGnuLinker.unknown;
257+ // s = s[linkerStart..$];
258+
259+ // if(countUntil(s, "-link-internally") != -1 || countUntil(s, "-linker=lld"))
260+ // return UsesGnuLinker.no;
261+
262+ // return countUntil(s, "-linker=ld") != -1 ? UsesGnuLinker.yes : UsesGnuLinker.unknown;
263+ // }
261264
262265
263266private Compiler getCompilerFromGlobalPath (string compilerOrPath, JSONValue compilersInfo)
0 commit comments