auto merge of #13340 : FlaPer87/rust/code-model, r=cmr
Rust currently defaults to `RelocPIC` regardless. This patch adds a new
codegen option that allows choosing different relocation-model. The
available models are:
- default (Use the target-specific default model)
- static
- pic
- no-pic
For a more detailed information use `llc --help`
This commit is contained in:
commit
02c81fe2b5
5 changed files with 43 additions and 1 deletions
15
src/test/run-make/relocation-model/Makefile
Normal file
15
src/test/run-make/relocation-model/Makefile
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -C relocation-model=dynamic-no-pic foo.rs
|
||||
$(call RUN,foo)
|
||||
|
||||
$(RUSTC) -C relocation-model=default foo.rs
|
||||
$(call RUN,foo)
|
||||
|
||||
$(RUSTC) -C relocation-model=static foo.rs
|
||||
$(call RUN,foo)
|
||||
|
||||
$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs
|
||||
$(RUSTC) -C relocation-model=static --crate-type=dylib foo.rs
|
||||
$(RUSTC) -C relocation-model=dynamic-no-pic --crate-type=dylib foo.rs
|
||||
11
src/test/run-make/relocation-model/foo.rs
Normal file
11
src/test/run-make/relocation-model/foo.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue