diff --git a/host-recipes/gcc-cross b/host-recipes/gcc-cross index 728729cc..3ea8a851 100644 --- a/host-recipes/gcc-cross +++ b/host-recipes/gcc-cross @@ -2,23 +2,17 @@ name=gcc-cross revision=1 from_source=gcc-cross imagedeps="base-devel" -hostdeps="automake autoconf binutils-cross" +hostdeps="automake autoconf binutils-cross pkgconfig" deps="mlibc-headers" configure() { - ${source_dir}/configure --target=x86_64-astral --prefix=${prefix} --with-sysroot=${sysroot_dir} --enable-languages=c,c++ -enable-threads=posix --disable-multilib - } build() { - make all-gcc all-target-libgcc -j ${parallelism} - } install(){ - make DESTDIR="${dest_dir}" install-gcc install-target-libgcc - } diff --git a/host-recipes/libtool b/host-recipes/libtool index 4103645f..376d65b2 100644 --- a/host-recipes/libtool +++ b/host-recipes/libtool @@ -1,13 +1,13 @@ name=libtool revision=1 from_source=libtool -imagedeps="base-devel help2man" +hostdeps="autoconf automake" +imagedeps="gcc help2man" configure() { - - ${source_dir}/configure --prefix=${prefix} - + cp -pr ${source_dir}/* . + ./configure --prefix=${prefix} } build() { diff --git a/patches/mlibc/jinx-working-patch.patch b/patches/mlibc/jinx-working-patch.patch index f32d172d..ae0ba1a7 100644 --- a/patches/mlibc/jinx-working-patch.patch +++ b/patches/mlibc/jinx-working-patch.patch @@ -56,41 +56,6 @@ index 3474615..e034881 100644 } char **backtrace_symbols(void *const *, int) { -diff --git mlibc-clean/options/posix/generic/termios-stubs.cpp mlibc-workdir/options/posix/generic/termios-stubs.cpp -index 3e621ad..811459e 100644 ---- mlibc-clean/options/posix/generic/termios-stubs.cpp -+++ mlibc-workdir/options/posix/generic/termios-stubs.cpp -@@ -49,9 +49,15 @@ int tcflow(int fd, int action) { - return 0; - } - --int tcflush(int, int) { -- __ensure(!"Not implemented"); -- __builtin_unreachable(); -+int tcflush(int fd, int queue_selector) { -+ -+ MLIBC_CHECK_OR_ENOSYS(mlibc::sys_tcflush, -1); -+ if(int e = mlibc::sys_tcflush(fd, queue_selector); e) { -+ errno = e; -+ return -1; -+ } -+ return 0; -+ - } - - int tcgetattr(int fd, struct termios *attr) { -diff --git mlibc-clean/options/posix/include/mlibc/posix-sysdeps.hpp mlibc-workdir/options/posix/include/mlibc/posix-sysdeps.hpp -index 0917fe1..a6d975c 100644 ---- mlibc-clean/options/posix/include/mlibc/posix-sysdeps.hpp -+++ mlibc-workdir/options/posix/include/mlibc/posix-sysdeps.hpp -@@ -141,6 +141,7 @@ int sys_vm_unmap(void *pointer, size_t size); - [[gnu::weak]] int sys_tcgetattr(int fd, struct termios *attr); - [[gnu::weak]] int sys_tcsetattr(int, int, const struct termios *attr); - [[gnu::weak]] int sys_tcflow(int, int); -+[[gnu::weak]] int sys_tcflush(int, int); - [[gnu::weak]] int sys_tcdrain(int); - [[gnu::weak]] int sys_pipe(int *fds, int flags); - [[gnu::weak]] int sys_socketpair(int domain, int type_and_flags, int proto, int *fds); diff --git mlibc-workdir/sysdeps/astral/crt-x86_64/crt0.S mlibc-workdir/sysdeps/astral/crt-x86_64/crt0.S new file mode 100644 index 0000000..0a0a4a0 @@ -841,9 +806,10 @@ index 0000000..f45b716 + 'include/abi-bits/access.h', + 'include/abi-bits/wait.h', + 'include/abi-bits/utsname.h', -+ 'include/abi-bits/limits.h', -+ 'include/abi-bits/shm.h', -+ 'include/abi-bits/epoll.h', ++ 'include/abi-bits/limits.h', ++ 'include/abi-bits/shm.h', ++ 'include/abi-bits/epoll.h', ++ 'include/abi-bits/ioctls.h', + subdir: 'abi-bits' + ) +endif diff --git a/recipes/coreutils b/recipes/coreutils index 0b818d74..c3315b6d 100644 --- a/recipes/coreutils +++ b/recipes/coreutils @@ -6,19 +6,14 @@ hostdeps="gcc-cross binutils-cross" deps="mlibc" configure() { - - CFLAGS="-DSLOW_BUT_NO_HACKS $CFLAGS" ${source_dir}/configure --host=x86_64-astral --prefix=${prefix} - + cp -pr ${source_dir}/* . + CFLAGS="-DSLOW_BUT_NO_HACKS $CFLAGS" ./configure --host=x86_64-astral --prefix=${prefix} } build() { - make -j ${parallelism} - } install() { - make install DESTDIR=${dest_dir} - } diff --git a/recipes/cxxshim b/recipes/cxxshim new file mode 100644 index 00000000..e9de2dbb --- /dev/null +++ b/recipes/cxxshim @@ -0,0 +1,19 @@ +name=cxxshim +from_source=cxxshim +revision=1 +hostdeps="gcc-cross binutils-cross" +imagedeps="meson ninja base-devel" + + +configure() { + meson --cross-file ${base_dir}/util/crossfile --prefix=${prefix} -Dinstall_headers=true ${source_dir} +} + +build() { + ninja +} + +install() { + DESTDIR=${dest_dir} ninja install +} + diff --git a/recipes/doomgeneric b/recipes/doomgeneric index d0486025..6dc99bfb 100644 --- a/recipes/doomgeneric +++ b/recipes/doomgeneric @@ -7,18 +7,14 @@ deps="mlibc" configure() { - - true - + cp -rp ${source_dir}/doomgeneric/* . } build() { - - make -C ${source_dir}/doomgeneric - + make } install() { mkdir -p ${dest_dir}/usr/bin - cp -f ${source_dir}/doomgeneric/doomgeneric ${dest_dir}/usr/bin/doomgeneric + cp -f doomgeneric ${dest_dir}/usr/bin/doomgeneric } diff --git a/recipes/frigg b/recipes/frigg new file mode 100644 index 00000000..d12d369d --- /dev/null +++ b/recipes/frigg @@ -0,0 +1,18 @@ +name=frigg +from_source=frigg +revision=1 +hostdeps="gcc-cross binutils-cross" +imagedeps="meson ninja base-devel" + +configure() { + meson --cross-file ${base_dir}/util/crossfile --prefix=${prefix} -Dbuild_tests=disabled ${source_dir} +} + +build() { + ninja +} + +install() { + DESTDIR=${dest_dir} ninja install +} + diff --git a/recipes/linux-headers b/recipes/linux-headers new file mode 100644 index 00000000..3313d040 --- /dev/null +++ b/recipes/linux-headers @@ -0,0 +1,16 @@ +name=linux-headers +from_source=linux +revision=1 +imagedeps="base-devel rsync" + +configure() { + cp -r ${source_dir}/* . +} + +build() { + true +} + +install() { + make headers_install ARCH=x86_64 INSTALL_HDR_PATH=${dest_dir}/${prefix}/ +} diff --git a/recipes/mlibc b/recipes/mlibc index f7e2001c..cfb39a45 100644 --- a/recipes/mlibc +++ b/recipes/mlibc @@ -1,19 +1,17 @@ name=mlibc from_source=mlibc revision=1 -hostdeps="gcc-cross binutils-cross" +hostdeps="gcc-cross binutils-cross pkgconfig" +deps="cxxshim frigg linux-headers" imagedeps="meson ninja git base-devel binutils" -allow_network="yes" configure() { - meson --cross-file ${base_dir}/util/crossfile --prefix=${prefix} ${source_dir} + meson --cross-file ${base_dir}/util/crossfile -Dlinux_kernel_headers=${sysroot_dir}/${prefix}/include --prefix=${prefix} ${source_dir} } build() { - ninja - } install() { diff --git a/recipes/mlibc-headers b/recipes/mlibc-headers index 76bb3e58..a83749dc 100644 --- a/recipes/mlibc-headers +++ b/recipes/mlibc-headers @@ -1,10 +1,11 @@ name=mlibc-headers from_source=mlibc revision=1 +deps="linux-headers" imagedeps="ninja meson base-devel" configure() { - meson --cross-file ${base_dir}/util/crossfile --prefix=${prefix} -Dheaders_only=true ${source_dir} + meson --cross-file ${base_dir}/util/crossfile --prefix=${prefix} -Dlinux_kernel_headers=${sysroot}/${prefix} -Dheaders_only=true ${source_dir} } build() { diff --git a/recipes/mpfr b/recipes/mpfr index 0d34318f..fd9f9a47 100644 --- a/recipes/mpfr +++ b/recipes/mpfr @@ -7,8 +7,8 @@ deps="mlibc gmp" configure() { - - ${source_dir}/configure --host=x86_64-astral --prefix=${prefix} + cp -pr ${source_dir}/* . + ./configure --host=x86_64-astral --prefix=${prefix} } diff --git a/source-recipes/cxxshim b/source-recipes/cxxshim new file mode 100644 index 00000000..39d8b3c9 --- /dev/null +++ b/source-recipes/cxxshim @@ -0,0 +1,9 @@ +name=cxxshim +version=1abc678c17a8b54bf9497065443c1d4b292accb9 +source_method=tarball +tarball_url="https://github.com/managarm/cxxshim/archive/${version}.tar.gz" +tarball_sha512=5455acb3854ab163523c02da1651a8d94eb804e48bb43a6ecbb75cf6f9b2bd857aa21f5c0316865a4f16406566c62a660d605603cc7335abf63983575957b7de + +regenerate() { + true +} diff --git a/source-recipes/frigg b/source-recipes/frigg new file mode 100644 index 00000000..5aa9433e --- /dev/null +++ b/source-recipes/frigg @@ -0,0 +1,9 @@ +name=frigg +version=b3ac9595b278240cf5b67e9c349a9787a82ce02b +source_method=tarball +tarball_url="https://github.com/managarm/frigg/archive/${version}.tar.gz" +tarball_sha512=1e5b225122d73ed01a1274598fc8a441204d1451650b0bba2b207f9e810312b6c4c19026340d85118663a7013cc471b1cc913668c843a037b73da65c23269c41 + +regenerate() { + true +} diff --git a/source-recipes/libtool b/source-recipes/libtool index 5369c5ab..21f4125e 100644 --- a/source-recipes/libtool +++ b/source-recipes/libtool @@ -3,7 +3,8 @@ version=2.4.7 source_method=tarball tarball_url="https://ftp.gnu.org/gnu/libtool/libtool-${version}.tar.gz" tarball_sha512=a -imagedeps="autoconf automake base-devel help2man wget" +hostdeps="autoconf automake" +imagedeps="base-devel help2man wget" allow_network="yes" regenerate() { diff --git a/source-recipes/linux b/source-recipes/linux new file mode 100644 index 00000000..8ea70dfa --- /dev/null +++ b/source-recipes/linux @@ -0,0 +1,9 @@ +name=linux +version=6.1.22 +source_method=tarball +tarball_url="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${version}.tar.xz" +tarball_sha512=9db5360c85a2e8c7d1a3a37e0d79dafe3561566e098394a15e8cb48929a7afa74b203d3d67c286a8ddb4359a0ba8d45f33678219f9ccb8f728d1c4d4455fd27f + +regenerate() { + true +} diff --git a/source-recipes/mlibc b/source-recipes/mlibc index 5a03aaf0..67ce15d5 100644 --- a/source-recipes/mlibc +++ b/source-recipes/mlibc @@ -1,8 +1,8 @@ name=mlibc -version=3.0.0-rc1 +version=e94df5bc67e850b94a47e9b47978756e0b921f33 source_method=tarball -tarball_url="https://github.com/managarm/mlibc/archive/refs/tags/${version}.tar.gz" -tarball_sha512=79d84d23d3b62e991bc89af6782123e1fa2b6b0923dd79fd71a6b007842e3b580c01afcdd601948e974b9e95f1336e5d53834a51493aee4c6afc7be133ab392c +tarball_url="https://github.com/managarm/mlibc/archive/${version}.tar.gz" +tarball_sha512=27aba51157490d47d01a92d675d91b1cf79c05a562787a63a032a0ef407d063b3dd2dff7ce2a1e76e460a2225b051103eba9c5590230e79459d15a43fbbfe8c2 hostdeps="" regenerate() {