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