From dd4d6a989278004547e504f4c7e755eb39be604d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 17 Oct 2019 00:00:00 +0000 Subject: [PATCH] Verify that sanitizer runtime is not part of staticlib --- src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile index 5e62fcc7a5688..d12969f16bc35 100644 --- a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile +++ b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile @@ -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