Split mes libc into a separate source package.

Drop one of the mes git submodules.
This commit is contained in:
Andrius Štikonas 2021-04-16 16:28:34 +01:00
parent 419cd74d92
commit 3dfe3dc0f0
21 changed files with 196 additions and 162 deletions

View File

@ -44,6 +44,7 @@ a4adadf76b496a6bc50795702253ecfcb6f0d159b68038f31a5362009340bca2 help2man-1.36.
c4e63399b12f5858d11c44cea8e92f21cd564f8548e488dadc84046b424c80fc libtool-2.2.4.tar.bz2 c4e63399b12f5858d11c44cea8e92f21cd564f8548e488dadc84046b424c80fc libtool-2.2.4.tar.bz2
093c993767f563a11e41c1cf887f4e9065247129679d4c1e213d0544d16d8303 m4-1.4.7.tar.gz 093c993767f563a11e41c1cf887f4e9065247129679d4c1e213d0544d16d8303 m4-1.4.7.tar.gz
64b30b41fde2ebf669e6af489883fb1df6a06ac30555a96cfa3c39ecce7267dd make-3.80.tar.gz 64b30b41fde2ebf669e6af489883fb1df6a06ac30555a96cfa3c39ecce7267dd make-3.80.tar.gz
7a140e43565181bb54bf416117ea0efff057922ed284db5fc98b3740a7f3d956 mes-0.23.tar.gz
1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 musl-1.1.24.tar.gz 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 musl-1.1.24.tar.gz
9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd musl-1.2.2.tar.gz 9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd musl-1.2.2.tar.gz
ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.tar.gz ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.tar.gz

View File

@ -152,17 +152,11 @@ bzip2 1.0.8
``bzip2`` is a compression format that compresses more than ``gzip``. It ``bzip2`` is a compression format that compresses more than ``gzip``. It
is preferred where we can use it, and makes source code sizes smaller. is preferred where we can use it, and makes source code sizes smaller.
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.
tinycc 0.9.27 tinycc 0.9.27
============= =============
Now, we compile upstream tcc 0.9.27, the latest release of tinycc, using Now, we compile upstream tcc 0.9.27, the latest release of tinycc, using
the final version of tcc 0.9.26. We then recompile the libc once more. the final version of tcc 0.9.26.
From this point onwards, until further notice, all programs are compiled From this point onwards, until further notice, all programs are compiled
using tinycc 0.9.27. using tinycc 0.9.27.
@ -213,6 +207,19 @@ manually modified so that it can be processed by lex for the Heirloom
project (the required modifications are mostly syntactical, plus a few project (the required modifications are mostly syntactical, plus a few
workarounds to avoid some flex advanced features). workarounds to avoid some flex advanced features).
mes 0.23 (libc)
===============
In order to build musl we need tcc to support more than 255 command line
arguments. Due to the bug in older mes libc this was not possible. Hence,
we patch mes libc.
tcc 0.9.27
==========
Rebuild tcc 0.9.27 to get the fix from patches mes libc. We have to do
it using older ``tcc`` because tcc-0.9.27 is not self hosting.
musl 1.1.24 musl 1.1.24
=========== ===========
@ -232,8 +239,7 @@ tcc 0.9.27 (musl)
We recompile ``tcc`` against musl. This is a two stage process. First we We recompile ``tcc`` against musl. This is a two stage process. First we
build tcc-0.9.27 using tcc-0.9.26 that itself links to Mes C library but produces build tcc-0.9.27 using tcc-0.9.26 that itself links to Mes C library but produces
binaries linked to musl (we have to do it using older `tcc` because binaries linked to musl. Then we recompile newly produced tcc with
tcc-0.9.27 is not self hosting). Then we recompile newly produced tcc with
itself. Interestingly, tcc-0.9.27 linked against musl is self hosting. itself. Interestingly, tcc-0.9.27 linked against musl is self hosting.
musl 1.1.24 (tcc-musl) musl 1.1.24 (tcc-musl)

View File

@ -295,6 +295,9 @@ class SysA:
# flex 2.5.11 # flex 2.5.11
self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.11.tar.gz") self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.11.tar.gz")
# mes 0.23 (meslibc)
self.get_file("https://mirrors.kernel.org/gnu/mes/mes-0.23.tar.gz")
# musl 1.1.24 # musl 1.1.24
self.get_file("https://musl.libc.org/releases/musl-1.1.24.tar.gz") self.get_file("https://musl.libc.org/releases/musl-1.1.24.tar.gz")

View File

@ -101,11 +101,6 @@ cd ${pkg}
kaem --file ${pkg}.kaem kaem --file ${pkg}.kaem
cd .. cd ..
# mes-libc-patched
cd tcc-0.9.27
kaem --file mes-libc-patched.kaem
cd ..
# tcc 0.9.27 # tcc 0.9.27
pkg="tcc-0.9.27" pkg="tcc-0.9.27"
cd ${pkg} cd ${pkg}

View File

@ -1 +1 @@
d60023c3cd1bede628e920ac18a0f71115274f1867eb50ccd05ece1f64bc5fd6 /after/bin/bash b12868e2bb49724e214b4679973e3f1e43f091f1bbbf8ed66340f18cda226947 /after/bin/bash

View File

@ -1,55 +1,55 @@
57021d532906e8ec95173b4557959147cfdb240a26fbe36e48960e95f5b14cf4 /after/bin/install 60c9e7211b7439c0bd260b7199f882ea80f9b6fde43d3d5054f8d1b62147cbae /after/bin/install
18804ab55d0516bd19059339a63f145cd4d86084bdfb88b06ea36ac2128037a3 /after/bin/basename a4f5b38313d737d1bd554c5c38703fdb8ed4079e63330c93d6965be7cdecff30 /after/bin/basename
3154f34ec9d8a30faf4ee8d6d29a91b4e03e61613030c2872f8215493a94d7b4 /after/bin/cat e04b8a73dbc3aba350c6af07d03c455df1d8ea87cf35ee36458c64d479f86375 /after/bin/cat
eef190bbc238ffbd9de39b0a2629f815f3efd4a07848bbe9e5ddf15728a9ae6a /after/bin/chmod fb417a7bd9905991c2553243270f05ceb1f2cd366f83679891e138e71a0efa08 /after/bin/chmod
3db27eaf11453f08205bf42007bc81df0d1e2a35eb0845de4a17803ee2d5ad9a /after/bin/cksum 42c94b31112077a245ed6f2df29c9f6a7fe2c03a012c800e07bcc33713fd5934 /after/bin/cksum
5a869b028ce076d0a2ee06721956f38128a7d82d68be61e223a3051fbbb59e90 /after/bin/cp ffa31fd5ef490977830a00f276e4a4b45ad10b88203aacc9e756b515c1061333 /after/bin/cp
1ed5730145be705af04ab2b6f498bb12f5778b553510373e2f7885c174d9f6c7 /after/bin/csplit 3fe8e6e02725f865ae29b64e20cffc7689020812e85d2854f007b0ca50277e90 /after/bin/csplit
8289d664efad63db71cbc5a93bb2b08bfd19eb578ed3f8cf3902c602319a9b96 /after/bin/cut 79ce07561468e37951a24a05c5bd54b0aa9cd68642409657901258766e1d8225 /after/bin/cut
5abdf478511ae3d7ea8d7c67808f8eb19d37cb9f5f2bd3e63c9fa1ccb939ccb5 /after/bin/echo 57f38af18b965cce250eb43cdcda5dbec567129fc291d679462d51a87670cd96 /after/bin/echo
d275419b74a87b13a0454224c59863de38dc6e4392e4f6daa0d9aa635b55db0a /after/bin/expand 3ee8699aebbb2d08a666810777f19aed562300c3dd41f743d3f843548961b1ae /after/bin/expand
f9d1a04f64dda43d2d4c5358b2e9ec67697a587d493a038992ef4bfa18f834df /after/bin/factor 226b82d8b568fd36f4cfbd375b0ee4ad048350800f42cd54870b5969b149d57d /after/bin/factor
2e318c11041074ed917569fe7df5519db615fba24f4182e2468789abe6de5d86 /after/bin/false 480276a9d24e65a5b3e5ffb4aa78cb98a867ddd562913b220c19c59348a986f9 /after/bin/false
31763c8ad64d314501f236796af7536f6103d8ed392b1b47787ef035371304d2 /after/bin/fmt 5fb3dbcc4c4f0c0ad42a9027c46af939a64bd0193809f323d180b27086f43ecc /after/bin/fmt
4248a1741f49ef40fc74cf59e609eb55d416f301c6a0854f123cfd182c9d69b7 /after/bin/fold 4f321b6c597f41ae27b0f5075b73fc7cd7e5b4e808d6afb1edd4f86a653b0cc7 /after/bin/fold
4abd96e4e60ed3c492797387b5a1c6d6a0099600074817bc803baf7b5e5624ef /after/bin/head 02a7fc39b3d6133e575dfe8f063a44493665cb442b4f211b977ea142acd7b74f /after/bin/head
45a53024754c38846593aa0bef64ac8af1b33647d88b4aae85f05f095afd0ebe /after/bin/id 146dc0ad26d909eb65b70ec26b396574ad32ed316a570e9cd9e6c9a706f7656a /after/bin/id
56430b7c42580af3c5b5ef7fd1c43fcf373d1844eb41d80a0055b90a1471784e /after/bin/join a930a27e58f95d23ab863d823c1eeef00eae84e5d5bd359f29a6611977907db0 /after/bin/join
ab0354eb681fe6eaa9299ce27a34c46be22ce34b635b7ad20fe02a802f5f411d /after/bin/kill a50073d1e59329e082af954ef6e89a37067df6df838df29fa5f3a9e6b59b5e32 /after/bin/kill
b7e74600ec00aa8f13cd113ba832032ca95d2dda1070f568765b4941dab77de5 /after/bin/link 06f1921e746e202f1c79f64446e72dc053763cae367aa2137f799302ea8154e4 /after/bin/link
9cb09b77c3bc6044c86959a5e5eb7f402f13a88f3f719dc4087b8797a4dc1cac /after/bin/ln cffb260264c126395ee0c1b52ab621a06888628eae015a7ef7d502c4e02bf73d /after/bin/ln
005df5e851e0d52114507821ebb444ae7e2876a7619fe1da82091662e3844b2f /after/bin/logname c827cdd64d9e3a1397e8bf9cb1ec980385244bd835a8c1ba6c29171c5e091e18 /after/bin/logname
f81e08130457074d9a20489347069a7ae2aa60ed7ab7759561ca98dc9fdb22b8 /after/bin/mkfifo ae6d244329f4ef05105ae303395a1cd812598e2076a42966c9711d395ae8c565 /after/bin/mkfifo
58065d43c38f38cfed6eb20cfce6a221cc1a2f3f5aabf4c30563d34f0e4b3972 /after/bin/mkdir f174222efdad22e7c6c9cd7a4da4042d3c97964bbfb4899875aefa7daaefeced /after/bin/mkdir
7e2816b19067a66fdfe79d0f39a568c6f274cd92be10c43a4284908e3c6a7b36 /after/bin/mknod 9a938fa9660523ef2c12c2cfef10804ad14970b6fc2911778037e7ff815b0b06 /after/bin/mknod
e08ca394b75cf19cf8d51a21a9965922cacb213b275fcdfe71e9be78de5443df /after/bin/nl 83bc14d653f9392b95919962b25a8e717e15e749d32c55c3f591e46ac4e68758 /after/bin/nl
3a7413ebd546d60817e67aeb4d909c2528566bc25e8a5119ba65c2f834ca95ba /after/bin/od 6e001804beb990b3d7e4304660e9f7e178f8448a3780ebc9f92386f461c3f003 /after/bin/od
60cb00b56e5dbadc8e239e5ebdda5ded82bf8409e26aedbedfb36f256c0566f2 /after/bin/paste 033f864ff51c5a70b770d0d6fdcf5ba691fe11f06ee43eb4040dc974cd4dd16a /after/bin/paste
4bf4283733fb2e541084e63ba8b1d643eaf19e0e11931935f9fd2357a4998fbe /after/bin/pathchk 25ed5a35fbe67c34926471bb44dfb96bcc6c2d046c6b8cfcaead8e71999c093a /after/bin/pathchk
6e0f574cff56e9ce4e58a9db2c3999f7114269ece023496fbc629310e3b3911b /after/bin/printf a1714af35d79a55b9e88a40c5e04f323d44d05b3d5fe063ad5874a67bcadb49f /after/bin/printf
78681ca7d88324d4b595328b3beef7d46c75e957f4b7eec46985ba51bdaeb062 /after/bin/ptx 1c2c5efcc7a14da49c9cb11b8d21a941d5adac0a1cd2f7b5342b8f2866620b28 /after/bin/ptx
4ab6aa69bdfdc287a0fa402fc198defeef7ce6094519232425026d6ac65f39e5 /after/bin/pwd 844d7cbeb6d63672e6e683c8ede8ea648ffeef8ef435ccdb0f4d9554be15bfaf /after/bin/pwd
dab15e939cf79bb7609d86fd50afb9ca7395de313f9d6e14b5ec5cc304aa4aa7 /after/bin/readlink a9891310abee464897c7a9fddeef55add90b9e103092cd3b6d56c8271aebc755 /after/bin/readlink
402cf598fff0876fae60f1ce2e0deec9e955c51ab32a587857d7f353c9f5fca6 /after/bin/rmdir b6cbf998b9f5e52135bf12927e0fa70c47d2ebaa2eb0c5b743b56a958354b262 /after/bin/rmdir
1802bd63bd1af9dd18141079f3efdd9f00092c4d8989b165c1da2068a3a61025 /after/bin/seq d9fda1d883c9c75eb70538ed93dcfc6ee6da074fd7c083821d501332e8499846 /after/bin/seq
add34da9989d32db6a0b12476a074ef3c59acca09fd4ed8a1e7da19ebcc2f311 /after/bin/sleep 4f47ff18f7666b7c4f6ec155790143b46149bb5a684e016a102f578bcd70b5b6 /after/bin/sleep
d5d329c9bb11ea3cb9b95d0a7bea948b48defe5738882b8148f766cbbfcf30c3 /after/bin/split 71e745024bbb654de7bec3f349f4bff244afd3855b15959975a69dca053f09cf /after/bin/split
f77918803ea96e92e10c653f53a196ff2f3444e8317d019e2908472b5ff1d2a0 /after/bin/sum cdca632bf8018d1213d8c3965607ae86b78c12be022ad123fdb0d2e4f550996c /after/bin/sum
b2e00dee5951d3320ba0adac294311f31858d5860520f262b5b2f788c272fc88 /after/bin/tail 21a56a3d77b900b7d090c0d346b838f276d977ff91ca49cca667726fb80af6be /after/bin/tail
f491c177aaccd96b6f6c61bd288b5f039722edd47ae66e49ace4ae8722a62323 /after/bin/tee 2abeae105386cf7eb70ea6a57093e0aacd74c36c49b74f8deca1411b313d9c59 /after/bin/tee
cc04233f2020b59c0c6ff2b267a7c99ffcedc2a59ff94e09ef1dea7197765f29 /after/bin/tr 9d58a32584f9c073d28a9bf16b5fd6eb177d887752f565f2e879afb933bf5631 /after/bin/tr
dc2b1e033e1b21b0c2cdf0d71c0dae5bf76da11e45b20f5258377ae1638845b7 /after/bin/tsort 6073fa8fbcf0a504f14fd7d01431fff9e48f5755fbfc91db48b8b41f1489049d /after/bin/tsort
997ed6336650515aa97ae96b22f7cbc46d6346ba985e70336c21cbc5113c0066 /after/bin/unexpand c704d583fc895be7f768ab30b1694650898b1564dba02945880aaadc5a1b8215 /after/bin/unexpand
a7884b7ba882ca34443b638a512dbbc415824d149d3b588b7d2fd7f063300a4f /after/bin/unlink 3e31a01491c1fd3701894cc638b3dcf3046536e411f995dc8cbb681c91245240 /after/bin/unlink
b32921d0f32bee98f4af4d8ab30670dbce2dcf35f63221a6c3fd143859e11d9a /after/bin/wc c4bb7065baa37f86eec5e46745c5e6a912708625174c92260b82c67b251f1ba5 /after/bin/wc
4d39991d41b5479a506dc3ce13fa170bd5cfb0031e248f2fa32bf1338935f4af /after/bin/whoami c32c04dcee0a8b80ddbef9c43f0e2a1cb954c2c27f55331dc9cf25094f0c9784 /after/bin/whoami
199c5b3db58b79ca9a6d16352e779c6db1d8aef40d25e396fe41994e42de4720 /after/bin/test a5679b855ffbe6059dfccaf6acc2f217b4dcda243a058ea3260d0bc887eeb9aa /after/bin/test
6339686d665d9c6df2dac3507c6cf750577f2da5ef65b83c8bfc312fb0132ef8 /after/bin/touch 37d98622d110bb60a2c026c0936282e9cbc18c0f2fb27aefaee3041369deba00 /after/bin/touch
56b8e1436013b40f4fdedd1f240fb80a521a96819a73e38010e24d09430d2c5b /after/bin/true 90ddd8ff402d50244a353916b510f32d7f607365459e4315fdcfa9f0ab02ee59 /after/bin/true
dd76ea2581577775bee50ca31b436442f60f63a70fab6bb01eef927c1fd6139b /after/bin/yes b2b7fd078cd3ccb849b6c085a6522532c9e05484db72288addd6886cd915eca4 /after/bin/yes
30afc17da299c1e7caddc5cbc2389513770aae000284e8623f271f0f3c70c8d7 /after/bin/ls d75dccb1974142380c915a1acf73b96f948ed6952f3cdf186afc078c4ee1757c /after/bin/ls
57021d532906e8ec95173b4557959147cfdb240a26fbe36e48960e95f5b14cf4 /after/bin/install 60c9e7211b7439c0bd260b7199f882ea80f9b6fde43d3d5054f8d1b62147cbae /after/bin/install
d1eaf36eacb4e0688bded5d887bebd79a4777992825a696747e16330c0555eba /after/bin/md5sum 363851b2d7c442bbfc1f123d3adc48ef4aa6ecfef5f9e75be3124a3af27403b5 /after/bin/md5sum
6c826bbd5a58244ca1ee4af928ce27eeaa87346d0bd69aa18b0eafb296e6c147 /after/bin/mv 471f7404bc045edac3a2b4ee5dbae6275302cdd7827b950600f6d1ea392ea9de /after/bin/mv
ea0e3e2d87d46998450a6ab2c06758faf2ff9aaec70de7f1cec06a38e483cec6 /after/bin/rm 290e04d578157f0dbf9b8a9a2360bd1cb24a5b871ba1bcd8232dc631ea8ab833 /after/bin/rm
8918994159a3afb3f58ddc143b007bcba573eab6fbe43f705bf1cd6a2c3d03ab /after/bin/sha1sum 577f67d093143b0310909c652ca1940bc8c3eb4680e9c6b00a0c1f111aef5c42 /after/bin/sha1sum

View File

@ -1 +1 @@
122a20639d0733b34421d12e1ec45341317916c5b0a798410d4a25481fc39d2b /after/bin/flex d80c682810b2f44dffe005e2cf7b239d51758220d1e489f0115b21ec186a8d7b /after/bin/flex

View File

@ -1,5 +1,5 @@
ce634646b0fb57bdfecf84533562e624504d48144e3589195e2752cac9e94fdc /after/bin/yacc 77feb203eae9e115939775f41a91f47de628e4e9cb041ece8c55d73cec3fe871 /after/bin/yacc
276941719f71e8733d988cbc87f7be40c52ba9b6ddcc2d93898bcecb5a49b657 /after/bin/lex 65931952321d43b30c891744eaebab1a15c8087e4b1b624619a945ea3e7a1fd8 /after/bin/lex
ffe696afc1bda32a5f4035e29b3275cab73a27df7635ccbe02ed49a30374ccdd /after/lib/libl.a ffe696afc1bda32a5f4035e29b3275cab73a27df7635ccbe02ed49a30374ccdd /after/lib/libl.a
bf3fb293f1ff89ee3dbcb08166c64b7a6793b49a12673d7633e3353ebea80d4d /yaccpar bf3fb293f1ff89ee3dbcb08166c64b7a6793b49a12673d7633e3353ebea80d4d /yaccpar
ee0f187b844f50d64c912bfcb5d73706662846d6d8a90b8b1fb20dda60464734 /lex/ncform ee0f187b844f50d64c912bfcb5d73706662846d6d8a90b8b1fb20dda60464734 /lex/ncform

View File

@ -1,5 +1,4 @@
a1313f0a2aef2e63a3d03b2c8de98e6c022f0999e4d7e039bd140c250be4a4da /after/lib/libc.a 920b35eb5ae2fda55348a30aafed7f006a5b86cbe05093df2c75e5d169bd9cb0 /after/lib/libc.a
a1313f0a2aef2e63a3d03b2c8de98e6c022f0999e4d7e039bd140c250be4a4da /after/lib/libc+gnu.a
12c07ae103e7e3b390150a79e5c600d88de14e9bb73a066f6342582729ef5a3f /after/lib/libgetopt.a 12c07ae103e7e3b390150a79e5c600d88de14e9bb73a066f6342582729ef5a3f /after/lib/libgetopt.a
d1168ee9b528e39f0b40e8d51fb7fa3619c4a5ee928137f7faf6d0879b0916b0 /after/lib/crt1.o d1168ee9b528e39f0b40e8d51fb7fa3619c4a5ee928137f7faf6d0879b0916b0 /after/lib/crt1.o
461ca1494737fab86fe1c1d3addeaf9d0ece413e353abcdea8674db3f700cda3 /after/lib/crtn.o 461ca1494737fab86fe1c1d3addeaf9d0ece413e353abcdea8674db3f700cda3 /after/lib/crtn.o

71
sysa/mes-0.23/mes-libc-0.23.sh Executable file
View File

@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_compile() {
FILES="ctype/isalnum.c ctype/isalpha.c ctype/isascii.c ctype/iscntrl.c ctype/isdigit.c ctype/isgraph.c \
ctype/islower.c ctype/isnumber.c ctype/isprint.c ctype/ispunct.c ctype/isspace.c ctype/isupper.c ctype/isxdigit.c \
ctype/tolower.c ctype/toupper.c \
dirent/closedir.c dirent/__getdirentries.c dirent/opendir.c dirent/readdir.c \
linux/access.c linux/brk.c linux/chdir.c linux/chmod.c linux/clock_gettime.c linux/close.c linux/dup2.c \
linux/dup.c linux/execve.c linux/fcntl.c linux/fork.c linux/fsync.c linux/fstat.c linux/_getcwd.c \
linux/getdents.c linux/getegid.c linux/geteuid.c linux/getgid.c linux/getpid.c linux/getppid.c \
linux/getrusage.c linux/gettimeofday.c linux/getuid.c linux/ioctl.c linux/kill.c linux/link.c linux/lseek.c \
linux/lstat.c linux/mkdir.c linux/mknod.c linux/nanosleep.c linux/_open3.c linux/pipe.c linux/_read.c \
linux/readlink.c linux/rename.c linux/rmdir.c linux/setgid.c linux/settimer.c linux/setuid.c linux/signal.c \
linux/sigprogmask.c linux/symlink.c linux/stat.c linux/time.c linux/unlink.c linux/waitpid.c \
linux/x86-mes-gcc/_exit.c linux/x86-mes-gcc/syscall.c linux/x86-mes-gcc/_write.c \
math/ceil.c math/fabs.c math/floor.c mes/abtod.c mes/abtol.c mes/__assert_fail.c mes/__buffered_read.c \
mes/dtoab.c mes/eputc.c mes/eputs.c mes/fdgetc.c mes/fdgets.c mes/fdputc.c mes/fdputs.c mes/fdungetc.c \
mes/globals.c mes/itoa.c mes/ltoab.c mes/ltoa.c mes/__mes_debug.c mes/mes_open.c mes/ntoab.c mes/oputc.c \
mes/oputs.c mes/search-path.c mes/ultoa.c mes/utoa.c \
posix/alarm.c posix/buffered-read.c posix/execl.c posix/execlp.c posix/execv.c posix/execvp.c posix/getcwd.c \
posix/getenv.c posix/isatty.c posix/mktemp.c posix/open.c posix/raise.c posix/sbrk.c posix/setenv.c \
posix/sleep.c posix/unsetenv.c posix/wait.c posix/write.c \
stdio/clearerr.c stdio/fclose.c stdio/fdopen.c stdio/feof.c stdio/ferror.c stdio/fflush.c stdio/fgetc.c \
stdio/fgets.c stdio/fileno.c stdio/fopen.c stdio/fprintf.c stdio/fputc.c stdio/fputs.c stdio/fread.c \
stdio/freopen.c stdio/fscanf.c stdio/fseek.c stdio/ftell.c stdio/fwrite.c stdio/getc.c stdio/getchar.c \
stdio/perror.c stdio/printf.c stdio/putc.c stdio/putchar.c stdio/remove.c stdio/snprintf.c stdio/sprintf.c \
stdio/sscanf.c stdio/ungetc.c stdio/vfprintf.c stdio/vfscanf.c stdio/vprintf.c stdio/vsnprintf.c \
stdio/vsprintf.c stdio/vsscanf.c stdlib/abort.c stdlib/abs.c stdlib/alloca.c stdlib/atexit.c stdlib/atof.c \
stdlib/atoi.c stdlib/atol.c stdlib/calloc.c stdlib/__exit.c stdlib/exit.c stdlib/free.c stdlib/malloc.c \
stdlib/mbstowcs.c stdlib/puts.c stdlib/qsort.c stdlib/realloc.c stdlib/strtod.c stdlib/strtof.c \
stdlib/strtol.c stdlib/strtold.c stdlib/strtoll.c stdlib/strtoul.c stdlib/strtoull.c string/bcmp.c \
string/bcopy.c string/bzero.c string/index.c string/memchr.c string/memcmp.c string/memcpy.c string/memmem.c \
string/memmove.c string/memset.c string/rindex.c string/strcat.c string/strchr.c string/strcmp.c \
string/strcpy.c string/strcspn.c string/strdup.c string/strerror.c string/strlen.c string/strlwr.c \
string/strncat.c string/strncmp.c string/strncpy.c string/strpbrk.c string/strrchr.c string/strspn.c \
string/strstr.c string/strupr.c \
stub/atan2.c stub/bsearch.c stub/chown.c stub/__cleanup.c stub/cos.c stub/ctime.c stub/exp.c stub/fpurge.c \
stub/freadahead.c stub/frexp.c stub/getgrgid.c stub/getgrnam.c stub/getlogin.c stub/getpgid.c stub/getpgrp.c \
stub/getpwnam.c stub/getpwuid.c stub/gmtime.c stub/ldexp.c stub/localtime.c stub/log.c stub/mktime.c \
stub/modf.c stub/mprotect.c stub/pclose.c stub/popen.c stub/pow.c stub/rand.c stub/rewind.c stub/setbuf.c \
stub/setgrent.c stub/setlocale.c stub/setvbuf.c stub/sigaction.c stub/sigaddset.c stub/sigblock.c \
stub/sigdelset.c stub/sigemptyset.c stub/sigsetmask.c stub/sin.c stub/sys_siglist.c stub/system.c stub/sqrt.c \
stub/strftime.c stub/times.c stub/ttyname.c stub/umask.c stub/utime.c x86-mes-gcc/setjmp.c"
CFLAGS="-D HAVE_CONFIG_H=1 -I include -I include/linux/x86"
for f in $FILES; do
tcc ${CFLAGS} -c "lib/${f}"
done
# libc.a
tcc -ar cr libc.a *.o
# crt{1,n,i}.o
tcc ${CFLAGS} -c lib/linux/x86-mes-gcc/crt1.c
tcc ${CFLAGS} -c lib/linux/x86-mes-gcc/crtn.c
tcc ${CFLAGS} -c lib/linux/x86-mes-gcc/crti.c
# libgetopt.a
tcc ${CFLAGS} -c lib/posix/getopt.c
tcc -ar cr libgetopt.a getopt.o
}
src_install() {
install -m 644 libc.a "${DESTDIR}${PREFIX}/lib/"
install -m 644 libgetopt.a "${DESTDIR}${PREFIX}/lib/"
install -m 644 crt1.o "${DESTDIR}${PREFIX}/lib/"
install -m 644 crtn.o "${DESTDIR}${PREFIX}/lib/"
install -m 644 crti.o "${DESTDIR}${PREFIX}/lib/"
}

View File

@ -1,7 +1,7 @@
457fff81b3188b82621f3ae49847ebc60128017fcbdba012245169af76cf122a /after/lib/musl/crt1.o 457fff81b3188b82621f3ae49847ebc60128017fcbdba012245169af76cf122a /after/lib/musl/crt1.o
e3560c563125643467b29842db7984ccd1ecd3a6010358f9096674e199e36e05 /after/lib/musl/crti.o e3560c563125643467b29842db7984ccd1ecd3a6010358f9096674e199e36e05 /after/lib/musl/crti.o
b3a8cf971e9870bc3b2aa8fb8fc082b6a222cc0540a70f122a76ac6ced9151d0 /after/lib/musl/crtn.o b3a8cf971e9870bc3b2aa8fb8fc082b6a222cc0540a70f122a76ac6ced9151d0 /after/lib/musl/crtn.o
972db16d0c35619e1a12cfbaa1a500d97836b2850b6d93a08bf4e30e7cc377dc /after/lib/musl/libc.a 98e504a956692b1a899f5ec170239a6f491bb95692c56cbb0a10bc0dc1237f05 /after/lib/musl/libc.a
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libcrypt.a e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libcrypt.a
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libdl.a e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libdl.a
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libm.a e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /after/lib/musl/libm.a

View File

@ -24,6 +24,11 @@ export PREFIX=/after
build flex-2.5.11 build flex-2.5.11
# Patch meslibc to support > 255 command line arguments
build mes-0.23 mes-libc-0.23.sh
build tcc-0.9.27 tcc-meslibc-rebuild.sh checksums/tcc-meslibc-rebuild
build musl-1.1.24 musl-1.1.24.sh checksums/pass1 build musl-1.1.24 musl-1.1.24.sh checksums/pass1
# Rebuild tcc using musl # Rebuild tcc using musl

View File

@ -1,6 +1 @@
0bd8c89f8eee4b8e185b404308a79b3cd315a2143f864d7c250a8f088ae1149d /after/bin/tcc 37528569b3dcc36d549d5008919e4469c8eb14973d77a80dedab4db6f766025c /after/bin/tcc
a1313f0a2aef2e63a3d03b2c8de98e6c022f0999e4d7e039bd140c250be4a4da /after/lib/libc.a
12c07ae103e7e3b390150a79e5c600d88de14e9bb73a066f6342582729ef5a3f /after/lib/libgetopt.a
d1168ee9b528e39f0b40e8d51fb7fa3619c4a5ee928137f7faf6d0879b0916b0 /after/lib/crt1.o
09d4f9821a2566f7e56381a19259c41bd97f3c5ed83f490705acbfd1139a7736 /after/lib/crti.o
461ca1494737fab86fe1c1d3addeaf9d0ece413e353abcdea8674db3f700cda3 /after/lib/crtn.o

View File

@ -0,0 +1 @@
3dc89f46eae3023bda0509eda6d88640a8ae15d971291b2604f310a7d0d46cf0 /after/bin/tcc

File diff suppressed because one or more lines are too long

View File

@ -1,22 +0,0 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
cd src/mes-libc
# Patch
patch -Np0 -i ../../patches-mes-libc/qsort.patch
patch -Np0 -i ../../patches-mes-libc/crt1.patch
# Recompile libc
kaem --file ../../compile-libc.kaem
cd ../..
# Checksums
sha256sum -c checksums/mes-libc-patched

View File

@ -1,28 +0,0 @@
SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
SPDX-License-Identifier: LGPL-2.0-or-later
Reimplement qswap in a more correct manner that works much more cleanly and
with larger string sizes.
--- lib/stdlib/qsort.c
+++ lib/stdlib/qsort.c
@@ -24,10 +25,14 @@
void
qswap (void *a, void *b, size_t size)
{
- char *buf[8];
- memcpy (buf, a, size);
- memcpy (a, b, size);
- memcpy (b, buf, size);
+ char *pa = a;
+ char *pb = b;
+ do
+ {
+ char tmp = *pa;
+ *pa++ = *pb;
+ *pb++ = tmp;
+ } while (--size > 0);
}
size_t

@ -1 +0,0 @@
Subproject commit 22d37adeef22c184a113daec4bf06536ea099e6a

View File

@ -42,10 +42,6 @@ tcc-0.9.26 \
# Test # Test
tcc -version tcc -version
# Recompile libc
cd ../../src/mes-libc/
kaem --file ../../compile-libc.kaem
cd ../.. cd ../..
# Checksums # Checksums

View File

@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default_src_prepare
touch config.h
}
src_compile() {
export libdir=${PREFIX}/lib
export incdir=${PREFIX}/include
export bindir=${PREFIX}/bin
mkdir -p ${libdir}/tcc
tcc-0.9.26 \
-v \
-o tcc \
-D TCC_TARGET_I386=1 \
-D CONFIG_TCCDIR=\"${libdir}/tcc\" \
-D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
-D CONFIG_TCC_ELFINTERP=\"/mes/loader\" \
-D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
-D CONFIG_TCC_SYSINCLUDEPATHS=\"${incdir}\" \
-D TCC_LIBGCC=\"${libdir}/libc.a\" \
-D CONFIG_TCC_STATIC=1 \
-D CONFIG_USE_LIBGCC=1 \
-D TCC_VERSION=\"0.9.27\" \
-D ONE_SOURCE=1 \
tcc.c
}
src_install() {
install tcc ${DESTDIR}${bindir}
}