aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-09-20 16:25:32 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-23 11:23:23 +0300
commitcf58f56e1619bbd012c9cc68e81916148530b57e (patch)
tree1f8ee9da449a16499180660916440d679f39fa96
parent9453ac6182f19ac0083447b1430b8d6afaa65b6c (diff)
downloadmeson-cf58f56e1619bbd012c9cc68e81916148530b57e.zip
meson-cf58f56e1619bbd012c9cc68e81916148530b57e.tar.gz
meson-cf58f56e1619bbd012c9cc68e81916148530b57e.tar.bz2
linker flags --as-needed and --no-undefined aren't meaningful for PE
--as-needed controls ELF-specific functionality (the emission of DT_NEEDED tags) --no-undefined is effectively always on for PE/COFF, as the linkage model always requires symbols to be defined binutils ld silently ignores these flags for PE targets, but lld warns that it's ignoring them, so just don't bother emitting them for PE targets.
-rw-r--r--mesonbuild/compilers/compilers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index a10f9ed..87bf5af 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1314,9 +1314,11 @@ class GnuLikeCompiler(abc.ABC):
def __init__(self, compiler_type):
self.compiler_type = compiler_type
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
- 'b_ndebug', 'b_staticpic', 'b_asneeded']
- if not self.compiler_type.is_osx_compiler:
+ 'b_ndebug', 'b_staticpic']
+ if not self.compiler_type.is_osx_compiler and not self.compiler_type.is_windows_compiler:
self.base_options.append('b_lundef')
+ if not self.compiler_type.is_windows_compiler:
+ self.base_options.append('b_asneeded')
# All GCC-like backends can do assembly
self.can_compile_suffixes.add('s')