use std::task::TaskBuilder;
use libc::{c_uint, c_int, c_void};
-
#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq)]
pub enum OutputType {
OutputTypeBitcode,
OutputTypeExe,
}
-
pub fn llvm_err(handler: &diagnostic::Handler, msg: String) -> ! {
unsafe {
let cstr = llvm::LLVMRustGetLastError();
(sess.targ_cfg.os == abi::OsMacos &&
sess.targ_cfg.arch == abi::X86_64);
+ let any_library = sess.crate_types.borrow().iter().any(|ty| {
+ *ty != config::CrateTypeExecutable
+ });
+
// OSX has -dead_strip, which doesn't rely on ffunction_sections
// FIXME(#13846) this should be enabled for windows
let ffunction_sections = sess.targ_cfg.os != abi::OsMacos &&
true /* EnableSegstk */,
use_softfp,
no_fp_elim,
+ !any_library && reloc_model == llvm::RelocPIC,
ffunction_sections,
fdata_sections,
)
CodeGenLevelAggressive = 3,
}
+#[deriving(PartialEq)]
#[repr(C)]
pub enum RelocMode {
RelocDefault = 0,
EnableSegstk: bool,
UseSoftFP: bool,
NoFramePointerElim: bool,
+ PositionIndependentExecutable: bool,
FunctionSections: bool,
DataSections: bool) -> TargetMachineRef;
pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
bool EnableSegmentedStacks,
bool UseSoftFloat,
bool NoFramePointerElim,
+ bool PositionIndependentExecutable,
bool FunctionSections,
bool DataSections) {
std::string Error;
}
TargetOptions Options;
+ Options.PositionIndependentExecutable = PositionIndependentExecutable;
Options.NoFramePointerElim = NoFramePointerElim;
#if LLVM_VERSION_MINOR < 5
Options.EnableSegmentedStacks = EnableSegmentedStacks;