blob: c3ee5668ca33d18765aa78369e1e4927b84d0df9 (
plain)
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
|
#!/bin/sh
set -e
set -x
#bootstrapdir=$(mktemp -d -p $PWD bootstrap-XXXXXXXX)
bootstrapdir=$PWD/fuck-jack
mkdir -p $bootstrapdir/tarballs
mkdir -p $bootstrapdir/tools
mkdir -p $bootstrapdir/sources
mkdir -p $bootstrapdir/usr
mkdir -p $bootstrapdir/usr/lib
mkdir -p $bootstrapdir/usr/bin
mkdir -p $bootstrapdir/etc
mkdir -p $bootstrapdir/var
mkdir -p $bootstrapdir/run
mkdir -p $bootstrapdir/tmp
mkdir -p $bootstrapdir/home
mkdir -p $bootstrapdir/boot
ln -sf lib $bootstrapdir/usr/lib64
ln -sf usr/lib $bootstrapdir/lib64
ln -sf usr/lib $bootstrapdir/lib
ln -sf bin $bootstrapdir/usr/sbin
ln -sf usr/bin $bootstrapdir/bin
ln -sf usr/bin $bootstrapdir/sbin
bootstrap_target=x86_64-rasde-linux-musl
cores=$(nproc)
cd $bootstrapdir/tarballs
curl -L \
-O https://sourceware.org/pub/binutils/releases/binutils-2.47.tar.zst \
-O https://ftpmirror.gnu.org/gnu/gcc/gcc-16.2.0/gcc-16.2.0.tar.xz \
-O https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.2.tar.xz \
-O https://musl.libc.org/releases/musl-1.2.6.tar.gz \
-O https://ftpmirror.gnu.org/pub/gnu/m4/m4-1.4.21.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/ncurses/ncurses-6.6.tar.gz \
-O https://ftpmirror.gnu.org/gnu/bash/bash-5.3.tar.gz \
-O https://ftpmirror.gnu.org/gnu/coreutils/coreutils-9.11.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/diffutils/diffutils-3.12.tar.xz \
-O http://ftp.astron.com/pub/file/file-5.48.tar.gz \
-O https://ftpmirror.gnu.org/pub/gnu/findutils/findutils-4.11.0.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/gawk/gawk-5.4.1.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/grep/grep-3.12.tar.xz \
-O https://ftpmirror.gnu.org/gnu/gzip/gzip-1.14.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/make/make-4.4.1.tar.lz \
-O https://ftpmirror.gnu.org/pub/gnu/patch/patch-2.8.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/sed/sed-4.10.tar.xz \
-O https://ftpmirror.gnu.org/gnu/tar/tar-1.35.tar.xz \
-O https://ftpmirror.gnu.org/gnu/mpfr/mpfr-4.2.2.tar.xz \
-O https://ftpmirror.gnu.org/pub/gnu/gmp/gmp-6.3.0.tar.xz \
-O https://ftpmirror.gnu.org/gnu/mpc/mpc-1.4.1.tar.xz \
-O https://tukaani.org/xz/xz-5.8.3.tar.gz
for x in $(find $bootstrapdir/tarballs -type f); do
tar xf $x -C $bootstrapdir/sources
done
export PATH="$bootstrapdir/tools/bin:$PATH"
cd $bootstrapdir/sources/binutils*
mkdir build
cd build
../configure --prefix=$bootstrapdir/tools \
--with-sysroot=$bootstrapdir \
--target=$bootstrap_target \
--disable-nls \
--enable-gprofng=no \
--disable-werror \
--enable-new-dtags \
--enable-default-hash-style=gnu
make -j$cores
make install -j$cores
cd $bootstrapdir/sources/gcc*
mkdir build
cd build
../configure \
--target=$bootstrap_target \
--prefix=$bootstrapdir/tools \
--with-sysroot=$bootstrapdir \
--with-newlib \
--without-headers \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
make -j$cores
make install -j$cores
cd $bootstrapdir/sources/linux*
make mrproper -j$cores
make headers -j$cores
make headers_install -j$cores
cp -r ./usr/include $bootstrapdir/usr
cd $bootstrapdir/sources/musl*
./configure --prefix=/usr
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
ln -s ../lib/libc.so $bootstrapdir/usr/bin/ldd
cd $bootstrapdir/sources/gcc*
mkdir build-libstdcpp
cd build-libstdcpp
../libstdc++-v3/configure \
--host=$bootstrap_target \
--build=$(../config.guess) \
--prefix=/usr \
--disable-multilib \
--disable-nls \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$boostrap_target/include/c++/16.2.0
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/m4*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install j$cores
cd $bootstrapdir/sources/ncurses*
mkdir build
pushd build
../configure --prefix=$bootstrapdir/tools AWK=gawk
make -C include
make -C progs tic
install progs/tic $bootstrapdir/tools/bin
popd
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(./config.guess) \
--mandir=/usr/share/man \
--with-manpage-format=normal \
--with-shared \
--with-normal \
--disable-widenc \
--with-cxx-shared \
--without-debug \
--without-ada \
--disable-stripping \
AWK=gawk
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
make distclean
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(./config.guess) \
--mandir=/usr/share/man \
--with-manpage-format=normal \
--with-shared \
--enable-widenc \
--with-cxx-shared \
--without-debug \
--without-ada \
--disable-stripping \
AWK=gawk
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
ln -sf libncurses.so $bootstrapdir/usr/lib/libcurses.so
ln -sf libncurses.a $bootstrapdir/usr/lib/libcurses.a
cd $bootstrapdir/sources/bash*
./configure --prefix=/usr \
--build=$(sh support/config.guess) \
--host=$bootstrap_target \
--without-bash-malloc
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
ln -s bash $bootstrapdir/bin/sh
cd $bootstrapdir/sources/coreutils*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess) \
--enable-install-program=hostname \
--enable-no-install-program=kill,uptime
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/diffutils*
./configure --prefix=/usr \
--host=$bootstrap_target \
gl_cv_func_strcasecmp_works=y \
--build=$(./build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/file*
mkdir build
pushd build
../configure --disable-bzlib \
--disable-libseccomp \
--disable-xzlib \
--disable-zlib
make
popd
./configure --prefix=/usr --host=$bootstrap_target --build=$(./config.guess)
make FILE_COMPILE=$(pwd)/build/src/file
make DESTDIR=$bootstrapdir install
rm -v $bootstrapdir/usr/lib/libmagic.la
cd $bootstrapdir/sources/findutils*
./configure --prefix=/usr \
--localstatedir=/var/lib/locate \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/gawk*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/grep*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(./build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/gzip*
./configure --prefix=/usr --host=$bootstrap_target
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/make*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/patch*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/sed*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/tar*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
cd $bootstrapdir/sources/xz*
./configure --prefix=/usr \
--host=$bootstrap_target \
--build=$(build-aux/config.guess)
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
rm -v $bootstrapdir/usr/lib/liblzma.la
cd $bootstrapdir/sources/binutils*
sed '6031s/$add_dir//' -i ltmain.sh
rm -rf build
mkdir build
cd build
../configure \
--prefix=/usr \
--build=$(../config.guess) \
--host=$bootstrap_target \
--disable-nls \
--enable-shared \
--enable-gprofng=no \
--disable-werror \
--enable-64-bit-bfd \
--enable-new-dtags \
--enable-default-hash-style=gnu
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
rm -v $bootstrapdir/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.la
cd $bootstrapdir/sources/gcc*
rm -rf build
mkdir build
cd build
../configure \
--build=$(../config.guess) \
--host=$bootstrap_target \
--target=$bootstrap_target \
--prefix=/usr \
--with-build-sysroot=$bootstrapdir \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-multilib \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libsanitizer \
--disable-libssp \
--disable-libvtv \
--enable-languages=c,c++ \
LDFLAGS_FOR_TARGET=-L$PWD/$bootstrap_target/libgcc
make -j$cores
make DESTDIR=$bootstrapdir install -j$cores
ln -sv gcc $bootstrapdir/usr/bin/cc
|