1bbbf1280Sopenharmony_ci# Example config.mk 2bbbf1280Sopenharmony_ci# 3bbbf1280Sopenharmony_ci# Copyright (c) 2018-2020, Arm Limited. 4bbbf1280Sopenharmony_ci# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception 5bbbf1280Sopenharmony_ci 6bbbf1280Sopenharmony_ci# Subprojects to build 7bbbf1280Sopenharmony_ciSUBS = math string networking 8bbbf1280Sopenharmony_ci 9bbbf1280Sopenharmony_ci# Target architecture: aarch64, arm or x86_64 10bbbf1280Sopenharmony_ciARCH = aarch64 11bbbf1280Sopenharmony_ci 12bbbf1280Sopenharmony_ci# Use for cross compilation with gcc. 13bbbf1280Sopenharmony_ci#CROSS_COMPILE = aarch64-none-linux-gnu- 14bbbf1280Sopenharmony_ci 15bbbf1280Sopenharmony_ci# Compiler for the target 16bbbf1280Sopenharmony_ciCC = $(CROSS_COMPILE)gcc 17bbbf1280Sopenharmony_ciCFLAGS = -std=c99 -pipe -O3 18bbbf1280Sopenharmony_ciCFLAGS += -Wall -Wno-missing-braces 19bbbf1280Sopenharmony_ciCFLAGS += -Werror=implicit-function-declaration 20bbbf1280Sopenharmony_ci 21bbbf1280Sopenharmony_ci# Used for test case generator that is executed on the host 22bbbf1280Sopenharmony_ciHOST_CC = gcc 23bbbf1280Sopenharmony_ciHOST_CFLAGS = -std=c99 -O2 24bbbf1280Sopenharmony_ciHOST_CFLAGS += -Wall -Wno-unused-function 25bbbf1280Sopenharmony_ci 26bbbf1280Sopenharmony_ci# Enable debug info. 27bbbf1280Sopenharmony_ciHOST_CFLAGS += -g 28bbbf1280Sopenharmony_ciCFLAGS += -g 29bbbf1280Sopenharmony_ci 30bbbf1280Sopenharmony_ci# Optimize the shared libraries on aarch64 assuming they fit in 1M. 31bbbf1280Sopenharmony_ci#CFLAGS_SHARED = -fPIC -mcmodel=tiny 32bbbf1280Sopenharmony_ci 33bbbf1280Sopenharmony_ci# Enable MTE support. 34bbbf1280Sopenharmony_ci#CFLAGS += -march=armv8.5-a+memtag -DWANT_MTE_TEST=1 35bbbf1280Sopenharmony_ci 36bbbf1280Sopenharmony_ci# Use with cross testing. 37bbbf1280Sopenharmony_ci#EMULATOR = qemu-aarch64-static 38bbbf1280Sopenharmony_ci#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' -- 39bbbf1280Sopenharmony_ci 40bbbf1280Sopenharmony_ci# Additional flags for subprojects. 41bbbf1280Sopenharmony_cimath-cflags = 42bbbf1280Sopenharmony_cimath-ldlibs = 43bbbf1280Sopenharmony_cimath-ulpflags = 44bbbf1280Sopenharmony_cimath-testflags = 45bbbf1280Sopenharmony_cistring-cflags = 46bbbf1280Sopenharmony_cinetworking-cflags = 47bbbf1280Sopenharmony_ci 48bbbf1280Sopenharmony_ci# Use if mpfr is available on the target for ulp error checking. 49bbbf1280Sopenharmony_ci#math-ldlibs += -lmpfr -lgmp 50bbbf1280Sopenharmony_ci#math-cflags += -DUSE_MPFR 51bbbf1280Sopenharmony_ci 52bbbf1280Sopenharmony_ci# Use with gcc. 53bbbf1280Sopenharmony_cimath-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector 54bbbf1280Sopenharmony_cimath-cflags += -ffp-contract=fast -fno-math-errno 55bbbf1280Sopenharmony_ci 56bbbf1280Sopenharmony_ci# Use with clang. 57bbbf1280Sopenharmony_ci#math-cflags += -ffp-contract=fast 58bbbf1280Sopenharmony_ci 59bbbf1280Sopenharmony_ci# Disable vector math code 60bbbf1280Sopenharmony_ci#math-cflags += -DWANT_VMATH=0 61bbbf1280Sopenharmony_ci 62bbbf1280Sopenharmony_ci# Disable fenv checks 63bbbf1280Sopenharmony_ci#math-ulpflags = -q -f 64bbbf1280Sopenharmony_ci#math-testflags = -nostatus 65bbbf1280Sopenharmony_ci 66bbbf1280Sopenharmony_ci# Remove GNU Property Notes from asm files. 67bbbf1280Sopenharmony_ci#string-cflags += -DWANT_GNU_PROPERTY=0 68bbbf1280Sopenharmony_ci 69bbbf1280Sopenharmony_ci# Enable assertion checks. 70bbbf1280Sopenharmony_ci#networking-cflags += -DWANT_ASSERT 71bbbf1280Sopenharmony_ci 72bbbf1280Sopenharmony_ci# Avoid auto-vectorization of scalar code and unroll loops 73bbbf1280Sopenharmony_cinetworking-cflags += -O2 -fno-tree-vectorize -funroll-loops 74