commit
1f830b222f
46
README.md
46
README.md
|
@ -211,12 +211,14 @@ Going forward, we can now use `.tar.gz` for source code.
|
|||
more complex edits, including just changes to lines. Luckily, we are able to
|
||||
patch patch using sed only.
|
||||
|
||||
#### Part 12: patched mes-libc
|
||||
#### Part 12: sha-2
|
||||
|
||||
#### Part 13: patched mes-libc
|
||||
|
||||
Since patch is available at this point, we can apply additional fixes to
|
||||
mes-libc that are not included in the wip-m2 branch and recompile libc.
|
||||
|
||||
#### Part 13: patched tinycc
|
||||
#### Part 14: patched tinycc
|
||||
|
||||
In Guix, tinycc is patched to force static linking. Prior to this step, we have
|
||||
been forced to manually specify static linking for each tool. Now that we have
|
||||
|
@ -225,18 +227,18 @@ patch, we can patch tinycc to force static linking and then recompile it.
|
|||
Note that we have to do this using tinycc 0.9.26, as tinycc 0.9.27 cannot
|
||||
recompile itself for unknown reasons.
|
||||
|
||||
#### Part 14: make 3.80
|
||||
#### Part 15: make 3.80
|
||||
|
||||
GNU `make` is now built so we have a more robust building system. `make` allows
|
||||
us to do things like define rules for files rather than writing complex kaem
|
||||
scripts.
|
||||
|
||||
#### Part 15: bzip2 1.0.8
|
||||
#### Part 16: bzip2 1.0.8
|
||||
|
||||
`bzip2` is a compression format that compresses more than `gzip`. It is
|
||||
preferred where we can use it, and makes source code sizes smaller.
|
||||
|
||||
#### Part 16: coreutils 5.0.0
|
||||
#### Part 17: coreutils 5.0.0
|
||||
|
||||
GNU Coreutils is a collection of widely used utilities such as `cat`, `chmod`,
|
||||
`chown`, `cp`, `install`, `ln`, `ls`, `mkdir`, `mknod`, `mv`, `rm`, `rmdir`,
|
||||
|
@ -245,14 +247,14 @@ GNU Coreutils is a collection of widely used utilities such as `cat`, `chmod`,
|
|||
A few of the utilities cannot be easily compiled with Mes C library, so we skip
|
||||
them.
|
||||
|
||||
#### Part 17: heirloom devtools
|
||||
#### Part 18: heirloom devtools
|
||||
|
||||
`lex` and `yacc` from the Heirloom project. The Heirloom project is a collection
|
||||
of standard UNIX utilities derived from code by Caldera and Sun. Differently
|
||||
from the analogous utilities from the GNU project, they can be compiled with a
|
||||
simple `Makefile`.
|
||||
|
||||
#### Part 18: bash 2.05b
|
||||
#### Part 19: bash 2.05b
|
||||
|
||||
GNU `bash` is the most well known shell and the most complex piece of software
|
||||
so far. However, it comes with a number of great benefits over kaem, including
|
||||
|
@ -262,7 +264,7 @@ Bash ships with a bison pre-generated file here which we delete. Unfortunately,
|
|||
we have not bootstrapped bison but fortunately for us, heirloom yacc is able to
|
||||
cope here.
|
||||
|
||||
#### Part 19: flex 2.5.11
|
||||
#### Part 20: flex 2.5.11
|
||||
|
||||
`flex` is a tool for generating lexers or scanners: programs that recognize
|
||||
lexical patters.
|
||||
|
@ -273,7 +275,7 @@ that it can be processed by lex for the Heirloom project (the required
|
|||
modifications are mostly syntactical, plus a few workarounds to avoid some flex
|
||||
advanced features).
|
||||
|
||||
#### Part 20: musl 1.1.24
|
||||
#### Part 21: musl 1.1.24
|
||||
|
||||
`musl` is a C standard library that is lightweight, fast, simple, free, and
|
||||
strives to be correct in the sense of standards-conformance and safety. `musl`
|
||||
|
@ -285,28 +287,28 @@ complex programs.
|
|||
patches. In particular, we replace all weak symbols with strong symbols and will
|
||||
patch `tcc` in the next step to ignore duplicate symbols.
|
||||
|
||||
#### Part 21: tcc 0.9.27 (musl)
|
||||
#### Part 22: tcc 0.9.27 (musl)
|
||||
|
||||
We recompile `tcc` against musl. This is a two stage process. First we build
|
||||
tcc-0.9.27 that itself links to Mes C library but produces binaries linked to
|
||||
musl. Then we recompile newly produced tcc with itself. Interestingly,
|
||||
tcc-0.9.27 linked against musl is self hosting. Finally, we rebuild musl once more
|
||||
with the new `tcc`.
|
||||
with the new `tcc` and rebuild `tcc against new `musl`.
|
||||
|
||||
#### Part 22: m4 1.4.7
|
||||
#### Part 23: m4 1.4.7
|
||||
|
||||
`m4` is the first piece of software we need in the autotools suite, flex
|
||||
2.6.4 and bison. It allows macros to be defined and files to be generated from those
|
||||
macros.
|
||||
|
||||
#### Part 23: flex 2.6.14
|
||||
#### Part 24: flex 2.6.14
|
||||
|
||||
We recompile unpatched GNU `flex` using older flex 2.5.11. This is again a two
|
||||
stage process, first compiling flex using `scan.c` (from `scan.l`) created by
|
||||
old flex, then recompile `scan.c` using the new version of flex to remove any
|
||||
buggy artifacts from the old flex.
|
||||
|
||||
#### Part 24: bison 3.4.1
|
||||
#### Part 25: bison 3.4.1
|
||||
|
||||
GNU `bison` is a parser generator. With `m4` and `flex` we can now bootstrap it
|
||||
following https://gitlab.com/giomasce/bison-bootstrap. It's a 3 stage process:
|
||||
|
@ -317,27 +319,27 @@ following https://gitlab.com/giomasce/bison-bootstrap. It's a 3 stage process:
|
|||
|
||||
Finally we have a fully functional `bison` executable.
|
||||
|
||||
#### Part 25: grep 2.4
|
||||
#### Part 26: grep 2.4
|
||||
|
||||
GNU `grep` is a pattern matching utility. Is is not immediately needed but will
|
||||
be useful later for autotools.
|
||||
|
||||
#### Part 26: diffutils 2.7
|
||||
#### Part 27: diffutils 2.7
|
||||
|
||||
`diffutils` is useful for comparing two files. It is not immediately needed but
|
||||
is required later for autotools.
|
||||
|
||||
#### Part 27: coreutils 5.0
|
||||
#### Part 28: coreutils 5.0
|
||||
|
||||
`coreutils` is rebuilt against musl. Additional utilities are built including
|
||||
`comm`, `expr`, `date`, `dd`, `sort`, `uname`, and `uniq`.
|
||||
|
||||
#### Part 28: gawk 3.0.4
|
||||
#### Part 29: gawk 3.0.4
|
||||
|
||||
`gawk` is the GNU implementation of `awk`, yet another pattern matching and data
|
||||
extraction utility. It is also required for autotools.
|
||||
|
||||
#### Part 29: perl 5.000
|
||||
#### Part 30: perl 5.000
|
||||
|
||||
Perl is a general purpose programming language that is especially suitable for
|
||||
text processing. It is essential for autotools build system because automake
|
||||
|
@ -352,12 +354,14 @@ pre-generated Configure script.
|
|||
At this first step we build `miniperl` which is `perl` without support for
|
||||
loading modules.
|
||||
|
||||
#### Part 30: perl 5.003
|
||||
#### Part 31: perl 5.003
|
||||
|
||||
We now use `perl` from the previous stage to recreate pre-generated files that
|
||||
are shipped in perl 5.003. But for now we still need to use handwritten makefile
|
||||
instead of `./Configure` script.
|
||||
|
||||
#### Part 31: perl 5.004_05
|
||||
#### Part 32: perl 5.004_05
|
||||
|
||||
Yet another version of perl.
|
||||
|
||||
#### Part 33: perl 5.005_03
|
||||
|
|
|
@ -16,5 +16,6 @@ ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.ta
|
|||
1ae43c8d2983404b9eec61c96e3ffa27e7b07e08215c95c015a4ab0095373ef3 perl-5.000.tar.gz
|
||||
9fa29beb2fc4a3c373829fc051830796de301f32a719d0b52a400d1719bbd7b1 perl-5.003.tar.gz
|
||||
1184478b298978b164a383ed5661e3a117c48ab97d6d0ab7ef614cdbe918b9eb perl5.004_05.tar.gz
|
||||
93f41cd87ab8ee83391cfa39a63b076adeb7c3501d2efa31b98d0ef037122bd1 perl5.005_03.tar.gz
|
||||
c6c37e888b136ccefab903c51149f4b7bd659d69d4aea21245f61053a57aa60a tar-1.12.tar.gz
|
||||
404a8d72427a559c074e581bf8f7d5a73283faf249cd3faf6dc1c6faf97d07c7 sha-2-61555d.tar.gz
|
||||
|
|
|
@ -199,6 +199,9 @@ get_file https://github.com/Perl/perl5/archive/perl-5.003.tar.gz
|
|||
# perl 5.004_05
|
||||
get_file https://www.cpan.org/src/5.0/perl5.004_05.tar.gz
|
||||
|
||||
# perl 5.005_03
|
||||
get_file https://www.cpan.org/src/5.0/perl5.005_03.tar.gz
|
||||
|
||||
# General cleanup
|
||||
find tmp -name .git -exec rm -rf \;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ cd ${pkg}
|
|||
kaem --file ${pkg}.kaem
|
||||
cd ..
|
||||
|
||||
# Part 13: Check all up to this part as sha256sum
|
||||
# Part 12a: Check all up to this part as sha256sum
|
||||
sha256sum -c pre-sha.sha256sums
|
||||
|
||||
# Part 13: mes-libc-patched
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
3154f34ec9d8a30faf4ee8d6d29a91b4e03e61613030c2872f8215493a94d7b4 /after/bin/cat
|
||||
eef190bbc238ffbd9de39b0a2629f815f3efd4a07848bbe9e5ddf15728a9ae6a /after/bin/chmod
|
||||
3db27eaf11453f08205bf42007bc81df0d1e2a35eb0845de4a17803ee2d5ad9a /after/bin/cksum
|
||||
5a869b028ce076d0a2ee06721956f38128a7d82d68be61e223a3051fbbb59e90 /after/bin/cp
|
||||
1ed5730145be705af04ab2b6f498bb12f5778b553510373e2f7885c174d9f6c7 /after/bin/csplit
|
||||
8289d664efad63db71cbc5a93bb2b08bfd19eb578ed3f8cf3902c602319a9b96 /after/bin/cut
|
||||
5abdf478511ae3d7ea8d7c67808f8eb19d37cb9f5f2bd3e63c9fa1ccb939ccb5 /after/bin/echo
|
||||
|
|
|
@ -3,6 +3,7 @@ fafa676fe85f662f753bb5257ba6575086c6d4d7b8b27a952624db08e136b1ac /after/bin/bas
|
|||
8b4e2b1ea346298b6534894e85cfa3ac4ee9bd1900da1d044a45c366d143dbf0 /after/bin/cat
|
||||
24b11f735c4dcbd28e0defcef6208f419ebb3a7f33a5f7addb41d7df9e021bc1 /after/bin/chmod
|
||||
8dd096b3a2973c4e3652e6bfffc30d2d85e8cb9b7f6cbbb2079cdb00a465589f /after/bin/cksum
|
||||
6e9c29ae39dc9cc13925fe4066ab1867d0623bc704b2b1be6e242dc27b6c8ea1 /after/bin/cp
|
||||
220ee0e1e19ad52403794872fd879619c25e2bf6b22d9616799250f76f8b9960 /after/bin/csplit
|
||||
15eea66971190c390da91bd8537c01b689e1cf24cc96cd256607ef437f07f41d /after/bin/cut
|
||||
0884b23703671535b882cffe99720d18f0f915b9323184dc20c0b7ef1af9ec4b /after/bin/echo
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -85,6 +85,4 @@
|
|||
|
||||
#define OSNAME "linux"
|
||||
|
||||
#define PRIVLIB_EXP "/after/lib/perl5/5.003"
|
||||
|
||||
#undef __DATE__ /* want reproducible build */
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
VERSION=5.003
|
||||
PRIVLIB_EXP=$(PREFIX)/lib/perl5/$(VERSION)
|
||||
|
||||
CC = tcc
|
||||
CFLAGS = -DPRIVLIB_EXP=\"$(PRIVLIB_EXP)\"
|
||||
|
||||
.PHONY: all
|
||||
|
||||
|
@ -16,5 +20,5 @@ miniperl: $(MINIPERL_OBJ)
|
|||
|
||||
install: all
|
||||
install miniperl $(PREFIX)/bin/perl
|
||||
mkdir -p $(PREFIX)/lib/perl5/5.003
|
||||
mv lib/* $(PREFIX)/lib/perl5/5.003/
|
||||
mkdir -p "$(PRIVLIB_EXP)"
|
||||
cp -r lib/* "$(PRIVLIB_EXP)"
|
||||
|
|
|
@ -85,8 +85,6 @@
|
|||
|
||||
#define OSNAME "linux"
|
||||
|
||||
#define PRIVLIB_EXP "/after/lib/perl5/5.004_05"
|
||||
|
||||
#undef __DATE__ /* want reproducible build */
|
||||
|
||||
#define Malloc_t void *
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
VERSION=5.004_05
|
||||
PRIVLIB_EXP=$(PREFIX)/lib/perl5/$(VERSION)
|
||||
|
||||
CC = tcc
|
||||
CFLAGS = -DPRIVLIB_EXP=\"$(PRIVLIB_EXP)\"
|
||||
|
||||
.PHONY: all
|
||||
|
||||
|
@ -16,5 +20,5 @@ miniperl: $(MINIPERL_OBJ)
|
|||
|
||||
install: all
|
||||
install miniperl $(PREFIX)/bin/perl
|
||||
mkdir -p $(PREFIX)/lib/perl5/5.004_05
|
||||
mv lib/* $(PREFIX)/lib/perl5/5.004_05/
|
||||
mkdir -p "$(PRIVLIB_EXP)"
|
||||
cp -r lib/* "$(PRIVLIB_EXP)"
|
||||
|
|
|
@ -11,9 +11,6 @@ src_prepare() {
|
|||
mv perly.tab.c perly.c
|
||||
mv perly.tab.h perly.h
|
||||
|
||||
# tcc messes up floats, which breaks version detection
|
||||
sed -i '/require/d' embed.pl
|
||||
|
||||
# Regenerate other prebuilt header files
|
||||
for file in embed keywords opcode; do
|
||||
rm ${file}.h
|
||||
|
@ -22,8 +19,8 @@ src_prepare() {
|
|||
}
|
||||
|
||||
src_install() {
|
||||
default_src_install
|
||||
|
||||
# Remove old perl
|
||||
rm -rf "${PREFIX}"/lib/perl5/5.003
|
||||
rm -rf "${PREFIX}"/lib/perl5/
|
||||
|
||||
default_src_install
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
9d0a972fbcd54033f425b00d8941bb620c3358b40a4b49c175e5ca5c45dba3b2 /after/bin/perl
|
|
@ -0,0 +1,96 @@
|
|||
// SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#define MEM_ALIGNBYTES 8
|
||||
#define BIN "/after/bin"
|
||||
#define BYTEORDER 0x4321
|
||||
#define CPPSTDIN "tcc -E"
|
||||
#define CPPMINUS "-"
|
||||
#define HAS_ALARM
|
||||
#define HAS_FORK
|
||||
#define HAS_MKDIR
|
||||
#define HAS_PAUSE
|
||||
#define HAS_RMDIR
|
||||
#define HAS_STRERROR
|
||||
#define HAS_SYS_ERRLIST
|
||||
#define Strerror(e) strerror(e)
|
||||
|
||||
#define HAS_SYSCALL
|
||||
#define HAS_TIMES
|
||||
|
||||
#define HAS_VPRINTF
|
||||
#define Gid_t gid_t
|
||||
|
||||
#define I_DIRENT
|
||||
#define Direntry_t struct dirent
|
||||
|
||||
#define I_DLFCN
|
||||
#define I_FCNTL
|
||||
#define I_GRP
|
||||
#define I_LIMITS
|
||||
#define I_MATH
|
||||
#define I_NETINET_IN
|
||||
#define I_PWD
|
||||
#define I_STDDEF
|
||||
#define I_STDLIB
|
||||
#define I_STRING
|
||||
#define I_SYS_DIR
|
||||
#define I_SYS_IOCTL
|
||||
#define I_SYS_PARAM
|
||||
#define I_SYS_SELECT
|
||||
#define I_SYS_STAT
|
||||
#define I_SYS_TIMES
|
||||
#define I_TERMIOS
|
||||
#define I_TIME
|
||||
#define I_UNISTD
|
||||
#define I_UTIME
|
||||
#define I_STDARG
|
||||
|
||||
#define INTSIZE 4
|
||||
#define Off_t off_t
|
||||
|
||||
#define PRIVLIB "/after/lib/perl5"
|
||||
|
||||
#define _(args) args
|
||||
|
||||
#define RANDBITS 31
|
||||
|
||||
#define SCRIPTDIR "/after/bin"
|
||||
|
||||
#define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","IOT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH", "IO", "POLL", "PWR", "SYS", "UNUSED"
|
||||
#define SIG_NUM 0, 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
|
||||
|
||||
#define Size_t size_t
|
||||
|
||||
#define STDCHAR char
|
||||
#define Uid_t uid_t
|
||||
|
||||
#define LOC_SED "/after/bin/sed"
|
||||
#define ARCHLIB "/after/lib/perl5/"
|
||||
|
||||
#define CAT2(a,b) a##b
|
||||
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
|
||||
|
||||
#define Time_t time_t
|
||||
|
||||
#define SSize_t ssize_t
|
||||
|
||||
#define Sigjmp_buf sigjmp_buf
|
||||
|
||||
#define Sigsetjmp(buf,save_mask) setjmp(buf)
|
||||
#define Siglongjmp(buf,retval) longjmp(buf,retval)
|
||||
|
||||
#define Signal_t void
|
||||
|
||||
#define OSNAME "linux"
|
||||
|
||||
#undef __DATE__ /* want reproducible build */
|
||||
|
||||
#define Malloc_t void *
|
||||
#define Free_t void
|
||||
|
||||
#define SH_PATH "/bin/sh"
|
||||
#define ARCHNAME "i386-linux"
|
||||
#define BIN_EXP "/after/bin"
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
VERSION=5.005_03
|
||||
PRIVLIB_EXP=$(PREFIX)/lib/perl5/$(VERSION)
|
||||
|
||||
CC = tcc
|
||||
CFLAGS = -DPRIVLIB_EXP=\"$(PRIVLIB_EXP)\"
|
||||
|
||||
.PHONY: all
|
||||
|
||||
MINIPERL_SRC = av deb doio doop dump globals gv hv mg miniperlmain op perl perlio perly pp pp_ctl pp_hot pp_sys regcomp regexec run scope sv taint toke universal util
|
||||
MINIPERL_OBJ = $(addsuffix .o, $(MINIPERL_SRC))
|
||||
|
||||
all: miniperl
|
||||
|
||||
miniperl: $(MINIPERL_OBJ)
|
||||
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
|
||||
|
||||
install: all
|
||||
install miniperl $(PREFIX)/bin/perl
|
||||
mkdir -p "$(PRIVLIB_EXP)"
|
||||
cp -r lib/* "$(PRIVLIB_EXP)"
|
|
@ -0,0 +1,30 @@
|
|||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_prepare() {
|
||||
default_src_prepare
|
||||
|
||||
# Regenerate bison files
|
||||
rm perly.c perly.h
|
||||
bison -d perly.y
|
||||
mv perly.tab.c perly.c
|
||||
mv perly.tab.h perly.h
|
||||
|
||||
# Regenerate other prebuilt header files
|
||||
for file in embed keywords opcode; do
|
||||
rm ${file}.h
|
||||
perl ${file}.pl
|
||||
done
|
||||
rm regnodes.h
|
||||
perl regcomp.pl
|
||||
rm byterun.h byterun.c
|
||||
perl bytecode.pl
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Remove old perl
|
||||
rm -rf "${PREFIX}"/lib/perl5/
|
||||
|
||||
default_src_install
|
||||
}
|
|
@ -12,7 +12,7 @@ set -e
|
|||
|
||||
export PREFIX=/after
|
||||
|
||||
# Part 20
|
||||
# Part 20
|
||||
build flex-2.5.11
|
||||
|
||||
# Part 21
|
||||
|
@ -59,4 +59,7 @@ build perl-5.003
|
|||
# Part 34
|
||||
build perl5.004_05
|
||||
|
||||
# Part 35
|
||||
build perl5.005_03
|
||||
|
||||
echo "Bootstrapping completed."
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_unpack() {
|
||||
# Our cp does not support recursive copying
|
||||
tar -c -C ../src/ -f tcc-0.9.27.tar tcc-0.9.27/
|
||||
tar -xf tcc-0.9.27.tar
|
||||
cp -r ../src/tcc-0.9.27 .
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_unpack() {
|
||||
# Our cp does not support recursive copying
|
||||
tar -c -C ../src/ -f tcc-0.9.27.tar tcc-0.9.27/
|
||||
tar -xf tcc-0.9.27.tar
|
||||
cp -r ../src/tcc-0.9.27 .
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
|
|
Loading…
Reference in New Issue