Skip to content

Commit dd4d6a9

Browse files
committed
Verify that sanitizer runtime is not part of staticlib
1 parent c2c290e commit dd4d6a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
all:
1212
$(RUSTC) -g -Z sanitizer=address --crate-type staticlib --target $(TARGET) library.rs
13+
# Verify that linking without sanitizer fails, i.e., runtime is not part of staticlib:
14+
$(RUSTC) -g --crate-type bin --target $(TARGET) -L . program.rs && exit 1 || true
15+
# Verify that linking with sanitizer succeeds and detects overflow in library:
1316
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -L . program.rs
1417
$(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
1518

0 commit comments

Comments
 (0)