]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | # needs-sanitizer-support |
f035d41b | 2 | # needs-sanitizer-address |
48663c56 XL |
3 | # only-linux |
4 | ||
041b39d2 XL |
5 | -include ../tools.mk |
6 | ||
ea8adc8c XL |
7 | LOG := $(TMPDIR)/log.txt |
8 | ||
041b39d2 | 9 | # This test builds a shared object, then an executable that links it as a native |
b7449926 | 10 | # rust library (contrast to an rlib). The shared library and executable both |
041b39d2 XL |
11 | # are compiled with address sanitizer, and we assert that a fault in the cdylib |
12 | # is correctly detected. | |
13 | ||
041b39d2 | 14 | all: |
f9f354fc XL |
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 | |
ff7c6d11 | 17 | LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow |