Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] override use_linker_args #88

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ source:
- patches/0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch
- patches/0002-minimal-adaptations-for-llvm-flang.patch
- patches/0003-mark-gnu-like-lld-as-not-supporting-rsp.patch
- patches/0004-use-msvc-syntax-for-flang.patch
- patches/0004-override-FlangCompiler.use_linker_args.patch

build:
number: 4
number: 5
script: {{ PYTHON }} -m pip install . -vv
noarch: python
entry_points:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From ad1cdd319ed939c6af41607e3ee6647f7d45a119 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Fri, 29 Sep 2023 00:45:58 +1100
Subject: [PATCH 4/4] override FlangCompiler.use_linker_args

---
mesonbuild/compilers/fortran.py | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py
index 9915f6912..d4884f51b 100644
--- a/mesonbuild/compilers/fortran.py
+++ b/mesonbuild/compilers/fortran.py
@@ -471,6 +471,12 @@ class FlangFortranCompiler(ClangCompiler, FortranCompiler):
def get_module_outdir_args(self, path: str) -> T.List[str]:
return ['-module-dir', path]

+ @classmethod
+ def use_linker_args(cls, linker: str, version: str) -> T.List[str]:
+ # ensure we don't fall through to ClangCompiler.use_linker_args
+ # --> GnuLikeCompiler.use_linker_args, which doesn't support lld-link
+ return [f'-fuse-ld={linker}']
+
def language_stdlib_only_link_flags(self, env: 'Environment') -> T.List[str]:
# We need to apply the search prefix here, as these link arguments may
# be passed to a different compiler with a different set of default
24 changes: 0 additions & 24 deletions recipe/patches/0004-use-msvc-syntax-for-flang.patch

This file was deleted.