From e1cca7ad853ce70afe815c00d97fd4ab897d61a7 Mon Sep 17 00:00:00 2001 From: Johan Engelen Date: Fri, 17 May 2024 16:28:12 +0200 Subject: [PATCH] Set wekamods default to `false`. --- driver/cl_options.cpp | 4 ++-- gen/tollvm.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index 1cd31ff5b12..a002e90b927 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -649,8 +649,8 @@ static cl::opt coverageAnalysis( static cl::opt> wekaMods( "wekamods", cl::desc( - "(*) Enable specific Weka mods like the template instantiation mods"), - cl::location(global.params.enableWekaMods), cl::init(true)); + "(*) Enable specific Weka mods: emit all functions in COMDAT for ELF"), + cl::location(global.params.enableWekaMods), cl::init(false)); static cl::opt templateCodegenDepth("template-codegen-depth", cl::desc("Don't codegen templates beyond this recusion depth (0 = off)."), diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 981bf8680f9..dbb7cd9ccdd 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -273,7 +273,13 @@ bool needsCOMDAT() { * using /Gy with the MS compiler. * https://docs.microsoft.com/en-us/cpp/build/reference/opt-optimizations?view=vs-2019 */ +#if IN_WEKA + return global.params.targetTriple->isOSBinFormatCOFF() || + (global.params.enableWekaMods && + global.params.targetTriple->isOSBinFormatELF()); +#else return global.params.targetTriple->isOSBinFormatCOFF(); +#endif } void setLinkage(LinkageWithCOMDAT lwc, llvm::GlobalObject *obj) {