diff --git a/docs/markdown/snippets/rustc-improvements.md b/docs/markdown/snippets/rustc-improvements.md index e874b380e..869888c44 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 f11d240d0..2337ceb02 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 []