-
Notifications
You must be signed in to change notification settings - Fork 5
/
meson.build
61 lines (51 loc) · 1.52 KB
/
meson.build
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
project(
'lfi',
['c', 'cpp'],
default_options: ['warning_level=1', 'buildtype=release'],
meson_version: '>=0.60.3',
version: run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
)
add_project_arguments('-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64', '-Werror=implicit-function-declaration', language : 'c')
# Enable various hardening flags (used by liblfi and liblfix).
c_args_hardened = [
'-fno-strict-aliasing',
'-fno-delete-null-pointer-checks',
'-fno-strict-overflow',
'-Werror=implicit',
'-Werror=incompatible-pointer-types',
'-Werror=int-conversion',
]
has_auto_var_init = meson.get_compiler('c').has_argument('-ftrivial-auto-var-init=zero')
if has_auto_var_init
c_args_hardened += '-ftrivial-auto-var-init=zero'
endif
has_fuzzer = meson.get_compiler('c').has_argument('-fsanitize=fuzzer')
argp = subproject('argp').get_variable('argp_dep')
cpu = target_machine.cpu_family()
lfi_gcc = find_program(cpu + '-lfi-linux-musl-gcc', required: false)
archmap = {
'aarch64': 'arm64',
'x86_64': 'amd64',
}
if not archmap.has_key(cpu)
warning('unsupported architecture: ' + cpu)
subdir_done()
endif
cpuarch = archmap[cpu]
go = find_program('go')
xxd = find_program('xxd', required: false)
cp = find_program('cp')
subdir('lfi-leg')
subdir('lfi-verify')
subdir('lfi-postlink')
subdir('lfi-compile')
subdir('liblfi')
subdir('liblfix')
if get_option('fuzzer')
subdir('lfi-fuzz')
endif
# subdir('lfi-run')
# subdir('libsobox')
# subdir('lfi-veribdd')
subdir('specinvoke')
subdir('toolchain')