diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-28 12:01:50 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-28 18:37:42 +0200 |
commit | 4bfc143c5e83160327cd5cf0508849691c3bb678 (patch) | |
tree | fe6c3f98ac8b785b070bfeed28b77c9b2c593a3b /mesonbuild/compilers/compilers.py | |
parent | b2dc277c1e379588eb4795b2b93bbf3c34a1fed6 (diff) | |
download | meson-4bfc143c5e83160327cd5cf0508849691c3bb678.zip meson-4bfc143c5e83160327cd5cf0508849691c3bb678.tar.gz meson-4bfc143c5e83160327cd5cf0508849691c3bb678.tar.bz2 |
Only split linker args with D compilers. Closes: #6845
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index de8fb70..b461f2d 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -568,6 +568,9 @@ class CompilerArgs(collections.abc.MutableSequence): return True return False + def need_to_split_linker_args(self): + return isinstance(self.compiler, Compiler) and self.compiler.get_language() == 'd' + def to_native(self, copy: bool = False) -> T.List[str]: # Check if we need to add --start/end-group for circular dependencies # between static libraries, and for recursively searching for symbols @@ -577,6 +580,10 @@ class CompilerArgs(collections.abc.MutableSequence): new = self.copy() else: new = self + # To proxy these arguments with D you need to split the + # arguments, thus you get `-L=-soname -L=lib.so` we don't + # want to put the lib in a link -roup + split_linker_args = self.need_to_split_linker_args() # This covers all ld.bfd, ld.gold, ld.gold, and xild on Linux, which # all act like (or are) gnu ld # TODO: this could probably be added to the DynamicLinker instead @@ -590,10 +597,7 @@ class CompilerArgs(collections.abc.MutableSequence): if is_soname: is_soname = False continue - elif '-soname' in each: - # To proxy these arguments with D you need to split the - # arguments, thus you get `-L=-soname -L=lib.so` we don't - # want to put the lib in a link -roup + elif split_linker_args and '-soname' in each: is_soname = True continue if not each.startswith(('-Wl,-l', '-l')) and not each.endswith('.a') and \ |