xref: /linux/tools/testing/selftests/arm64/gcs/Makefile (revision feafee284579d29537a5a56ba8f23894f0463f3d)
13d37d430SMark Brown# SPDX-License-Identifier: GPL-2.0
23d37d430SMark Brown# Copyright (C) 2023 ARM Limited
33d37d430SMark Brown#
43d37d430SMark Brown# In order to avoid interaction with the toolchain and dynamic linker the
53d37d430SMark Brown# portions of these tests that interact with the GCS are implemented using
63d37d430SMark Brown# nolibc.
73d37d430SMark Brown#
83d37d430SMark Brown
948f8d9ceSMark BrownTEST_GEN_PROGS := basic-gcs libc-gcs gcs-locking gcs-stress gcspushm gcsstr
1005e6cfffSMark BrownTEST_GEN_PROGS_EXTENDED := gcs-stress-thread
11a505a52bSMark Brown
12a505a52bSMark BrownLDLIBS+=-lpthread
133d37d430SMark Brown
143d37d430SMark Browninclude ../../lib.mk
153d37d430SMark Brown
163d37d430SMark Brown$(OUTPUT)/basic-gcs: basic-gcs.c
17*5b7bdc44SThomas Weißschuh	$(CC) $(CFLAGS) -fno-asynchronous-unwind-tables -fno-ident -s -nostdlib -nostdinc \
18*5b7bdc44SThomas Weißschuh		-static -I../../../../include/nolibc -include ../../../../include/nolibc/nolibc.h \
193d37d430SMark Brown		-I../../../../../usr/include \
203d37d430SMark Brown		-std=gnu99 -I../.. -g \
21*5b7bdc44SThomas Weißschuh		-ffreestanding $^ -o $@ -lgcc
2205e6cfffSMark Brown
2305e6cfffSMark Brown$(OUTPUT)/gcs-stress-thread: gcs-stress-thread.S
2405e6cfffSMark Brown	$(CC) -nostdlib $^ -o $@
2548f8d9ceSMark Brown
2648f8d9ceSMark Brown$(OUTPUT)/gcspushm: gcspushm.S
2748f8d9ceSMark Brown	$(CC) -nostdlib $^ -o $@
2848f8d9ceSMark Brown
2948f8d9ceSMark Brown$(OUTPUT)/gcsstr: gcsstr.S
3048f8d9ceSMark Brown	$(CC) -nostdlib $^ -o $@
31