mk: Get "make check" passing with --disable-rpath
This involves passing through LD_LIBRARY_PATH through more places, specifically in the compiletest, run-make, and doctest runners.
This commit is contained in:
parent
78d4bf851c
commit
e26ba3605a
8 changed files with 35 additions and 14 deletions
|
@ -341,10 +341,10 @@ endif
|
||||||
ifdef CFG_DISABLE_RPATH
|
ifdef CFG_DISABLE_RPATH
|
||||||
ifeq ($$(OSTYPE_$(3)),apple-darwin)
|
ifeq ($$(OSTYPE_$(3)),apple-darwin)
|
||||||
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
|
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
|
||||||
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(HLIB$(1)_H_$(3))"
|
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
|
||||||
else
|
else
|
||||||
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
|
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
|
||||||
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(HLIB$(1)_H_$(3))"
|
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
RPATH_VAR$(1)_T_$(2)_H_$(3) :=
|
RPATH_VAR$(1)_T_$(2)_H_$(3) :=
|
||||||
|
|
|
@ -706,8 +706,9 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3)
|
||||||
ifeq ($(2),$$(CFG_BUILD))
|
ifeq ($(2),$$(CFG_BUILD))
|
||||||
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
|
||||||
@$$(call E, run doc-$(4) [$(2)])
|
@$$(call E, run doc-$(4) [$(2)])
|
||||||
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
|
$$(Q)$$(RPATH_VAR$(1)_T_$(2)_H_$(3)) \
|
||||||
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
|
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
|
||||||
|
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
|
||||||
else
|
else
|
||||||
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
|
||||||
touch $$@
|
touch $$@
|
||||||
|
@ -934,7 +935,8 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
|
||||||
$(3)/test/run-make/$$* \
|
$(3)/test/run-make/$$* \
|
||||||
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
|
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
|
||||||
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
|
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
|
||||||
"$$(TESTNAME)"
|
"$$(TESTNAME)" \
|
||||||
|
"$$(RPATH_VAR$(1)_T_$(2)_H_$(3))"
|
||||||
@touch $$@
|
@touch $$@
|
||||||
else
|
else
|
||||||
# FIXME #11094 - The above rule doesn't work right for multiple targets
|
# FIXME #11094 - The above rule doesn't work right for multiple targets
|
||||||
|
|
|
@ -36,8 +36,26 @@ fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
fn target_env(_lib_path: &str, _prog: &str) -> ~[(~str,~str)] {
|
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
|
||||||
os::env()
|
// Make sure we include the aux directory in the path
|
||||||
|
let aux_path = prog + ".libaux";
|
||||||
|
|
||||||
|
let mut env = os::env();
|
||||||
|
let var = if cfg!(target_os = "macos") {
|
||||||
|
"DYLD_LIBRARY_PATH"
|
||||||
|
} else {
|
||||||
|
"LD_LIBRARY_PATH"
|
||||||
|
};
|
||||||
|
let prev = match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
|
||||||
|
Some(i) => env.remove(i).unwrap().val1(),
|
||||||
|
None => ~"",
|
||||||
|
};
|
||||||
|
env.push((var.to_owned(), if prev.is_empty() {
|
||||||
|
lib_path + ":" + aux_path
|
||||||
|
} else {
|
||||||
|
lib_path + ":" + aux_path + ":" + prev
|
||||||
|
}));
|
||||||
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Result {status: ProcessExit, out: ~str, err: ~str}
|
pub struct Result {status: ProcessExit, out: ~str, err: ~str}
|
||||||
|
|
|
@ -17,6 +17,9 @@ os.putenv('TMPDIR', os.path.abspath(sys.argv[3]))
|
||||||
os.putenv('CC', sys.argv[4])
|
os.putenv('CC', sys.argv[4])
|
||||||
os.putenv('RUSTDOC', os.path.abspath(sys.argv[5]))
|
os.putenv('RUSTDOC', os.path.abspath(sys.argv[5]))
|
||||||
filt = sys.argv[6]
|
filt = sys.argv[6]
|
||||||
|
ldpath = sys.argv[7]
|
||||||
|
if ldpath != '':
|
||||||
|
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])
|
||||||
|
|
||||||
if not filt in sys.argv[1]:
|
if not filt in sys.argv[1]:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
all:
|
all:
|
||||||
$(RUSTC) lib.rs -C gen-crate-map
|
$(RUSTC) lib.rs -C gen-crate-map
|
||||||
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
||||||
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
|
$(CC) main.c -o $(call RUN,main) -lboot
|
||||||
$(call RUN,main)
|
$(call RUN,main)
|
||||||
rm $(call DYLIB,boot)
|
rm $(call DYLIB,boot)
|
||||||
$(call FAIL,main)
|
$(call FAIL,main)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
all:
|
all:
|
||||||
$(RUSTC) lib.rs -C gen-crate-map
|
$(RUSTC) lib.rs -C gen-crate-map
|
||||||
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
|
||||||
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
|
$(CC) main.c -o $(call RUN,main) -lboot
|
||||||
$(call RUN,main)
|
$(call RUN,main)
|
||||||
rm $(call DYLIB,boot)
|
rm $(call DYLIB,boot)
|
||||||
$(call FAIL,main)
|
$(call FAIL,main)
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
-include ../tools.mk
|
-include ../tools.mk
|
||||||
|
|
||||||
# needed so that libfoo can find libcfoo
|
|
||||||
ifeq ($(shell uname),Linux)
|
|
||||||
export LD_LIBRARY_PATH := $(TMPDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# This hits an assertion in the linker on older versions of osx apparently
|
# This hits an assertion in the linker on older versions of osx apparently
|
||||||
ifeq ($(shell uname),Darwin)
|
ifeq ($(shell uname),Darwin)
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
export LD_LIBRARY_PATH:=$(TMPDIR):$(LD_LIBRARY_PATH)
|
||||||
|
export DYLD_LIBRARY_PATH:=$(TMPDIR):$(DYLD_LIBRARY_PATH)
|
||||||
|
|
||||||
RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||||
CC := $(CC) -L $(TMPDIR)
|
CC := $(CC) -L $(TMPDIR)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue