This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
/
Copy pathMakefile
217 lines (194 loc) · 4.85 KB
/
Makefile
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
include ../../../../Scripts/Makefile.configs
c_executables-x86_64 = \
attestation \
cpuid \
debug_regs-x86_64 \
rdtsc \
sighandler_divbyzero
c_executables = \
abort \
abort_multithread \
bootstrap \
bootstrap_pie \
bootstrap_static \
debug \
dev \
device \
epoll_wait_timeout \
eventfd \
exec \
exec_fork \
exec_invalid_args \
exec_same \
exec_victim \
exit \
exit_group \
fdleak \
file_check_policy \
file_size \
fopen_cornercases \
fork_and_exec \
fp_multithread \
fstat_cwd \
futex_bitset \
futex_requeue \
futex_timeout \
futex_wake_op \
getcwd \
getdents \
getsockname \
getsockopt \
groups \
host_root_fs \
init_fail \
large_mmap \
large_dir_read \
madvise \
mkfifo \
mmap_file \
mprotect_file_fork \
mprotect_prot_growsdown \
multi_pthread \
openmp \
pipe \
pipe_nonblocking \
pipe_ocloexec \
poll \
poll_closed_fd \
poll_many_types \
ppoll \
proc_common \
proc_cpuinfo \
proc_path \
pselect \
pthread_set_get_affinity \
readdir \
sched \
sched_set_get_affinity \
select \
shared_object \
sigaction_per_process \
sigaltstack \
sighandler_reset \
sighandler_sigpipe \
signal_multithread \
sigprocmask_pending \
spinlock \
stat_invalid_args \
str_close_leak \
syscall \
tcp_ipv6_v6only \
tcp_msg_peek \
udp \
unix \
vfork_and_exec \
$(c_executables-$(ARCH))
cxx_executables = bootstrap_c++
manifests = \
manifest \
argv_from_file.manifest \
attestation.manifest \
debug_log_file.manifest \
debug_log_inline.manifest \
env_from_file.manifest \
env_from_host.manifest \
eventfd.manifest \
exec_victim.manifest \
exit_group.manifest \
file_check_policy_allow_all_but_log.manifest \
file_check_policy_strict.manifest \
futex_bitset.manifest \
futex_requeue.manifest \
futex_wake_op.manifest \
getdents.manifest \
host_root_fs.manifest \
init_fail.manifest \
init_fail2.manifest \
large_mmap.manifest \
mmap_file.manifest \
multi_pthread.manifest \
multi_pthread_exitless.manifest \
openmp.manifest \
proc_path.manifest \
shared_object.manifest
exec_target = \
$(c_executables) \
$(cxx_executables) \
argv_from_file.manifest \
debug_log_file.manifest \
debug_log_inline.manifest \
env_from_file.manifest \
env_from_host.manifest \
file_check_policy_allow_all_but_log.manifest \
file_check_policy_strict.manifest \
init_fail2.manifest \
multi_pthread_exitless.manifest
target = \
argv_from_file \
debug_log_file \
debug_log_inline \
env_from_host \
env_from_file \
file_check_policy_allow_all_but_log \
file_check_policy_strict \
init_fail2 \
multi_pthread_exitless \
$(exec_target) \
$(manifests)
clean-extra += clean-tmp
extra_rules = \
-e 's:\$$(RA_CLIENT_SPID):$(if $(RA_CLIENT_SPID),$(RA_CLIENT_SPID),):g' \
-e 's:\$$(RA_CLIENT_LINKABLE):$(if $(RA_CLIENT_LINKABLE),$(RA_CLIENT_LINKABLE),0):g'
include ../../../../Scripts/Makefile.manifest
include ../../../../Scripts/Makefile.Test
CFLAGS-bootstrap_static = -static
CFLAGS-bootstrap_pie = -fPIC -pie
CFLAGS-debug = -g3
CFLAGS-debug_regs-x86_64 = -g3
CFLAGS-exec_same = -pthread
CFLAGS-shared_object = -fPIC -pie
CFLAGS-syscall += -I$(PALDIR)/../include -I$(PALDIR)/host/$(PAL_HOST) -I$(PALDIR)/../include/arch/$(ARCH)/Linux
CFLAGS-openmp = -fopenmp
CFLAGS-multi_pthread = -pthread
CFLAGS-exit_group = -pthread
CFLAGS-abort_multithread = -pthread
CFLAGS-eventfd = -pthread
CFLAGS-futex_bitset = -pthread
CFLAGS-futex_requeue = -pthread
CFLAGS-futex_wake_op = -pthread
CFLAGS-proc_common = -pthread
CFLAGS-spinlock += -I$(PALDIR)/../include/lib -I$(PALDIR)/../include/arch/$(ARCH) -pthread
CFLAGS-sigaction_per_process += -pthread
CFLAGS-signal_multithread += -pthread
CFLAGS-pthread_set_get_affinity += -pthread
CFLAGS-attestation += -I$(PALDIR)/../lib/crypto/mbedtls/crypto/include \
-I$(PALDIR)/host/Linux-SGX \
-I$(PALDIR)/../include/pal
LDLIBS-attestation += $(PALDIR)/../lib/crypto/mbedtls/install/lib/libmbedcrypto.a
CFLAGS-fp_multithread += -pthread -fno-builtin # see comment in the test's source
LDLIBS-fp_multithread += -lm
# Handle multiple tests which share one binary (Graphene requires 1-1 manifest-executable
# correspondence).
argv_from_file env_from_host env_from_file: bootstrap
$(call cmd,ln_sfr)
debug_log_file debug_log_inline: bootstrap
$(call cmd,ln_sfr)
file_check_policy_allow_all_but_log file_check_policy_strict: file_check_policy
$(call cmd,ln_sfr)
init_fail2: init_fail
$(call cmd,ln_sfr)
multi_pthread_exitless: multi_pthread
$(call cmd,ln_sfr)
%: %.c
$(call cmd,csingle)
%: %.cpp
$(call cmd,cxxsingle)
.PHONY: regression
regression: $(target)
$(RM) libos-regression.xml
$(MAKE) libos-regression.xml
libos-regression.xml: test_libos.py $(call expand_target_to_token,$(target))
../../../../Scripts/run-pytest --junit-xml $@ -v $<
.PHONY: clean-tmp
clean-tmp:
$(RM) -r *.tmp *.cached *.manifest.sgx *~ *.sig *.token .cache __pycache__ libos-regression.xml testfile tmp/*