aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-05-17 12:13:30 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-09-24 18:48:48 -0700
commit6514abf681425e6a13f4c547401493cd0b7d1f00 (patch)
tree8626f177fcdd2b5d2d0b52454c9f5cb527e97432
parentd32fc0563d629eac112f0b7b5b0f21d434f0a74b (diff)
downloadmeson-6514abf681425e6a13f4c547401493cd0b7d1f00.zip
meson-6514abf681425e6a13f4c547401493cd0b7d1f00.tar.gz
meson-6514abf681425e6a13f4c547401493cd0b7d1f00.tar.bz2
rustc: implement pic args
-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 []