32 lines
725 B
Makefile
Raw Normal View History

2018-09-13 20:25:58 +02:00
-include ../tools.mk
2018-09-26 16:22:52 +02:00
# This feature only works when the output object format is ELF so we ignore
# macOS and Windows
2018-09-13 20:25:58 +02:00
ifdef IS_WINDOWS
2018-09-26 16:22:52 +02:00
# Do nothing on Windows.
all:
exit 0
else ifneq (,$(filter $(TARGET),i686-apple-darwin x86_64-apple-darwin))
# Do nothing on macOS.
2018-09-13 20:25:58 +02:00
all:
exit 0
else
# check that the .stack_sizes section is generated
# this test requires LLVM >= 6.0.0
2018-09-16 21:29:57 +02:00
vers = $(shell $(RUSTC) -Vv)
ifneq (,$(findstring LLVM version: 3,$(vers)))
all:
exit 0
2018-09-16 21:29:57 +02:00
else ifneq (,$(findstring LLVM version: 4,$(vers)))
all:
exit 0
2018-09-16 21:29:57 +02:00
else ifneq (,$(findstring LLVM version: 5,$(vers)))
all:
exit 0
else
2018-09-13 20:25:58 +02:00
all:
$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
endif
endif