aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/cc/clang.txt
blob: 8b22eb667e5bbdeeb6f1ef5ad2d0c9c59e51dfbd (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
macro_name CLANG

binary_name clang++

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

warning_flags "-Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wshorten-64-to-32"

werror_flags "-Werror -Wno-error=unused-parameter -Wno-error=unreachable-code -Wno-error=unused-lambda-capture"

maintainer_warning_flags "-Wunreachable-code -Wdocumentation -Qunused-arguments"

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

add_sysroot_option "--sysroot="

<sanitizers>
default   -> address,undefined

address   -> "-fsanitize=address"
undefined -> "-fsanitize=undefined -fno-sanitize-recover=undefined"
coverage  -> "-fsanitize=fuzzer-no-link"
memory    -> "-fsanitize=memory"
</sanitizers>

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

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

<so_link_commands>
macos         -> "$(CXX) -dynamiclib -fPIC -install_name $(INSTALLED_LIB_DIR)/{soname_abi} -current_version {macos_so_current_ver} -compatibility_version {macos_so_compat_ver}"

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

<binary_link_commands>
default       -> "$(LINKER)"
llvm          -> "llvm-link"
emscripten    -> "em++"
</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"

arm64:armv8crypto -> "-march=armv8+crypto"

arm32:neon    -> "-mfpu=neon"
arm64:neon    -> ""
</isa_flags>

<cpu_flags>
llvm    -> "-emit-llvm -fno-use-cxa-atexit"
</cpu_flags>

<mach_abi_linking>
all!haiku,llvm -> "-pthread"

openmp  -> "-fopenmp"

x86_32  -> "-m32"
x86_64  -> "-m64"
ppc64   -> "-m64"

macos   -> "-stdlib=libc++"
ios     -> "-stdlib=libc++"
</mach_abi_linking>