]> git.proxmox.com Git - rustc.git/blobdiff - src/test/run-make/sanitizer-address/Makefile
New upstream version 1.19.0+dfsg1
[rustc.git] / src / test / run-make / sanitizer-address / Makefile
index 5931145f3a47d014033ff1a1744043d4edc0d729..61b25df1451b336895e189500c5a0fbb5335ae4a 100644 (file)
@@ -1,11 +1,19 @@
 -include ../tools.mk
 
-# NOTE the address sanitizer only supports x86_64 linux
-ifdef SANITIZER_SUPPORT
-all:
-       $(RUSTC) -g -Z sanitizer=address -Z print-link-args overflow.rs | grep -q librustc_asan
-       $(TMPDIR)/overflow 2>&1 | grep -q stack-buffer-overflow
+# NOTE the address sanitizer only supports x86_64 linux and macOS
+
+ifeq ($(TARGET),x86_64-apple-darwin)
+ASAN_SUPPORT=$(SANITIZER_SUPPORT)
+EXTRA_RUSTFLAG=-C rpath
 else
-all:
+ifeq ($(TARGET),x86_64-unknown-linux-gnu)
+ASAN_SUPPORT=$(SANITIZER_SUPPORT)
+EXTRA_RUSTFLAG=
+endif
+endif
 
+all:
+ifeq ($(ASAN_SUPPORT),1)
+       $(RUSTC) -g -Z sanitizer=address -Z print-link-args $(EXTRA_RUSTFLAG) overflow.rs | grep -q librustc_asan
+       $(TMPDIR)/overflow 2>&1 | grep -q stack-buffer-overflow
 endif