Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 1 | # Example config.mk |
| 2 | # |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 3 | # Copyright (c) 2018-2019, Arm Limited. |
Szabolcs Nagy | 11253b0 | 2018-11-12 11:10:57 +0000 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 5 | |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 6 | # Subprojects to build |
Ola Liljedahl | 6a988f6 | 2020-02-27 15:10:03 +0100 | [diff] [blame] | 7 | SUBS = math string networking |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 8 | |
Szabolcs Nagy | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 9 | # Target architecture: aarch64, arm or x86_64 |
| 10 | ARCH = aarch64 |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 11 | |
Branislav Rankov | 4d55c2d | 2020-05-28 18:11:20 +0100 | [diff] [blame] | 12 | # Use for cross compilation with gcc. |
| 13 | #CROSS_COMPILE = aarch64-none-linux-gnu- |
| 14 | |
Szabolcs Nagy | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 15 | # Compiler for the target |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 16 | CC = $(CROSS_COMPILE)gcc |
| 17 | CFLAGS = -std=c99 -pipe -O3 |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 18 | CFLAGS += -Wall -Wno-missing-braces |
Szabolcs Nagy | 433a3b1 | 2019-10-17 12:31:17 +0100 | [diff] [blame] | 19 | CFLAGS += -Werror=implicit-function-declaration |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 20 | |
Szabolcs Nagy | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 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 | |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 26 | # Enable debug info. |
| 27 | HOST_CFLAGS += -g |
| 28 | CFLAGS += -g |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 29 | |
Szabolcs Nagy | 1e0c802 | 2019-08-06 12:04:27 +0100 | [diff] [blame] | 30 | # Optimize the shared libraries on aarch64 assuming they fit in 1M. |
| 31 | #CFLAGS_SHARED = -fPIC -mcmodel=tiny |
| 32 | |
Branislav Rankov | 4d55c2d | 2020-05-28 18:11:20 +0100 | [diff] [blame] | 33 | # Enable MTE support. |
| 34 | #CFLAGS += -march=armv8.5-a+memtag -DWANT_MTE_TEST=1 |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 35 | |
| 36 | # Use with cross testing. |
| 37 | #EMULATOR = qemu-aarch64-static |
| 38 | #EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' -- |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 39 | |
| 40 | # Additional flags for subprojects. |
| 41 | math-cflags = |
| 42 | math-ldlibs = |
| 43 | math-ulpflags = |
| 44 | math-testflags = |
| 45 | string-cflags = |
Ola Liljedahl | 6a988f6 | 2020-02-27 15:10:03 +0100 | [diff] [blame] | 46 | networking-cflags = |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 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 |
Ola Liljedahl | 6a988f6 | 2020-02-27 15:10:03 +0100 | [diff] [blame] | 65 | |
Szabolcs Nagy | e112794 | 2020-05-01 13:14:50 +0100 | [diff] [blame] | 66 | # Remove GNU Property Notes from asm files. |
| 67 | #string-cflags += -DWANT_GNU_PROPERTY=0 |
| 68 | |
Ola Liljedahl | 6a988f6 | 2020-02-27 15:10:03 +0100 | [diff] [blame] | 69 | # Enable assertion checks. |
| 70 | #networking-cflags += -DWANT_ASSERT |
| 71 | |
| 72 | # Avoid auto-vectorization of scalar code and unroll loops |
| 73 | networking-cflags += -O2 -fno-tree-vectorize -funroll-loops |