xref: /linux/tools/testing/selftests/fchmodat2/Makefile (revision c771600c6af14749609b49565ffb4cac2959710d)
14859c257SAlexey Gladkov# SPDX-License-Identifier: GPL-2.0-or-later
24859c257SAlexey Gladkov
3*ed3994acSJohn HubbardCFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES)
4*ed3994acSJohn Hubbard
5*ed3994acSJohn Hubbard# gcc requires -static-libasan in order to ensure that Address Sanitizer's
6*ed3994acSJohn Hubbard# library is the first one loaded. However, clang already statically links the
7*ed3994acSJohn Hubbard# Address Sanitizer if -fsanitize is specified. Therefore, simply omit
8*ed3994acSJohn Hubbard# -static-libasan for clang builds.
9*ed3994acSJohn Hubbardifeq ($(LLVM),)
10*ed3994acSJohn Hubbard    CFLAGS += -static-libasan
11*ed3994acSJohn Hubbardendif
12*ed3994acSJohn Hubbard
134859c257SAlexey GladkovTEST_GEN_PROGS := fchmodat2_test
144859c257SAlexey Gladkov
154859c257SAlexey Gladkovinclude ../lib.mk
16