-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.ninja
154 lines (132 loc) · 9.9 KB
/
build.ninja
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
cc_opt = -O2 -s
# cc_opt = -g -O0 -fsanitize=address
link_opt =
rule cc
depfile = $out.d
command = gcc -MD -MF $out.d -Wall -Wextra -Wshadow -fvisibility=hidden -fno-math-errno -ffp-contract=off -fno-trapping-math -fno-semantic-interposition -fmax-errors=5 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -std=c11 $cc_opt -c -o $out $in
rule link
command = gcc $cc_opt -o $out $in $link_opt
rule run
command = $in $out
rule create_polyfill_so
command = ./$in empty:$arch --add-hash --add-gnu-hash --create-polyfill-so --target-glibc=$target_glibc --output $out
rule run_polyfill_glibc_txt
command = ./polyfill-glibc >$out $in $link_opt
rule run_polyfill_glibc
command = ./polyfill-glibc --output $out $in $link_opt
build polyfill-glibc: link build/main.o build/renamer.o build/polyfiller.o build/aarch64/polyfiller.o build/x86_64/polyfiller.o build/print_eh_frame.o build/erw.o build/v2f.o build/tokenise.o build/sht.o build/uuht.o build/arena.o build/reloc_kind.o build/common.o
default polyfill-glibc
build build/aarch64/polyfills.so: create_polyfill_so polyfill-glibc
arch = aarch64
target_glibc = 2.17
build build/aarch64/polyfiller.o: cc src/aarch64/polyfiller.c | build/aarch64/assembled_gen.h
build build/aarch64/assembled_gen.h: run build/aarch64/assembler src/aarch64/_init.s src/aarch64/atexit.s src/aarch64/c11_thread.s src/aarch64/fatal.s src/aarch64/glibc_2_18.s src/aarch64/glibc_2_25.s src/aarch64/glibc_2_26.s src/aarch64/glibc_2_30.s src/aarch64/glibc_2_31.s src/aarch64/glibc_2_34.s src/aarch64/glibc_2_36.s src/aarch64/glibc_2_38.s src/aarch64/stdbit.s src/aarch64/syscalls.s src/aarch64/syscalls_ac.s
build build/aarch64/assembler: link build/aarch64/assembler.o build/tokenise.o build/sht.o build/uuht.o build/common.o
build build/aarch64/assembler.o: cc src/aarch64/assembler.c | build/aarch64/assembler_gen.h
build build/aarch64/assembler_gen.h: run build/aarch64/build_assembler src/aarch64/insn_encoding.txt
build build/aarch64/build_assembler: link build/aarch64/build_assembler.o build/tokenise.o build/sht.o build/uuht.o
build build/aarch64/build_assembler.o: cc src/aarch64/build_assembler.c
build build/aarch64/renames.h: run build/parse_renames src/aarch64/renames.txt
build build/x86_64/polyfills.so: create_polyfill_so polyfill-glibc
arch = x86_64
target_glibc = 2.3.2
build build/x86_64/polyfiller.o: cc src/x86_64/polyfiller.c | build/x86_64/assembled_gen.h
build build/x86_64/assembled_gen.h: run build/x86_64/assembler src/x86_64/_init.s src/x86_64/atexit.s src/x86_64/c11_thread.s src/x86_64/fatal.s src/x86_64/glibc_2_6.s src/x86_64/glibc_2_7.s src/x86_64/glibc_2_15.s src/x86_64/glibc_2_16.s src/x86_64/glibc_2_18.s src/x86_64/glibc_2_25.s src/x86_64/glibc_2_26.s src/x86_64/glibc_2_30.s src/x86_64/glibc_2_31.s src/x86_64/glibc_2_34.s src/x86_64/glibc_2_36.s src/x86_64/glibc_2_38.s src/x86_64/posix_spawn.s src/x86_64/qsort.s src/x86_64/stdbit.s src/x86_64/syscalls.s src/x86_64/syscalls_ac.s
build build/x86_64/assembler: link build/x86_64/assembler.o build/tokenise.o build/sht.o build/uuht.o build/common.o
build build/x86_64/assembler.o: cc src/x86_64/assembler.c | build/x86_64/assembler_gen.h
build build/x86_64/assembler_gen.h: run build/x86_64/build_assembler src/x86_64/insn_encoding.txt
build build/x86_64/build_assembler: link build/x86_64/build_assembler.o build/tokenise.o build/sht.o
build build/x86_64/build_assembler.o: cc src/x86_64/build_assembler.c
build build/x86_64/relative_interp_link: link build/x86_64/relative_interp_link.o build/uuht.o build/common.o
build build/x86_64/relative_interp_link.o: cc src/x86_64/relative_interp_link.c | build/x86_64/relative_interp_trampoline.h
build build/x86_64/relative_interp_payload.h: run build/x86_64/relative_interp_link build/x86_64/relative_interp_runtime.o
build build/x86_64/relative_interp_runtime.o: cc src/x86_64/relative_interp_runtime.c
cc_opt = -ffreestanding -fpic -O2 -funwind-tables -fasynchronous-unwind-tables -fno-omit-frame-pointer -fcf-protection=branch -momit-leaf-frame-pointer
build build/x86_64/relative_interp_trampoline.h: run build/x86_64/assembler src/x86_64/relative_interp_trampoline.s
build build/x86_64/renames.h: run build/parse_renames src/x86_64/renames.txt
build build/x86_64/set_relative_interp: link build/x86_64/set_relative_interp.o build/common.o
build build/x86_64/set_relative_interp.o: cc src/x86_64/set_relative_interp.c | build/x86_64/relative_interp_payload.h
build build/polyfiller.o: cc src/polyfiller.c
build build/main.o: cc src/main.c
build build/renamer.o: cc src/renamer.c | build/aarch64/renames.h build/x86_64/renames.h
build build/parse_renames: link build/parse_renames.o build/tokenise.o build/sht.o build/common.o
build build/parse_renames.o: cc src/parse_renames.c
build build/print_eh_frame.o: cc src/print_eh_frame.c
build build/erw.o: cc src/erw.c
build build/v2f.o: cc src/v2f.c
build build/tokenise.o: cc src/tokenise.c
build build/sht.o: cc src/sht.c
build build/uuht.o: cc src/uuht.c
build build/arena.o: cc src/arena.c
build build/reloc_kind.o: cc src/reloc_kind.c
build build/common.o: cc src/common.c
build build/aarch64/test/arc4random.txt: run build/aarch64/test/arc4random build/aarch64/polyfills.so
build build/aarch64/test/arc4random: link build/aarch64/test/arc4random.o build/test/syscall_filter.o
link_opt = -ldl
build build/aarch64/test/arc4random.o: cc test/aarch64/arc4random.c
build build/aarch64/test/glibc_2_38.txt: run build/aarch64/test/glibc_2_38 build/aarch64/polyfills.so
build build/aarch64/test/glibc_2_38: link build/aarch64/test/glibc_2_38.o
link_opt = -ldl
build build/aarch64/test/glibc_2_38.o: cc test/aarch64/glibc_2_38.c
build build/aarch64/test/memfd_pread_pwrite.txt: run build/aarch64/test/memfd_pread_pwrite build/aarch64/polyfills.so
build build/aarch64/test/memfd_pread_pwrite: link build/aarch64/test/memfd_pread_pwrite.o build/test/syscall_filter.o
link_opt = -ldl
build build/aarch64/test/memfd_pread_pwrite.o: cc test/aarch64/memfd_pread_pwrite.c
build build/aarch64/test/nan.txt: run build/aarch64/test/nan build/aarch64/polyfills.so
build build/aarch64/test/nan: link build/aarch64/test/nan.o
link_opt = -ldl
build build/aarch64/test/nan.o: cc test/aarch64/nan.c
build build/aarch64/test/stdbit.txt: run build/aarch64/test/stdbit build/aarch64/polyfills.so
build build/aarch64/test/stdbit: link build/aarch64/test/stdbit.o
link_opt = -ldl
build build/aarch64/test/stdbit.o: cc test/aarch64/stdbit.c
build build/aarch64/test/totalorder.txt: run build/aarch64/test/totalorder build/aarch64/polyfills.so
build build/aarch64/test/totalorder: link build/aarch64/test/totalorder.o
link_opt = -ldl
build build/aarch64/test/totalorder.o: cc test/aarch64/totalorder.c
build build/aarch64/test/twalk_r.txt: run build/x86_64/test/twalk_r build/aarch64/polyfills.so
build test/aarch64: phony build/aarch64/test/arc4random.txt build/aarch64/test/glibc_2_38.txt build/aarch64/test/memfd_pread_pwrite.txt build/aarch64/test/nan.txt build/aarch64/test/stdbit.txt build/aarch64/test/totalorder.txt build/aarch64/test/twalk_r.txt
build build/x86_64/test/arc4random.txt: run build/x86_64/test/arc4random build/x86_64/polyfills.so
build build/x86_64/test/arc4random: link build/x86_64/test/arc4random.o build/test/syscall_filter.o
link_opt = -ldl
build build/x86_64/test/arc4random.o: cc test/x86_64/arc4random.c
build build/x86_64/test/glibc_2_38.txt: run build/x86_64/test/glibc_2_38 build/x86_64/polyfills.so
build build/x86_64/test/glibc_2_38: link build/x86_64/test/glibc_2_38.o
link_opt = -ldl
build build/x86_64/test/glibc_2_38.o: cc test/x86_64/glibc_2_38.c
build build/x86_64/test/memfd_pread_pwrite.txt: run build/x86_64/test/memfd_pread_pwrite build/x86_64/polyfills.so
build build/x86_64/test/memfd_pread_pwrite: link build/x86_64/test/memfd_pread_pwrite.o build/test/syscall_filter.o
link_opt = -ldl
build build/x86_64/test/memfd_pread_pwrite.o: cc test/x86_64/memfd_pread_pwrite.c
build build/x86_64/test/nan.txt: run build/x86_64/test/nan build/x86_64/polyfills.so
build build/x86_64/test/nan: link build/x86_64/test/nan.o
link_opt = -ldl
build build/x86_64/test/nan.o: cc test/x86_64/nan.c
build build/x86_64/test/qsort_r.txt: run build/x86_64/test/qsort_r build/x86_64/polyfills.so
build build/x86_64/test/qsort_r: link build/x86_64/test/qsort_r.o
link_opt = -ldl
build build/x86_64/test/qsort_r.o: cc test/x86_64/qsort_r.c
build build/x86_64/test/stdbit.txt: run build/x86_64/test/stdbit build/x86_64/polyfills.so
build build/x86_64/test/stdbit: link build/x86_64/test/stdbit.o
link_opt = -ldl
build build/x86_64/test/stdbit.o: cc test/x86_64/stdbit.c
build build/x86_64/test/totalorder.txt: run build/x86_64/test/totalorder build/x86_64/polyfills.so
build build/x86_64/test/totalorder: link build/x86_64/test/totalorder.o
link_opt = -ldl
build build/x86_64/test/totalorder.o: cc test/x86_64/totalorder.c
build build/x86_64/test/twalk_r.txt: run build/x86_64/test/twalk_r build/x86_64/polyfills.so
build build/x86_64/test/twalk_r: link build/x86_64/test/twalk_r.o
link_opt = -ldl
build build/x86_64/test/twalk_r.o: cc test/x86_64/twalk_r.c
build test/x86_64: phony build/x86_64/test/arc4random.txt build/x86_64/test/glibc_2_38.txt build/x86_64/test/qsort_r.txt build/x86_64/test/memfd_pread_pwrite.txt build/x86_64/test/nan.txt build/x86_64/test/stdbit.txt build/x86_64/test/totalorder.txt build/x86_64/test/twalk_r.txt
build build/test/getauxval.txt: run build/test/getauxval_pf build/test/getauxval_imp.txt build/test/getauxval_imp_pf.txt
build build/test/getauxval_imp_pf.txt: run_polyfill_glibc_txt build/test/getauxval_pf | polyfill-glibc
link_opt = --print-imports
build build/test/getauxval_pf: run_polyfill_glibc build/test/getauxval | polyfill-glibc
link_opt = --target_glibc=2.15
build build/test/getauxval_imp.txt: run_polyfill_glibc_txt build/test/getauxval | polyfill-glibc
link_opt = --print-imports
build build/test/getauxval: link build/test/getauxval.o build/common.o
build build/test/getauxval.o: cc test/getauxval.c
build build/test/syscall_filter.o: cc test/syscall_filter.c
build test: phony test/x86_64 build/test/getauxval.txt