xref: /linux/tools/testing/selftests/filesystems/openat2/Makefile (revision c0329020da211b41afce4d1c8a1c2494c6d97883)
1# SPDX-License-Identifier: GPL-2.0-or-later
2
3CFLAGS += $(KHDR_INCLUDES)
4CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(TOOLS_INCLUDES)
5TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test emptypath_test
6
7# gcc requires -static-libasan in order to ensure that Address Sanitizer's
8# library is the first one loaded. However, clang already statically links the
9# Address Sanitizer if -fsanitize is specified. Therefore, simply omit
10# -static-libasan for clang builds.
11ifeq ($(LLVM),)
12    CFLAGS += -static-libasan
13endif
14
15LOCAL_HDRS += helpers.h
16
17include ../../lib.mk
18