3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 SUBS = math string networking
10 # Target architecture: aarch64, arm or x86_64
13 # Compiler for the target
14 CC = $(CROSS_COMPILE)gcc
15 CFLAGS = -std=c99 -pipe -O3
16 CFLAGS += -Wall -Wno-missing-braces
17 CFLAGS += -Werror=implicit-function-declaration
19 # Used for test case generator that is executed on the host
21 HOST_CFLAGS = -std=c99 -O2
22 HOST_CFLAGS += -Wall -Wno-unused-function
28 # Optimize the shared libraries on aarch64 assuming they fit in 1M.
29 #CFLAGS_SHARED = -fPIC -mcmodel=tiny
31 # Use for cross compilation with gcc.
32 #CROSS_COMPILE = aarch64-none-linux-gnu-
34 # Use with cross testing.
35 #EMULATOR = qemu-aarch64-static
36 #EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
38 # Additional flags for subprojects.
46 # Use if mpfr is available on the target for ulp error checking.
47 #math-ldlibs += -lmpfr -lgmp
48 #math-cflags += -DUSE_MPFR
51 math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
52 math-cflags += -ffp-contract=fast -fno-math-errno
55 #math-cflags += -ffp-contract=fast
57 # Disable vector math code
58 #math-cflags += -DWANT_VMATH=0
61 #math-ulpflags = -q -f
62 #math-testflags = -nostatus
64 # Enable assertion checks.
65 #networking-cflags += -DWANT_ASSERT
67 # Avoid auto-vectorization of scalar code and unroll loops
68 networking-cflags += -O2 -fno-tree-vectorize -funroll-loops