173
|
1 # Example config.mk
|
|
2 #
|
|
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
|
|
6
|
|
7 # Subprojects to build
|
|
8 # For now, LLVM-libc project will focus only "math" functions.
|
|
9 SUBS = math # string networking
|
|
10
|
|
11 # Target architecture: aarch64, arm or x86_64
|
|
12 # For now, LLVM-libc project will focus on x86_64 only.
|
|
13 ARCH = x86_64
|
|
14
|
|
15 # Compiler for the target
|
|
16 CC = $(CROSS_COMPILE)gcc
|
|
17 CFLAGS = -std=c99 -pipe -O3
|
|
18 CFLAGS += -Wall -Wno-missing-braces
|
|
19 CFLAGS += -Werror=implicit-function-declaration
|
|
20
|
|
21 # Used for test case generator that is executed on the host
|
|
22 HOST_CC = gcc
|
|
23 HOST_CFLAGS = -std=c99 -O2
|
|
24 HOST_CFLAGS += -Wall -Wno-unused-function
|
|
25
|
|
26 # Enable debug info.
|
|
27 HOST_CFLAGS += -g
|
|
28 CFLAGS += -g
|
|
29
|
|
30 # Optimize the shared libraries on aarch64 assuming they fit in 1M.
|
|
31 #CFLAGS_SHARED = -fPIC -mcmodel=tiny
|
|
32
|
|
33 # Use for cross compilation with gcc.
|
|
34 #CROSS_COMPILE = aarch64-none-linux-gnu-
|
|
35
|
|
36 # Use with cross testing.
|
|
37 #EMULATOR = qemu-aarch64-static
|
|
38 #EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
|
|
39
|
|
40 # Additional flags for subprojects.
|
|
41 math-cflags =
|
|
42 math-ldlibs =
|
|
43 math-ulpflags =
|
|
44 math-testflags =
|
|
45 string-cflags =
|
|
46 networking-cflags =
|
|
47
|
|
48 # Use if mpfr is available on the target for ulp error checking.
|
|
49 #math-ldlibs += -lmpfr -lgmp
|
|
50 #math-cflags += -DUSE_MPFR
|
|
51
|
|
52 # Use with gcc.
|
|
53 math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
|
|
54 math-cflags += -ffp-contract=fast -fno-math-errno
|
|
55
|
|
56 # Use with clang.
|
|
57 #math-cflags += -ffp-contract=fast
|
|
58
|
|
59 # Disable vector math code
|
|
60 #math-cflags += -DWANT_VMATH=0
|
|
61
|
|
62 # Disable fenv checks
|
|
63 #math-ulpflags = -q -f
|
|
64 #math-testflags = -nostatus
|
|
65
|
|
66 # Enable assertion checks.
|
|
67 #networking-cflags += -DWANT_ASSERT
|
|
68
|
|
69 # Avoid auto-vectorization of scalar code and unroll loops
|
|
70 networking-cflags += -O2 -fno-tree-vectorize -funroll-loops
|