File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
-include ../tools.mk
2
2
3
+ LOG := $(TMPDIR ) /log.txt
4
+
3
5
# NOTE the address sanitizer only supports x86_64 linux and macOS
4
6
5
7
ifeq ($(TARGET ) ,x86_64-apple-darwin)
15
17
all :
16
18
ifeq ($(ASAN_SUPPORT ) ,1)
17
19
$(RUSTC) -g -Z sanitizer=address -Z print-link-args $(EXTRA_RUSTFLAG) overflow.rs | grep -q librustc_asan
18
- $(TMPDIR)/overflow 2>&1 | grep -q stack-buffer-overflow
20
+ $(TMPDIR)/overflow 2>&1 | tee $(LOG)
21
+ grep -q stack-buffer-overflow $(LOG)
19
22
endif
Original file line number Diff line number Diff line change 1
1
-include ../tools.mk
2
2
3
+ LOG := $(TMPDIR ) /log.txt
4
+
3
5
# This test builds a shared object, then an executable that links it as a native
4
6
# rust library (constrast to an rlib). The shared library and executable both
5
7
# are compiled with address sanitizer, and we assert that a fault in the cdylib
14
16
ifeq ($(ASAN_SUPPORT ) ,1)
15
17
$(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs
16
18
$(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
19
+ LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | tee $(LOG)
20
+ grep -q stack-buffer-overflow $(LOG)
18
21
endif
19
-
Original file line number Diff line number Diff line change 1
1
-include ../tools.mk
2
2
3
+ LOG := $(TMPDIR ) /log.txt
4
+
3
5
# This test builds a shared object, then an executable that links it as a native
4
6
# rust library (constrast to an rlib). The shared library and executable both
5
7
# are compiled with address sanitizer, and we assert that a fault in the dylib
14
16
ifeq ($(ASAN_SUPPORT ) ,1)
15
17
$(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) library.rs
16
18
$(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
19
+ LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | tee $(LOG)
20
+ grep -q stack-buffer-overflow $(LOG)
18
21
endif
19
-
You can’t perform that action at this time.
0 commit comments