diff options
-rw-r--r-- | .github/workflows/os_comp.yml | 2 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 6 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/d.py | 18 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 2 | ||||
-rw-r--r-- | mesonbuild/environment.py | 2 | ||||
-rw-r--r-- | test cases/common/203 function attributes/meson.build | 2 |
7 files changed, 26 insertions, 8 deletions
diff --git a/.github/workflows/os_comp.yml b/.github/workflows/os_comp.yml index 19281c9..cfc75c8 100644 --- a/.github/workflows/os_comp.yml +++ b/.github/workflows/os_comp.yml @@ -19,7 +19,7 @@ jobs: - name: Ninja version run: ninja --version - name: Run tests - run: LD_LIBRARY_PATH=/usr/local/share/boost/1.69.0/lib/:$LD_LIBRARY_PATH python3 run_tests.py + run: LD_LIBRARY_PATH=/usr/local/share/boost/1.69.0/lib/:$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH python3 run_tests.py env: CI: '1' XENIAL: '1' diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index c80d832..13b7bc6 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2013,7 +2013,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) # own target build dir. if not isinstance(i, (build.CustomTarget, build.CustomTargetIndex)): continue - idir = self.get_target_dir(i) + idir = os.path.normpath(self.get_target_dir(i)) if not idir: idir = '.' if idir not in custom_target_include_dirs: @@ -2027,10 +2027,10 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) def generate_inc_dir(self, compiler, d, basedir, is_system): # Avoid superfluous '/.' at the end of paths when d is '.' if d not in ('', '.'): - expdir = os.path.join(basedir, d) + expdir = os.path.normpath(os.path.join(basedir, d)) else: expdir = basedir - srctreedir = os.path.join(self.build_to_src, expdir) + srctreedir = os.path.normpath(os.path.join(self.build_to_src, expdir)) sargs = compiler.get_include_args(srctreedir, is_system) # There may be include dirs where a build directory has not been # created for some source dir. For example if someone does this: diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index e13256e..a0d752c 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -842,7 +842,7 @@ class Compiler: """ return self.linker.get_accepts_rsp() - def get_linker_always_args(self): + def get_linker_always_args(self) -> T.List[str]: return self.linker.get_always_args() def get_linker_lib_prefix(self): diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index eb3a0f3..a86f254 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -678,6 +678,12 @@ class GnuDCompiler(GnuCompiler, DCompiler): def get_allow_undefined_link_args(self) -> T.List[str]: return self.linker.get_allow_undefined_args() + def get_linker_always_args(self) -> T.List[str]: + args = super().get_linker_always_args() + if self.info.is_windows(): + return args + return args + ['-shared-libphobos'] + class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler): @@ -721,6 +727,12 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler): def use_linker_args(cls, linker: str) -> T.List[str]: return ['-linker={}'.format(linker)] + def get_linker_always_args(self) -> T.List[str]: + args = super().get_linker_always_args() + if self.info.is_windows(): + return args + return args + ['-link-defaultlib-shared'] + class DmdDCompiler(DmdLikeCompilerMixin, DCompiler): @@ -785,3 +797,9 @@ class DmdDCompiler(DmdLikeCompilerMixin, DCompiler): def can_linker_accept_rsp(self) -> bool: return False + + def get_linker_always_args(self) -> T.List[str]: + args = super().get_linker_always_args() + if self.info.is_windows(): + return args + return args + ['-defaultlib=phobos2', '-debuglib=phobos2'] diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 3aca5fe..e043bcd 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -56,7 +56,7 @@ class CLikeCompiler: self.can_compile_suffixes.add('h') # If the exe wrapper was not found, pretend it wasn't set so that the # sanity check is skipped and compiler checks use fallbacks. - if not exe_wrapper or not exe_wrapper.found(): + if not exe_wrapper or not exe_wrapper.found() or not exe_wrapper.get_command(): self.exe_wrapper = None else: self.exe_wrapper = exe_wrapper.get_command() diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index f25c671..31510ff 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -780,7 +780,7 @@ class Environment: if '(compatible with GNU linkers)' in o: return LLVMDynamicLinker( compiler, for_machine, comp_class.LINKER_PREFIX, - override, version=search_version(o), direct=invoked_directly) + override, version=search_version(o)) if value is not None and invoked_directly: compiler = value diff --git a/test cases/common/203 function attributes/meson.build b/test cases/common/203 function attributes/meson.build index 69228e6..9ec948f 100644 --- a/test cases/common/203 function attributes/meson.build +++ b/test cases/common/203 function attributes/meson.build @@ -31,7 +31,6 @@ expected_result = not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) # figure that out except by running the code we're trying to test. attributes = [ 'aligned', - 'alloc_size', 'always_inline', 'cold', 'const', @@ -65,6 +64,7 @@ endif if host_machine.system() != 'darwin' attributes += 'alias' attributes += 'visibility' + attributes += 'alloc_size' endif if ['gcc', 'intel'].contains(c.get_id()) |