default -Wl,--allow-multiple-definition to on
This commit is contained in:
@@ -61,7 +61,7 @@ class Ffmpeg(AutotoolsPackage):
|
||||
# description='XML parsing, needed for dash demuxing support')
|
||||
variant('libzmq', default=False, description='message passing via libzmq')
|
||||
variant('lzma', default=False, description='lzma support')
|
||||
variant('avresample', default=False, description='AV reasmpling component')
|
||||
variant('avresample', default=False, description='AV resampling component (deprecated)')
|
||||
variant('openssl', default=False, description='needed for https support')
|
||||
variant('sdl2', default=False, description='sdl2 support')
|
||||
variant('shared', default=True, description='build shared libraries')
|
||||
@@ -132,15 +132,6 @@ def enable_or_disable_meta(self, variant, options):
|
||||
switch = 'enable' if '+{0}'.format(variant) in self.spec else 'disable'
|
||||
return ['--{0}-{1}'.format(switch, option) for option in options]
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
if self.spec.satisfies('%emscripten'):
|
||||
if name == 'ldflags':
|
||||
# This is a patch to LLVM which only works if
|
||||
# "llvm+multiple-definitions" is enabled.
|
||||
flags.append('{}--allow-multiple-definition'
|
||||
.format(self.compiler.linker_arg))
|
||||
return (flags, None, None)
|
||||
|
||||
patch('disable-asm.patch', when='%emscripten')
|
||||
|
||||
def configure_args(self):
|
||||
|
@@ -11,29 +11,16 @@ index 8eaa4acc6..abaf1c9a2 100644
|
||||
bool demangle;
|
||||
bool disableVerify;
|
||||
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
|
||||
index 1dc6b9dd6..79685b24a 100644
|
||||
index 1dc6b9dd6..68826b567 100644
|
||||
--- a/lld/wasm/Driver.cpp
|
||||
+++ b/lld/wasm/Driver.cpp
|
||||
@@ -345,11 +345,22 @@ static UnresolvedPolicy getUnresolvedSymbolPolicy(opt::InputArgList &args) {
|
||||
return errorOrWarn;
|
||||
}
|
||||
|
||||
+static bool hasZOption(opt::InputArgList &args, StringRef key) {
|
||||
+ for (auto *arg : args.filtered(OPT_z))
|
||||
+ if (key == arg->getValue())
|
||||
+ return true;
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
// Initializes Config members by the command line options.
|
||||
static void readConfigs(opt::InputArgList &args) {
|
||||
@@ -350,6 +350,9 @@ static void readConfigs(opt::InputArgList &args) {
|
||||
config->bsymbolic = args.hasArg(OPT_Bsymbolic);
|
||||
config->checkFeatures =
|
||||
args.hasFlag(OPT_check_features, OPT_no_check_features, true);
|
||||
+ config->allowMultipleDefinition =
|
||||
+ args.hasFlag(OPT_allow_multiple_definition,
|
||||
+ OPT_no_allow_multiple_definition, false) ||
|
||||
+ hasZOption(args, "muldefs");
|
||||
+ OPT_no_allow_multiple_definition, true);
|
||||
config->compressRelocations = args.hasArg(OPT_compress_relocations);
|
||||
config->demangle = args.hasFlag(OPT_demangle, OPT_no_demangle, true);
|
||||
config->disableVerify = args.hasArg(OPT_disable_verify);
|
||||
|
@@ -375,7 +375,9 @@ class Llvm(CMakePackage, CudaPackage):
|
||||
# patch for missing hwloc.h include for libompd
|
||||
patch('llvm14-hwloc-ompd.patch', when='@14')
|
||||
|
||||
# Allow wasm-ld to have a --allow-multiple-definition or -z muldefs flag.
|
||||
# Allow wasm-ld to have a --allow-multiple-definition flag, turned on by
|
||||
# default. This mirrors the behavior of gcc when producing and consuming
|
||||
# shared libraries.
|
||||
patch('multiple-definitions-wasm.patch', when='+multiple-definitions')
|
||||
|
||||
# The functions and attributes below implement external package
|
||||
|
Reference in New Issue
Block a user