Compare commits
8 Commits
2a16a67aed
...
8c569ac7bf
Author | SHA1 | Date |
---|---|---|
|
8c569ac7bf | |
|
a84fb57e32 | |
|
7314d2b577 | |
|
ba83ede0d1 | |
|
42500ce043 | |
|
caa8c1da90 | |
|
cbcb9f9044 | |
|
60bffb5f49 |
|
@ -1917,16 +1917,13 @@ namespace Kernel
|
|||
switch (clock_id)
|
||||
{
|
||||
case CLOCK_MONOTONIC:
|
||||
{
|
||||
*tp = SystemTimer::get().time_since_boot();
|
||||
break;
|
||||
}
|
||||
case CLOCK_REALTIME:
|
||||
{
|
||||
*tp = SystemTimer::get().real_time();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
dwarnln("TODO: clock_gettime({})", clock_id);
|
||||
return BAN::Error::from_errno(ENOTSUP);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='binutils'
|
||||
VERSION='2.39'
|
||||
DOWNLOAD_URL="https://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.gz#d12ea6f239f1ffe3533ea11ad6e224ffcb89eb5d01bbea589e9158780fa11f10"
|
||||
DEPENDENCIES=('zlib')
|
||||
CONFIGURE_OPTIONS=(
|
||||
"--target=$BANAN_TOOLCHAIN_TRIPLE"
|
||||
'--with-sysroot=/'
|
||||
"--with-build-sysroot=$BANAN_SYSROOT"
|
||||
'--enable-initfini-array'
|
||||
'--enable-shared'
|
||||
'--enable-lto'
|
||||
'--disable-nls'
|
||||
'--disable-werror'
|
||||
)
|
||||
|
||||
build() {
|
||||
# This file is not even used. binutils just requires it to exist
|
||||
touch "$BANAN_SYSROOT/usr/include/memory.h"
|
||||
|
||||
make -j$(nproc) || exit 1
|
||||
find . -type f -executable -exec strip --strip-unneeded {} + 2>/dev/null
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
../../../toolchain/binutils-2.39.patch
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='gcc'
|
||||
VERSION='12.2.0'
|
||||
DOWNLOAD_URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.gz#ac6b317eb4d25444d87cf29c0d141dedc1323a1833ec9995211b13e1a851261c"
|
||||
DEPENDENCIES=('binutils' 'gmp' 'mpfr' 'mpc')
|
||||
CONFIGURE_OPTIONS=(
|
||||
"--target=$BANAN_TOOLCHAIN_TRIPLE"
|
||||
'--with-sysroot=/'
|
||||
"--with-build-sysroot=$BANAN_SYSROOT"
|
||||
'--enable-initfini-array'
|
||||
'--enable-shared'
|
||||
'--enable-lto'
|
||||
'--disable-nls'
|
||||
'--enable-languages=c,c++'
|
||||
)
|
||||
|
||||
build() {
|
||||
make -j$(nproc) all-gcc || exit 1
|
||||
make -j$(nproc) all-target-libgcc || exit 1
|
||||
make -j$(nproc) all-target-libstdc++-v3 || exit 1
|
||||
find . -type f -executable -exec strip --strip-unneeded {} + 2>/dev/null
|
||||
}
|
||||
|
||||
install() {
|
||||
make install-gcc DESTDIR="$BANAN_SYSROOT" || exit 1
|
||||
make install-target-libgcc DESTDIR="$BANAN_SYSROOT" || exit 1
|
||||
make install-target-libstdc++-v3 DESTDIR="$BANAN_SYSROOT" || exit 1
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
diff -ruN gcc-12.2.0/gcc/configure gcc-12.2.0-banan_os/gcc/configure
|
||||
--- gcc-12.2.0/gcc/configure 2022-08-19 11:09:52.736664469 +0300
|
||||
+++ gcc-12.2.0-banan_os/gcc/configure 2024-08-08 09:30:58.730876253 +0300
|
||||
@@ -9426,6 +9426,7 @@
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
|
||||
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
|
||||
+ac_cv_c_bigendian=no
|
||||
if ${ac_cv_c_bigendian+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
|
@ -0,0 +1 @@
|
|||
../../../toolchain/gcc-12.2.0.patch
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='gmp'
|
||||
VERSION='6.3.0'
|
||||
DOWNLOAD_URL="https://ftp.gnu.org/gnu/gmp/gmp-$VERSION.tar.xz#a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898"
|
|
@ -0,0 +1,12 @@
|
|||
diff -ruN gmp-6.3.0/configfsf.sub gmp-6.3.0-banan_os/configfsf.sub
|
||||
--- gmp-6.3.0/configfsf.sub 2023-07-29 16:42:16.000000000 +0300
|
||||
+++ gmp-6.3.0-banan_os/configfsf.sub 2024-08-07 21:37:12.147551767 +0300
|
||||
@@ -1759,7 +1759,7 @@
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
- | fiwix* | mlibc* )
|
||||
+ | fiwix* | mlibc* | banan_os* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='mpc'
|
||||
VERSION='1.3.1'
|
||||
DOWNLOAD_URL="https://ftp.gnu.org/gnu/mpc/mpc-$VERSION.tar.gz#ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8"
|
||||
DEPENDENCIES=('gmp' 'mpfr')
|
||||
CONFIGURE_OPTIONS=(
|
||||
"--target=$BANAN_TOOLCHAIN_TRIPLE"
|
||||
"--with-sysroot=$BANAN_SYSROOT"
|
||||
)
|
|
@ -0,0 +1,13 @@
|
|||
diff -ruN mpc-1.3.1/build-aux/config.sub mpc-1.3.1-banan_os/build-aux/config.sub
|
||||
--- mpc-1.3.1/build-aux/config.sub 2022-12-08 14:23:21.000000000 +0200
|
||||
+++ mpc-1.3.1-banan_os/build-aux/config.sub 2024-08-07 22:52:40.072912471 +0300
|
||||
@@ -1748,7 +1748,8 @@
|
||||
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
|
||||
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
+ | banan_os* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='mpfr'
|
||||
VERSION='4.2.1'
|
||||
DOWNLOAD_URL="https://ftp.gnu.org/gnu/mpfr/mpfr-$VERSION.tar.gz#116715552bd966c85b417c424db1bbdf639f53836eb361549d1f8d6ded5cb4c6"
|
||||
DEPENDENCIES=('gmp')
|
||||
CONFIGURE_OPTIONS=(
|
||||
"--target=$BANAN_TOOLCHAIN_TRIPLE"
|
||||
'--with-sysroot=/'
|
||||
)
|
|
@ -0,0 +1,12 @@
|
|||
diff -ruN mpfr-4.2.1/config.sub mpfr-4.2.1-banan_os/config.sub
|
||||
--- mpfr-4.2.1/config.sub 2023-08-22 10:47:14.000000000 +0300
|
||||
+++ mpfr-4.2.1-banan_os/config.sub 2024-08-07 22:48:27.798804026 +0300
|
||||
@@ -1754,7 +1754,7 @@
|
||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||
- | fiwix* )
|
||||
+ | fiwix* | banan_os* )
|
||||
;;
|
||||
# This one is extra strict with allowed versions
|
||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
|
@ -61,3 +61,17 @@ int getrusage(int who, struct rusage* r_usage)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setrlimit(int resource, const struct rlimit* rlp)
|
||||
{
|
||||
dwarnln("TODO: setrlimit({}, {})", resource, rlp);
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int setpriority(int which, id_t who, int value)
|
||||
{
|
||||
dwarnln("TODO: setpriority({}, {}, {})", which, who, value);
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -20,8 +20,11 @@ int nanosleep(const struct timespec* rqtp, struct timespec* rmtp)
|
|||
|
||||
clock_t clock(void)
|
||||
{
|
||||
dwarnln("TODO: clock");
|
||||
return -1;
|
||||
timespec ts;
|
||||
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == -1)
|
||||
return -1;
|
||||
return ((uint64_t)ts.tv_sec * CLOCKS_PER_SEC)
|
||||
+ ((uint64_t)ts.tv_nsec * CLOCKS_PER_SEC / 1'000'000'000);
|
||||
}
|
||||
|
||||
time_t time(time_t* tloc)
|
||||
|
|
Loading…
Reference in New Issue