aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-12-06 00:44:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-12-06 16:20:54 +0200
commitc44a5a1aeca638f46b4a2d8d4a9fcb0a554037df (patch)
tree71c4fd88e2fdd98dfd61d8c3f539999ea22a658b /mesonbuild/compilers/compilers.py
parent4db1b3a09f8e1f9faf7747beca2bc77ae0e5a6a5 (diff)
downloadmeson-c44a5a1aeca638f46b4a2d8d4a9fcb0a554037df.zip
meson-c44a5a1aeca638f46b4a2d8d4a9fcb0a554037df.tar.gz
meson-c44a5a1aeca638f46b4a2d8d4a9fcb0a554037df.tar.bz2
Deduplicate export-dynamic and pthread. Closes #4567.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3761433..bdc90da 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -612,7 +612,10 @@ class CompilerArgs(list):
dedup2_suffixes = ()
dedup2_args = ()
# Arg prefixes and args that must be de-duped by returning 1
- dedup1_prefixes = ('-l', '-Wl,-l')
+ #
+ # NOTE: not thorough. A list of potential corner cases can be found in
+ # https://github.com/mesonbuild/meson/pull/4593#pullrequestreview-182016038
+ dedup1_prefixes = ('-l', '-Wl,-l', '-Wl,--export-dynamic')
dedup1_suffixes = ('.lib', '.dll', '.so', '.dylib', '.a')
# Match a .so of the form path/to/libfoo.so.0.1.0
# Only UNIX shared libraries require this. Others have a fixed extension.
@@ -748,6 +751,17 @@ class CompilerArgs(list):
for elem in iterable:
self.append_direct(elem)
+ def extend_preserving_lflags(self, iterable):
+ normal_flags = []
+ lflags = []
+ for i in iterable:
+ if i.startswith('-l') or i.startswith('-L'):
+ lflags.append(i)
+ else:
+ normal_flags.append(i)
+ self.extend(normal_flags)
+ self.extend_direct(lflags)
+
def __add__(self, args):
new = CompilerArgs(self, self.compiler)
new += args