Skip to content

Commit

Permalink
Verify that sanitizer runtime is not part of staticlib
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Oct 17, 2019
1 parent c2c290e commit dd4d6a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

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

0 comments on commit dd4d6a9

Please sign in to comment.