Switch to using mes/nyacc tar packages.

This commit is contained in:
Andrius Štikonas 2021-06-11 22:39:50 +01:00
parent 7ff2de94c5
commit 40f40ea850
10 changed files with 77 additions and 104 deletions

12
.gitmodules vendored
View File

@ -6,21 +6,9 @@
[submodule "sysa/mescc-tools-seed/src/mescc-tools-seed"]
path = sysa/stage0-posix/src
url = https://github.com/oriansj/mescc-tools-seed/
[submodule "sysa/mes/src/mes"]
path = sysa/mes/src/mes
url = https://gitlab.com/janneke/mes.git
[submodule "sysa/mes/src/nyacc"]
path = sysa/mes/src/nyacc
url = https://git.savannah.gnu.org/git/nyacc.git
[submodule "sysa/tcc-0.9.26/src/tcc-0.9.26"]
path = sysa/tcc-0.9.26/src/tcc-0.9.26
url = https://gitlab.com/janneke/tinycc
[submodule "sysa/tcc-0.9.27/src/tcc-0.9.27"]
path = sysa/tcc-0.9.27/src/tcc-0.9.27
url = git://repo.or.cz/tinycc.git
[submodule "sysa/tcc-0.9.26/src/mes-libc"]
path = sysa/tcc-0.9.26/src/mes-libc
url = https://gitlab.com/janneke/mes
[submodule "sysa/tcc-0.9.27/src/mes-libc"]
path = sysa/tcc-0.9.27/src/mes-libc
url = https://gitlab.com/janneke/mes

View File

@ -58,10 +58,12 @@ c4e63399b12f5858d11c44cea8e92f21cd564f8548e488dadc84046b424c80fc libtool-2.2.4.
64b30b41fde2ebf669e6af489883fb1df6a06ac30555a96cfa3c39ecce7267dd make-3.80.tar.gz
e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7 make-4.2.1.tar.gz
7a140e43565181bb54bf416117ea0efff057922ed284db5fc98b3740a7f3d956 mes-0.23.tar.gz
f02cfe291e49fe44bc8712bf15536654fc643c0a02b3598237fb646884d9eb37 mes.tar.gz
17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459 mpc-1.2.1.tar.gz
0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f mpfr-4.1.0.tar.xz
1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 musl-1.1.24.tar.gz
9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd musl-1.2.2.tar.gz
f36e4fb7dd524dc3f4b354d3d5313f69e7ce5a6ae93711e8cf6d51eaa8d2b318 nyacc-1.00.2.tar.gz
ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.tar.gz
ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd patch-2.7.6.tar.xz
1ae43c8d2983404b9eec61c96e3ffa27e7b07e08215c95c015a4ab0095373ef3 perl-5.000.tar.gz

57
sysa.py
View File

@ -167,10 +167,6 @@ class SysA:
mescc_tools_extra_dir = os.path.join(stage0_posix_base_dir, 'mescc-tools-extra')
copytree(mescc_tools_extra_dir, self.tmp_dir)
# At the moment not useful for bootstrap but easier to keep it
mes_m2_dir = os.path.join(stage0_posix_base_dir, 'mes-m2')
copytree(mes_m2_dir, self.tmp_dir)
# bootstrap seeds
bootstrap_seeds_dir = os.path.join(self.sysa_dir, 'stage0-posix', 'src', 'bootstrap-seeds')
copytree(bootstrap_seeds_dir, self.tmp_dir)
@ -185,6 +181,10 @@ class SysA:
# create directories needed
os.mkdir(os.path.join(self.tmp_dir, 'bin'))
# stage0-posix checksums
shutil.copy2(os.path.join(stage0_posix_base_dir, self.arch + '.answers'),
os.path.join(self.tmp_dir, self.arch + '.answers'))
def after(self):
"""
Prepare sources in /after directory.
@ -192,11 +192,8 @@ class SysA:
the stage0-posix one is hella messy.
"""
self.create_after_dirs()
self.create_configuration_file()
self.stage0_posix_checksum()
self.deploy_extra_files()
self.mes()
self.tcc_0_9_26()
self.get_packages()
@ -205,43 +202,11 @@ class SysA:
Creates bootstrap.cfg file which would contain options used to
customize bootstrap.
"""
os.mkdir(self.after_dir)
config_path = os.path.join(self.after_dir, "bootstrap.cfg")
with open(config_path, "w") as config:
config.write("FORCE_TIMESTAMPS=" + str(self.force_timestamps))
def create_after_dirs(self):
"""
Create some empty directories for early bootstrap
This list can be eventually reduced if we include a small
mkdir implementation written for M2-Planet.
"""
bin_dir = os.path.join(self.after_dir, 'bin')
lib_dir = os.path.join(self.after_dir, 'lib')
include_dir = os.path.join(self.after_dir, 'include')
os.mkdir(self.after_dir)
os.mkdir(bin_dir)
os.mkdir(lib_dir)
os.mkdir(include_dir)
os.mkdir(os.path.join(lib_dir, self.arch+'-mes'))
os.mkdir(os.path.join(lib_dir, 'tcc'))
os.mkdir(os.path.join(lib_dir, 'linux'))
os.mkdir(os.path.join(lib_dir, 'linux', self.arch+'-mes'))
os.mkdir(os.path.join(include_dir, 'mes'))
os.mkdir(os.path.join(include_dir, 'gnu'))
os.mkdir(os.path.join(include_dir, 'linux'))
os.mkdir(os.path.join(include_dir, 'linux', self.arch))
os.mkdir(os.path.join(include_dir, 'sys'))
os.mkdir(os.path.join(include_dir, 'mach'))
# Needed for patch to work, although can be fixed with TMPDIR
os.mkdir(os.path.join(self.tmp_dir, 'tmp'))
def stage0_posix_checksum(self):
"""Early checksum files"""
shutil.copy2(os.path.join(self.sysa_dir, 'stage0-posix', 'checksums'),
os.path.join(self.after_dir, 'stage0-posix-checksums'))
def deploy_extra_files(self):
"""Deploy misc files"""
extra_files = ['helpers.sh', 'run.sh', 'run2.sh']
@ -250,13 +215,6 @@ class SysA:
shutil.copy2(os.path.join(self.git_dir, 'SHA256SUMS.sources'), self.after_dir)
def mes(self):
"""GNU Mes"""
copytree(os.path.join(self.sysa_dir, 'mes'), self.after_dir)
mes_dir = os.path.join(self.after_dir, 'mes', 'src', 'mes')
os.mkdir(os.path.join(mes_dir, 'bin'))
os.mkdir(os.path.join(mes_dir, 'm2'))
def tcc_0_9_26(self):
"""TinyCC 0.9.26 (patched by janneke)"""
copytree(os.path.join(self.sysa_dir, 'tcc-0.9.26'), self.after_dir)
@ -265,6 +223,11 @@ class SysA:
def get_packages(self):
"""Prepare remaining sources"""
# mes-0.22 snapshot with m2 fixes
self.get_file(["https://github.com/oriansj/mes-m2/archive/a7522f26ee020dc498219d0122ea1b7d345bcdd5.tar.gz",
"https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.2.tar.gz"],
output=["mes.tar.gz", "nyacc-1.00.2.tar.gz"])
# gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar", mkbuild=True)

View File

@ -8,57 +8,62 @@
set -ex
PATH=/after/bin:/bin
PATH=/bin
# Set commonly used variables
prefix=/after
bindir=${prefix}/bin
libdir=${prefix}/lib
incdir=${prefix}/include
MES_PREFIX=${prefix}/mes/src/mes
GUILE_LOAD_PATH=${prefix}/mes/src/nyacc/module:${prefix}/mes/src/mes/mes/module:${prefix}/mes/src/mes/module
NYACC_PKG=nyacc-1.00.2
MES_PKG=mes
MES_PREFIX=${prefix}/${MES_PKG}/src/mes-m2-a7522f26ee020dc498219d0122ea1b7d345bcdd5
GUILE_LOAD_PATH=${MES_PREFIX}/mes/module:${MES_PREFIX}/module:${prefix}/${MES_PKG}/src/${NYACC_PKG}/module
cd ${prefix}
mkdir ${bindir}
# Remove remaining dependencies on / (root of /after)
cp ../bin/blood-elf bin/blood-elf
cp ../bin/catm bin/catm
cp ../bin/chmod bin/chmod
cp ../bin/get_machine bin/get_machine
cp ../bin/hex2 bin/hex2
cp ../bin/kaem bin/kaem
cp ../bin/M1 bin/M1
cp ../bin/M2-Planet bin/M2-Planet
cp ../bin/mes-m2 bin/mes-m2
cp ../bin/sha256sum bin/sha256sum
cp ../bin/ungz bin/ungz
cp ../bin/untar bin/untar
cp /bin/blood-elf bin/blood-elf
cp /bin/catm bin/catm
cp /bin/chmod bin/chmod
cp /bin/get_machine bin/get_machine
cp /bin/hex2 bin/hex2
cp /bin/kaem bin/kaem
cp /bin/M1 bin/M1
cp /bin/M2-Planet bin/M2-Planet
cp /bin/mkdir bin/mkdir
cp /bin/sha256sum bin/sha256sum
cp /bin/ungz bin/ungz
cp /bin/untar bin/untar
/bin/cp /bin/cp /after/bin/cp
cp /bin/cp /after/bin/cp
/bin/chmod 755 bin/blood-elf
/bin/chmod 755 bin/catm
/bin/chmod 755 bin/chmod
/bin/chmod 755 bin/cp
/bin/chmod 755 bin/get_machine
/bin/chmod 755 bin/hex2
/bin/chmod 755 bin/kaem
/bin/chmod 755 bin/M1
/bin/chmod 755 bin/M2-Planet
/bin/chmod 755 bin/mes-m2
/bin/chmod 755 bin/sha256sum
/bin/chmod 755 bin/ungz
/bin/chmod 755 bin/untar
sha256sum -c stage0-posix-checksums
chmod 755 bin/blood-elf
chmod 755 bin/catm
chmod 755 bin/chmod
chmod 755 bin/cp
chmod 755 bin/get_machine
chmod 755 bin/hex2
chmod 755 bin/kaem
chmod 755 bin/M1
chmod 755 bin/M2-Planet
chmod 755 bin/mkdir
chmod 755 bin/sha256sum
chmod 755 bin/ungz
chmod 755 bin/untar
PATH=/after/bin
# Needed for patch to work
mkdir /tmp
# mes
pkg="mes"
pkg=${MES_PKG}
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
cd ${prefix}
# tcc 0.9.26
pkg="tcc-0.9.26"

View File

@ -1,4 +1,4 @@
d2e38ce7eab153cb2a019de92d12f1afc81f3ca0d4e068597fdab472250c7408 /after/bin/mes-m2
e835fdb1cd8c7852e8c879f1efdea6f7392bdd04938f5a01a6199ab2730fac4b /after/bin/mes-m2
b91c81e543b878ead4cc975df75e3d211f7bd2dcdd4c90e42df99d44311ce71e /after/bin/mescc.scm
90811dafd33ad56b8e4b0adcc04263f9329b9047b7cc337abe8151a75017172c /after/lib/x86-mes/crt1.s
e065af5f73d40b20029e9ba23143660f99c6abacb82d1b4c8f2067a4e395d553 /after/lib/x86-mes/crt1.o

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
Subproject commit 2ab4c5c676cb66088b0fb8de03b40b01f07bd4e0

@ -1 +0,0 @@
Subproject commit 06a0985332cfbc76e759da50d228d5aa01b4f6a9

@ -1 +1 @@
Subproject commit 880e60906b01bec7024d04250f41d9b6da4fa114
Subproject commit 15a783e18f0f04a1195133f1ae9a3e799ef78ebf

View File

@ -76,6 +76,7 @@ mes-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 -o unified-libc-3.
mes-tcc -ar cr ${libdir}/libc.a unified-libc-1.o unified-libc-2.o unified-libc-3.o
# libtcc1.a
mkdir ${libdir}/tcc
mes-tcc -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86 lib/libtcc1.c
mes-tcc -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o