3 # This test builds a shared object, then an executable that links it as a native
4 # rust library (constrast to an rlib). The shared library and executable both
5 # are compiled with address sanitizer, and we assert that a fault in the cdylib
6 # is correctly detected.
8 ifeq ($(TARGET),x86_64-unknown-linux-gnu)
9 ASAN_SUPPORT=$(SANITIZER_SUPPORT)
14 ifeq ($(ASAN_SUPPORT),1)
15 $(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs
16 $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
17 LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | grep -q stack-buffer-overflow