aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/snippets/rustc-improvements.md1
-rw-r--r--mesonbuild/compilers/rust.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/rustc-improvements.md b/docs/markdown/snippets/rustc-improvements.md
index e874b38..869888c 100644
--- a/docs/markdown/snippets/rustc-improvements.md
+++ b/docs/markdown/snippets/rustc-improvements.md
@@ -3,3 +3,4 @@
- Werror now works, this set's `-D warnings`, which will cause rustc to error
for every warning not explicitly disabled
- warning levels have been implemented
+- support for meson's pic has been enabled
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index f11d240..2337ceb 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -187,3 +187,12 @@ class RustCompiler(Compiler):
def get_no_warn_args(self) -> T.List[str]:
return self._WARNING_LEVELS["0"]
+
+ def get_pic_args(self) -> T.List[str]:
+ # This defaults to
+ return ['-C', 'relocation-model=pic']
+
+ def get_pie_args(self) -> T.List[str]:
+ # Rustc currently has no way to toggle this, it's controlled by whether
+ # pic is on by rustc
+ return []