Commit 60ec682
committed
Migrate the
This commit migrates wasi-libc's build system from a `make`-based system
to CMake. This is a complete rewrite of the build system which
culminates in the deletion of the current `Makefile` and a few
supporting scripts and files.
The rationale/reasons for this are similar to WebAssembly/wasi-sdk#429,
namely:
* Building a correct and robust build system in `make` is not easy.
There are many times I've found myself in a situation where I need to
blow away the entire build directory between builds. Much of the
this this bottoms out in subtle behavior like "this file was renamed,
but didn't get deleted in the archive" or subtle things like that.
CMake is responsible for handling these by default and, in general, is
probably going to be more correct than what we write.
* Out-of-tree builds are now supported.
* Customizing CFLAGS is now supported via standard mechanisms.
Previously `EXTRA_CFLAGS` was required since using `CFLAGS` could
break the build.
* It's easier to move more logic into CMake, such as downloading
compiler-rt, than it is to codify it all in makefiles.
* Platform portability is generally easier in CMake than make. Building
on Windows shouldn't require a full GNU-like environment, for example.
* Tests now properly rebuild themselves when wasi-libc changes.
* It's easier to customize high-level options, like "enable SIMD", in
CMake than it is in Makefiles. This can be documented as a single
option to pass where that option affects the build, flags, etc.
Personally I'm not a fan of CMake, but I'm more of a fan of it than
Makefiles, hence my desire to switch. I want to make this repository
easier to build, configure, and change over time. This will also make it
easier to integrate this all into wasi-sdk where everything is
CMake-based over there as well.
I am not a CMake expert, nor am I necessarily an expert in the previous
Makefiles. I've done my best here, but I'm happy to change things if
someone who knows more about CMake than I (which is a lot of folks)
recommends doing so. I'm also happy to adjust the libc build as desired
too.
Closes WebAssembly#46
Closes WebAssembly#156
Closes WebAssembly#295
Closes WebAssembly#322
Closes WebAssembly#330
Closes WebAssembly#514
Closes WebAssembly#605Makefile to CMake1 parent 75836f0 commit 60ec682
File tree
29 files changed
+1753
-1384
lines changed- .github
- actions/setup
- workflows
- cmake
- Platform
- scripts
- dlmalloc
- emmalloc
- expected
- wasm32-wasip1-threads
- wasm32-wasip1
- wasm32-wasip2
- fts
- libc-bottom-half
- clocks
- cloudlibc/src/common
- getpid
- headers/public
- mman
- signal
- libc-top-half
- scripts
- test
29 files changed
+1753
-1384
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 60 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
66 | 62 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 63 | + | |
| 64 | + | |
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
74 | 69 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 70 | + | |
| 71 | + | |
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
82 | 76 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 77 | + | |
| 78 | + | |
87 | 79 | | |
88 | 80 | | |
89 | 81 | | |
90 | 82 | | |
91 | 83 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 84 | + | |
| 85 | + | |
95 | 86 | | |
96 | 87 | | |
97 | 88 | | |
98 | 89 | | |
99 | 90 | | |
100 | | - | |
101 | | - | |
| 91 | + | |
| 92 | + | |
102 | 93 | | |
103 | 94 | | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 98 | + | |
110 | 99 | | |
111 | 100 | | |
112 | 101 | | |
113 | 102 | | |
114 | 103 | | |
115 | 104 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 105 | + | |
120 | 106 | | |
121 | 107 | | |
122 | 108 | | |
123 | 109 | | |
124 | 110 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 111 | + | |
| 112 | + | |
128 | 113 | | |
129 | 114 | | |
130 | 115 | | |
131 | 116 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 117 | + | |
| 118 | + | |
136 | 119 | | |
137 | 120 | | |
138 | 121 | | |
139 | 122 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 123 | + | |
144 | 124 | | |
145 | 125 | | |
146 | 126 | | |
147 | 127 | | |
148 | 128 | | |
149 | | - | |
150 | | - | |
151 | | - | |
| 129 | + | |
152 | 130 | | |
153 | 131 | | |
154 | 132 | | |
| |||
160 | 138 | | |
161 | 139 | | |
162 | 140 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 141 | | |
167 | 142 | | |
168 | 143 | | |
| |||
171 | 146 | | |
172 | 147 | | |
173 | 148 | | |
174 | | - | |
175 | | - | |
| 149 | + | |
176 | 150 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
182 | 155 | | |
183 | | - | |
| 156 | + | |
184 | 157 | | |
185 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
186 | 162 | | |
187 | 163 | | |
188 | 164 | | |
189 | | - | |
190 | | - | |
| 165 | + | |
191 | 166 | | |
192 | 167 | | |
193 | 168 | | |
194 | 169 | | |
195 | 170 | | |
196 | | - | |
| 171 | + | |
197 | 172 | | |
198 | 173 | | |
199 | 174 | | |
| |||
244 | 219 | | |
245 | 220 | | |
246 | 221 | | |
247 | | - | |
| 222 | + | |
| 223 | + | |
248 | 224 | | |
249 | 225 | | |
250 | 226 | | |
| |||
253 | 229 | | |
254 | 230 | | |
255 | 231 | | |
256 | | - | |
| 232 | + | |
257 | 233 | | |
258 | | - | |
259 | 234 | | |
260 | 235 | | |
261 | 236 | | |
262 | 237 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
271 | 244 | | |
272 | 245 | | |
273 | 246 | | |
274 | 247 | | |
275 | 248 | | |
276 | | - | |
277 | | - | |
| 249 | + | |
| 250 | + | |
278 | 251 | | |
279 | 252 | | |
280 | 253 | | |
281 | 254 | | |
282 | 255 | | |
283 | 256 | | |
284 | 257 | | |
285 | | - | |
286 | | - | |
| 258 | + | |
287 | 259 | | |
288 | | - | |
289 | | - | |
| 260 | + | |
| 261 | + | |
290 | 262 | | |
291 | 263 | | |
292 | | - | |
| 264 | + | |
| 265 | + | |
293 | 266 | | |
294 | | - | |
| 267 | + | |
0 commit comments