2019-04-18 08:49:41 -05:00
|
|
|
# needs-sanitizer-support
|
2020-06-04 19:00:00 -05:00
|
|
|
# needs-sanitizer-address
|
2019-04-18 08:49:41 -05:00
|
|
|
|
2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2017-06-16 22:42:56 -05:00
|
|
|
|
2017-09-07 15:36:23 -05:00
|
|
|
LOG := $(TMPDIR)/log.txt
|
|
|
|
|
2017-06-16 22:42:56 -05:00
|
|
|
# This test builds a shared object, then an executable that links it as a native
|
2018-08-19 08:30:23 -05:00
|
|
|
# rust library (contrast to an rlib). The shared library and executable both
|
2017-06-16 22:42:56 -05:00
|
|
|
# are compiled with address sanitizer, and we assert that a fault in the dylib
|
|
|
|
# is correctly detected.
|
|
|
|
|
|
|
|
all:
|
2020-04-23 16:56:19 -05:00
|
|
|
$(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) library.rs
|
2023-12-19 12:29:47 -06:00
|
|
|
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) program.rs
|
2017-11-23 09:19:50 -06:00
|
|
|
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
|