mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 04:23:37 +00:00
rollup merge of #19161: jmesmon/mk-fixes
This is a collection of misc issues I've run into while adding bindir & libdir support that aren't really bindir & libdir specific. While I continue to fiddle with bindir and libdir bugs, I figured these might be useful for others to have merged.
This commit is contained in:
commit
f90471e4e3
5
configure
vendored
5
configure
vendored
|
@ -711,11 +711,6 @@ then
|
||||||
fi
|
fi
|
||||||
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
|
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
|
||||||
putvar CFG_LOCAL_RUST_ROOT
|
putvar CFG_LOCAL_RUST_ROOT
|
||||||
else
|
|
||||||
if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
|
|
||||||
then
|
|
||||||
warn "Use of --local-rust-root without --enable-local-rust"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Force freebsd to build with clang; gcc doesn't like us there
|
# Force freebsd to build with clang; gcc doesn't like us there
|
||||||
|
|
|
@ -190,11 +190,14 @@ endif
|
||||||
# Target-and-rule "utility variables"
|
# Target-and-rule "utility variables"
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
define DEF_X
|
define DEF_FOR_TARGET
|
||||||
X_$(1) := $(CFG_EXE_SUFFIX_$(1))
|
X_$(1) := $(CFG_EXE_SUFFIX_$(1))
|
||||||
|
ifndef CFG_LLVM_TARGET_$(1)
|
||||||
|
CFG_LLVM_TARGET_$(1) := $(1)
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
$(foreach target,$(CFG_TARGET), \
|
$(foreach target,$(CFG_TARGET), \
|
||||||
$(eval $(call DEF_X,$(target))))
|
$(eval $(call DEF_FOR_TARGET,$(target))))
|
||||||
|
|
||||||
# "Source" files we generate in builddir along the way.
|
# "Source" files we generate in builddir along the way.
|
||||||
GENERATED :=
|
GENERATED :=
|
||||||
|
|
2
mk/rt.mk
2
mk/rt.mk
|
@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
|
||||||
@mkdir -p $$(@D)
|
@mkdir -p $$(@D)
|
||||||
@$$(call E, compile: $$@)
|
@$$(call E, compile: $$@)
|
||||||
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
|
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
|
||||||
-filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
|
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
|
||||||
|
|
||||||
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
|
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
|
||||||
@mkdir -p $$(@D)
|
@mkdir -p $$(@D)
|
||||||
|
|
|
@ -22,7 +22,7 @@ ifdef CFG_ENABLE_LOCAL_RUST
|
||||||
else
|
else
|
||||||
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
|
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
|
||||||
endif
|
endif
|
||||||
$(Q)touch $@
|
$(Q)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
|
||||||
|
|
||||||
# For other targets, let the host build the target:
|
# For other targets, let the host build the target:
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
|
||||||
$$(foreach dep,$$(TOOL_DEPS_$(4)), \
|
$$(foreach dep,$$(TOOL_DEPS_$(4)), \
|
||||||
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
|
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
|
||||||
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
|
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
|
||||||
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
| $$(TBIN$(1)_T_$(2)_H_$(3))/
|
||||||
@$$(call E, rustc: $$@)
|
@$$(call E, rustc: $$@)
|
||||||
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
use syntax::{ast, ast_map, codemap, diagnostic};
|
use syntax::{ast, ast_map, codemap, diagnostic};
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::os;
|
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use arena::TypedArena;
|
use arena::TypedArena;
|
||||||
|
|
||||||
|
@ -89,7 +88,7 @@ pub fn run_core(libs: Vec<Path>, cfgs: Vec<String>, externs: Externs,
|
||||||
let warning_lint = lint::builtin::WARNINGS.name_lower();
|
let warning_lint = lint::builtin::WARNINGS.name_lower();
|
||||||
|
|
||||||
let sessopts = config::Options {
|
let sessopts = config::Options {
|
||||||
maybe_sysroot: Some(os::self_exe_path().unwrap().dir_path()),
|
maybe_sysroot: None,
|
||||||
addl_lib_search_paths: RefCell::new(libs),
|
addl_lib_search_paths: RefCell::new(libs),
|
||||||
crate_types: vec!(config::CrateTypeRlib),
|
crate_types: vec!(config::CrateTypeRlib),
|
||||||
lint_opts: vec!((warning_lint, lint::Allow)),
|
lint_opts: vec!((warning_lint, lint::Allow)),
|
||||||
|
|
Loading…
Reference in a new issue