This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
bootstrap.yml
406 lines (388 loc) · 12.4 KB
/
bootstrap.yml
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# Shamelessly inspired (copied) from the one in bootstrap-managarm
sources:
- name: binutils
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.xz'
format: 'tar.xz'
extract_path: 'binutils-2.33.1'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
- host-automake-v1.15
regenerate:
- args: ['automake']
workdir: '@THIS_SOURCE_DIR@/ld'
- name: gcc
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz'
format: 'tar.xz'
extract_path: 'gcc-9.2.0'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
- host-automake-v1.11
regenerate:
# download_prerequisites should probably move to some "post_checkout" step.
- args: ['./contrib/download_prerequisites']
workdir: '@THIS_SOURCE_DIR@'
- args: ['autoconf']
workdir: '@THIS_SOURCE_DIR@/gcc'
- args: ['autoconf']
workdir: '@THIS_SOURCE_DIR@/libstdc++-v3'
- args: ['sh', '-c', 'patch -p1 < ../../extra-patches/gcc.patch']
workdir: '@THIS_SOURCE_DIR@'
- name: mlibc
url: 'https://github.com/managarm/mlibc/archive/2.0.0.tar.gz'
format: 'tar.gz'
extract_path: 'mlibc-2.0.0'
tools:
- name: host-autoconf-v2.69
source:
name: autoconf-v2.69
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz'
format: 'tar.xz'
extract_path: 'autoconf-2.69'
patch-path-strip: 1
configure:
- args: ['@THIS_SOURCE_DIR@/configure', '--prefix=@PREFIX@']
compile:
- args: ['make', '-j@PARALLELISM@']
install:
- args: ['make', 'install']
- name: host-automake-v1.11
source:
name: automake-v1.11
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/automake/automake-1.11.6.tar.xz'
format: 'tar.xz'
extract_path: 'automake-1.11.6'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
compile:
- args: ['make', '-j@PARALLELISM@']
install:
- args: ['make', 'install']
# Stop aclocal from complaining.
- args: ['ln', '-sf', '@PREFIX@/share/aclocal-1.11', '@PREFIX@/share/aclocal']
- name: host-automake-v1.15
source:
name: automake-v1.15
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/automake/automake-1.15.1.tar.xz'
format: 'tar.xz'
extract_path: 'automake-1.15.1'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
compile:
- args: ['make', '-j@PARALLELISM@']
install:
- args: ['make', 'install']
# Stop aclocal from complaining.
- args: ['ln', '-sf', '@PREFIX@/share/aclocal-1.15', '@PREFIX@/share/aclocal']
- name: host-libtool
exports_aclocal: true
source:
name: libtool
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/libtool/libtool-2.4.5.tar.xz'
format: 'tar.xz'
extract_path: 'libtool-2.4.5'
patch-path-strip: 1
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
compile:
- args: ['make', '-j@PARALLELISM@']
install:
- args: ['make', 'install']
# We could run an external pkg-config; however, we need the aclocal files.
# The easiest way to ensure that they are available is to just install pkg-config.
- name: host-pkg-config
exports_aclocal: true
source:
name: 'pkg-config'
subdir: 'ports'
url: 'https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz'
format: 'tar.gz'
extract_path: 'pkg-config-0.29.2'
patch-path-strip: 1
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
- '--with-internal-glib'
compile:
- args: ['make', '-j@PARALLELISM@']
install:
- args: ['make', 'install']
- name: cross-binutils
from_source: binutils
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
- '--target=x86_64-qword'
- '--with-sysroot=@SYSROOT_DIR@'
# On recent compilers, binutils 2.26 causes implicit-fallthrough warnings, among others.
- '--disable-werror'
# -g blows up the binary size.
- 'CFLAGS=-O2'
compile:
- args: ['make', '-j@PARALLELISM@', 'all-binutils', 'all-gas', 'all-ld']
install:
- args: ['make', 'install-binutils', 'install-gas', 'install-ld']
- name: system-gcc
from_source: gcc
tools_required:
- tool: cross-binutils
recursive: true
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--prefix=@PREFIX@'
- '--target=x86_64-qword'
- '--with-sysroot=@SYSROOT_DIR@'
- '--enable-languages=c,c++'
- '--disable-multilib'
- '--enable-initfini-array'
# -g blows up GCC's binary size.
- 'CFLAGS=-O2'
- 'CXXFLAGS=-O2'
stages:
- name: compiler
pkgs_required:
- mlibc-headers
compile:
# GCC complains if the include directory is non-existant.
- args: ['mkdir', '-p', '@SYSROOT_DIR@/usr/include']
- args: ['make', '-j@PARALLELISM@', 'all-gcc']
install:
- args: ['make', 'install-gcc']
# GCC does *not* look for target-prefixed LD/AS.
# Instead, it searches a list of prefix directories. Link AS/LD to make it happy.
- args: ['mkdir', '-p', '@PREFIX@/x86_64-qword/bin']
- args: ['ln', '-sf', '../../../cross-binutils/x86_64-qword/bin/as',
'@PREFIX@/x86_64-qword/bin/as']
- args: ['ln', '-sf', '../../../cross-binutils/x86_64-qword/bin/ld',
'@PREFIX@/x86_64-qword/bin/ld']
- name: libgcc
tools_required:
- tool: system-gcc
stage_dependencies: [compiler]
pkgs_required:
- mlibc
compile:
- args: ['make', '-j@PARALLELISM@', 'all-target-libgcc']
install:
- args: ['make', 'install-target-libgcc']
- name: libstdc++
tools_required:
- tool: system-gcc
stage_dependencies: [libgcc]
compile:
- args: ['make', '-j@PARALLELISM@', 'all-target-libstdc++-v3']
install:
- args: ['make', 'install-target-libstdc++-v3']
packages:
- name: mlibc-headers
from_source: mlibc
implict_package: true
configure:
- args:
- 'meson'
- '--cross-file'
- '@SOURCE_ROOT@/cross_file.txt'
- '--prefix=/usr'
- '@THIS_SOURCE_DIR@'
- '-Dheaders_only=true'
build:
- args: ['ninja']
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- name: mlibc
from_source: mlibc
tools_required:
- tool: system-gcc
stage_dependencies: [compiler]
implict_package: true
pkgs_required:
- mlibc-headers
configure:
- args:
- 'meson'
- '--cross-file'
- '@SOURCE_ROOT@/cross_file.txt'
- '--prefix=/usr'
- '--libdir=lib'
- '--buildtype=debugoptimized'
- '-Dmlibc_no_headers=true'
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
- args: ['ninja', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- args: ['ln', '-sf', 'crt0.o', '@THIS_COLLECT_DIR@/usr/lib/crt1.o']
- name: bash
source:
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz'
format: 'tar.gz'
extract_path: 'bash-5.0'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
- host-automake-v1.15
regenerate:
# While we do not need to regenerate the configure script, we need to touch it
# after patching config.sub so that make does not try to regenerate it.
- args: ['autoconf']
tools_required:
- system-gcc
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-qword'
- '--prefix=/usr'
- '--without-bash-malloc'
- '--disable-nls'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'DESTDIR=@THIS_COLLECT_DIR@', 'install']
quiet: true
- name: binutils
from_source: binutils
tools_required:
- tool: system-gcc
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-qword'
- '--prefix=/usr'
- '--target=x86_64-qword'
- '--with-sysroot=/'
- '--disable-nls'
# On recent compilers, binutils 2.26 causes implicit-fallthrough warnings, among others.
- '--disable-werror'
# -g blows up the binary size.
- 'CFLAGS=-O2'
build:
- args: ['make', '-j@PARALLELISM@', 'all-binutils', 'all-gas', 'all-ld']
- args: ['make', 'install-binutils', 'install-gas', 'install-ld']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- name: coreutils
source:
subdir: 'ports'
url: 'https://ftp.gnu.org/gnu/coreutils/coreutils-8.30.tar.xz'
format: 'tar.xz'
extract_path: 'coreutils-8.30'
patch-path-strip: 1
tools_required:
- host-autoconf-v2.69
- host-automake-v1.11
regenerate:
- args: ['cp',
'@BUILD_ROOT@/tools/host-automake-v1.11/share/automake-1.11/config.sub',
'@THIS_SOURCE_DIR@/build-aux/']
- args: ['sh', '-c', "sed 's/.*could not determine how to read list of mounted file systems.*/true/' < configure > configure.sed"]
- args: ['rm', '-f', 'configure']
- args: ['mv', 'configure.sed', 'configure']
- args: ['chmod', '+x', 'configure']
tools_required:
- system-gcc
configure:
# Huge hack: coreutils does not compile the build-machine binary make-prime-list
# using the build-machine compiler. Hence, build and invoke the binary manually here.
- args:
- '@THIS_SOURCE_DIR@/configure'
- args: ['make', 'src/make-prime-list']
- args: |
./src/make-prime-list 5000 > @THIS_SOURCE_DIR@/src/primes.h
- args: ['make', 'clean']
# No compile coreutils for the correct target.
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-qword'
- '--prefix=/usr'
- '--enable-no-install-program=du,df,stat,sleep,sort,tail'
- 'CFLAGS=-DSLOW_BUT_NO_HACKS -Wno-error'
build:
- args: ['make', '-j@PARALLELISM@']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- name: gcc
from_source: gcc
tools_required:
- tool: system-gcc
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-qword'
- '--prefix=/usr'
- '--target=x86_64-qword'
- '--with-sysroot=/'
- '--with-build-sysroot=@SYSROOT_DIR@'
- '--enable-languages=c,c++'
- '--enable-initfini-array'
- '--disable-multilib'
- '--disable-nls'
# -g blows up GCC's binary size.
- 'CFLAGS=-O2'
- 'CXXFLAGS=-O2'
build:
- args: ['make', '-j@PARALLELISM@', 'all-gcc', 'all-target-libgcc', 'all-target-libstdc++-v3']
- args: ['make', 'install-gcc', 'install-target-libgcc', 'install-target-libstdc++-v3']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- name: nasm
default: false
source:
subdir: 'ports'
url: 'https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz'
format: 'tar.gz'
extract_path: 'nasm-2.14.02'
patch-path-strip: 1
tools_required:
- system-gcc
configure:
- args:
- '@THIS_SOURCE_DIR@/configure'
- '--host=x86_64-qword'
- '--prefix=/usr'
build:
- args: ['make']
- args: ['make', 'install']
environ:
DESTDIR: '@THIS_COLLECT_DIR@'
quiet: true
- name: util-qword
source:
subdir: 'ports'
git: 'https://github.com/qword-os/util-qword.git'
branch: 'master'
tools_required:
- system-gcc
configure: []
build:
- args: ['make', '-C', '@THIS_SOURCE_DIR@', 'CC=x86_64-qword-gcc']
- args: ['make', '-C', '@THIS_SOURCE_DIR@', 'DESTDIR=@THIS_COLLECT_DIR@', 'PREFIX=/usr', 'install']