xref: /freebsd/contrib/arm-optimized-routines/config.mk.dist (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1# Example config.mk
2#
3# Copyright (c) 2018-2022, Arm Limited.
4# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
5
6# Subprojects to build
7SUBS = math string networking
8
9# Subsubprojects to build if subproject pl is built
10PLSUBS = math
11
12# Target architecture: aarch64, arm or x86_64
13ARCH = aarch64
14
15# Use for cross compilation with gcc.
16#CROSS_COMPILE = aarch64-none-linux-gnu-
17
18# Compiler for the target
19CC = $(CROSS_COMPILE)gcc
20CFLAGS = -std=c99 -pipe -O3
21CFLAGS += -Wall -Wno-missing-braces
22CFLAGS += -Werror=implicit-function-declaration
23
24# Used for test case generator that is executed on the host
25HOST_CC = gcc
26HOST_CFLAGS = -std=c99 -O2
27HOST_CFLAGS += -Wall -Wno-unused-function
28
29# Enable debug info.
30HOST_CFLAGS += -g
31CFLAGS += -g
32
33# Optimize the shared libraries on aarch64 assuming they fit in 1M.
34#CFLAGS_SHARED = -fPIC -mcmodel=tiny
35
36# Enable MTE support.
37#CFLAGS += -march=armv8.5-a+memtag -DWANT_MTE_TEST=1
38
39# Use with cross testing.
40#EMULATOR = qemu-aarch64-static
41#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
42
43# Additional flags for subprojects.
44math-cflags =
45math-ldlibs =
46math-ulpflags =
47math-testflags =
48string-cflags =
49networking-cflags =
50
51# Use if mpfr is available on the target for ulp error checking.
52#math-ldlibs += -lmpfr -lgmp
53#math-cflags += -DUSE_MPFR
54
55# Use with gcc.
56math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
57math-cflags += -ffp-contract=fast -fno-math-errno
58
59# Use with clang.
60#math-cflags += -ffp-contract=fast
61
62# Disable vector math code
63#math-cflags += -DWANT_VMATH=0
64
65# Disable/enable SVE vector math code and tests
66WANT_SVE_MATH = 0
67ifeq ($(WANT_SVE_MATH), 1)
68  math-cflags += -march=armv8.2-a+sve
69endif
70math-cflags += -DWANT_SVE_MATH=$(WANT_SVE_MATH)
71
72# If defined to 1, set errno in math functions according to ISO C.  Many math
73# libraries do not set errno, so this is 0 by default.  It may need to be
74# set to 1 if math.h has (math_errhandling & MATH_ERRNO) != 0.
75WANT_ERRNO = 0
76math-cflags += -DWANT_ERRNO=$(WANT_ERRNO)
77
78# If set to 1, set fenv in vector math routines.
79WANT_SIMD_EXCEPT = 0
80math-cflags += -DWANT_SIMD_EXCEPT=$(WANT_SIMD_EXCEPT)
81
82# Disable fenv checks
83#math-ulpflags = -q -f
84#math-testflags = -nostatus
85
86# Remove GNU Property Notes from asm files.
87#string-cflags += -DWANT_GNU_PROPERTY=0
88
89# Enable assertion checks.
90#networking-cflags += -DWANT_ASSERT
91
92# Avoid auto-vectorization of scalar code and unroll loops
93networking-cflags += -O2 -fno-tree-vectorize -funroll-loops
94