summaryrefslogtreecommitdiffstats
path: root/comm/third_party/botan/src/build-data/cc/gcc.txt
blob: 711c48f76cc39d0ef6d4e8a5b98f7c8951b0f068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
macro_name GCC

binary_name g++

lang_flags "-std=c++11 -D_REENTRANT"

# This should only contain flags which are included in GCC 4.8
warning_flags "-Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor"

# Boost headers have 0 as nullptr and non-virtual-dtor issues so we can't werror on them
werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor"

maintainer_warning_flags "-Wstrict-overflow=5 -Wold-style-cast -Wsuggest-override -Wshadow -Wextra-semi"

optimization_flags "-O3"
sanitizer_optimization_flags "-O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer"
size_optimization_flags "-Os"

shared_flags "-fPIC"
coverage_flags "--coverage"
stack_protector_flags "-fstack-protector"

add_sysroot_option "--sysroot="

<sanitizers>
default   -> iterator,address

iterator  -> "-D_GLIBCXX_DEBUG"
address   -> "-fsanitize=address"
undefined -> "-fsanitize=undefined -fno-sanitize-recover=undefined"
</sanitizers>

visibility_build_flags "-fvisibility=hidden"
visibility_attribute '__attribute__((visibility("default")))'

<so_link_commands>
# The default works for GNU ld and several other Unix linkers
default       -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"

# macOS, HP-UX, and Solaris linkers use different syntax
macos   -> "$(CXX) -dynamiclib -fPIC -install_name $(INSTALLED_LIB_DIR)/{soname_abi}"
hpux    -> "$(CXX) -shared -fPIC -Wl,+h,{soname_abi}"
solaris -> "$(CXX) -shared -fPIC -Wl,-h,{soname_abi}"

# AIX and OpenBSD don't use sonames at all
aix     -> "$(CXX) -shared -fPIC"
openbsd -> "$(CXX) -shared -fPIC"
</so_link_commands>

<binary_link_commands>
default       -> "$(LINKER)"
</binary_link_commands>

<isa_flags>
sse2    -> "-msse2"
ssse3   -> "-mssse3"
sse41   -> "-msse4.1"
sse42   -> "-msse4.2"
avx2    -> "-mavx2"
bmi2    -> "-mbmi -mbmi2"
aesni   -> "-maes -mpclmul"
rdrand  -> "-mrdrnd"
rdseed  -> "-mrdseed"
sha     -> "-msha"
altivec -> "-maltivec"

powercrypto -> "-mcrypto -mvsx"
ppc64:power9 -> "-mcpu=power9"

arm64:armv8crypto -> ""
arm64:armv8sm3 -> "-march=armv8.2-a+sm4"
arm64:armv8sm4 -> "-march=armv8.2-a+sm4"
arm64:armv8sha512 -> "-march=armv8.2-a+sha3"
arm64:armv8sha3 -> "-march=armv8.2-a+sha3"

# For Aarch32 -mfpu=neon is required
# For Aarch64 NEON is enabled by default
arm32:neon    -> "-mfpu=neon"
arm64:neon    -> ""
</isa_flags>

# Flags set here are included at compile and link time
<mach_abi_linking>
all!haiku,qnx,none -> "-pthread"

openmp  -> "-fopenmp"

s390    -> "-m31"
s390x   -> "-m64"
sparc32 -> "-m32 -mno-app-regs"
sparc64 -> "-m64 -mno-app-regs"
ppc64   -> "-m64"
x86_32  -> "-m32"
x86_64  -> "-m64"
x32     -> "-mx32"

qnx     -> "-fexceptions"
cygwin  -> "-U__STRICT_ANSI__"
</mach_abi_linking>