userland: bump mlibc, gcc, binutils, etc

This commit is contained in:
Matheus
2025-12-06 18:47:55 -03:00
parent a32d8bfbf1
commit 9c1c363df4
37 changed files with 763 additions and 1063 deletions
+1 -1
View File
@@ -13,5 +13,5 @@ build() {
package(){
cd ${base_dir}/build-${JINX_ARCH}/host-builds/xgcc
make DESTDIR="${dest_dir}" install-target-libstdc++-v3
rm -rf ${dest_dir}/usr/local/lib/gcc/x86_64-astral/12.1.0/
rm -rf ${dest_dir}/usr/local/lib/gcc/x86_64-astral/14.3.0/
}
@@ -11,6 +11,18 @@ index 2056424..e93f8bd 100644
BUILD_CC = @BUILD_CC@
AR = @AR@
diff --git ace-of-penguins-clean/lib/imagelib.c ace-of-penguins-workdir/lib/imagelib.c
index f71b96a..49c7545 100644
--- ace-of-penguins-clean/lib/imagelib.c
+++ ace-of-penguins-workdir/lib/imagelib.c
@@ -2,6 +2,7 @@
#include <string.h>
#include "imagelib.h"
#include "cards.h"
+#include <stdlib.h>
image_list *image_root = 0;
diff --git ace-of-penguins-clean/lib/make-imglib.c ace-of-penguins-workdir/lib/make-imglib.c
index 84cda12..8f12d4a 100644
--- ace-of-penguins-clean/lib/make-imglib.c
+72 -96
View File
@@ -1,34 +1,36 @@
diff -ruN binutils-2.39/bfd/config.bfd binutils-2.39-patched/bfd/config.bfd
--- binutils-2.39/bfd/config.bfd 2022-07-08 06:46:47.000000000 -0300
+++ binutils-2.39-patched/bfd/config.bfd 2022-08-07 18:29:37.305269269 -0300
@@ -695,6 +695,11 @@
diff --git binutils-clean/bfd/config.bfd binutils-workdir/bfd/config.bfd
index 4e5a838..d59805f 100644
--- binutils-clean/bfd/config.bfd
+++ binutils-workdir/bfd/config.bfd
@@ -705,6 +705,11 @@ case "${targ}" in
targ_selvecs="i386_elf32_vec"
want64=true
;;
+ x86_64-*-astral*)
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs=i386_elf32_vec
+ targ_selvecs="i386_elf32_vec"
+ want64=true
+ ;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
targ_defvec=x86_64_elf64_vec
targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pe_vec x86_64_pei_vec"
diff -ruN binutils-2.39/config.sub binutils-2.39-patched/config.sub
--- binutils-2.39/config.sub 2022-07-08 06:46:47.000000000 -0300
+++ binutils-2.39-patched/config.sub 2022-08-07 18:26:48.218610095 -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* | astral* )
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
diff -ruN binutils-2.39/gas/configure.tgt binutils-2.39-patched/gas/configure.tgt
--- binutils-2.39/gas/configure.tgt 2022-07-08 06:46:47.000000000 -0300
+++ binutils-2.39-patched/gas/configure.tgt 2022-08-07 18:31:46.391930215 -0300
@@ -221,6 +221,7 @@
diff --git binutils-clean/config.sub binutils-workdir/config.sub
index 4aaae46..7ddc8a7 100755
--- binutils-clean/config.sub
+++ binutils-workdir/config.sub
@@ -2108,6 +2108,7 @@ case $os in
| skyos* \
| solaris* \
| solidbsd* \
+ | astral* \
| sortix* \
| storm-chaos* \
| sunos \
diff --git binutils-clean/gas/configure.tgt binutils-workdir/gas/configure.tgt
index 7c81bff..81855f0 100644
--- binutils-clean/gas/configure.tgt
+++ binutils-workdir/gas/configure.tgt
@@ -225,6 +225,7 @@ case ${generic_target} in
h8300-*-elf) fmt=elf ;;
h8300-*-linux*) fmt=elf em=linux ;;
@@ -36,40 +38,11 @@ diff -ruN binutils-2.39/gas/configure.tgt binutils-2.39-patched/gas/configure.tg
i386-*-beospe*) fmt=coff em=pe ;;
i386-*-beos*) fmt=elf ;;
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
diff -ruN binutils-2.39/ld/configure.tgt binutils-2.39-patched/ld/configure.tgt
--- binutils-2.39/ld/configure.tgt 2022-07-29 04:37:48.000000000 -0300
+++ binutils-2.39-patched/ld/configure.tgt 2022-08-07 18:34:19.615256758 -0300
@@ -986,6 +986,10 @@
;;
visium-*-elf) targ_emul=elf32visium
;;
+x86_64-*-astral*)
+ targ_emul=elf_x86_64_astral
+ targ_extra_emuls="elf_i386_astral elf_x86_64 elf_i386"
+ ;;
x86_64-*-rdos*) targ_emul=elf64rdos
;;
x86_64-*-cloudabi*) targ_emul=elf_x86_64_cloudabi
diff -ruN binutils-2.39/ld/emulparams/elf_i386_astral.sh binutils-2.39-patched/ld/emulparams/elf_i386_astral.sh
--- binutils-2.39/ld/emulparams/elf_i386_astral.sh 1969-12-31 21:00:00.000000000 -0300
+++ binutils-2.39-patched/ld/emulparams/elf_i386_astral.sh 2022-08-07 19:16:14.135145355 -0300
@@ -0,0 +1,4 @@
+source_sh ${srcdir}/emulparams/elf_i386.sh
+TEXT_START_ADDR=0x10000000
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
diff -ruN binutils-2.39/ld/emulparams/elf_x86_64_astral.sh binutils-2.39-patched/ld/emulparams/elf_x86_64_astral.sh
--- binutils-2.39/ld/emulparams/elf_x86_64_astral.sh 1969-12-31 21:00:00.000000000 -0300
+++ binutils-2.39-patched/ld/emulparams/elf_x86_64_astral.sh 2022-08-07 18:36:20.838584720 -0300
@@ -0,0 +1,4 @@
+source_sh ${srcdir}/emulparams/elf_x86_64.sh
+TEXT_START_ADDR=0x10000000
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
diff -ruN binutils-2.39/ld/Makefile.am binutils-2.39-patched/ld/Makefile.am
--- binutils-2.39/ld/Makefile.am 2022-07-08 06:46:48.000000000 -0300
+++ binutils-2.39-patched/ld/Makefile.am 2022-08-07 19:17:46.965141264 -0300
@@ -275,6 +275,7 @@
diff --git binutils-clean/ld/Makefile.am binutils-workdir/ld/Makefile.am
index ccff928..148be5b 100644
--- binutils-clean/ld/Makefile.am
+++ binutils-workdir/ld/Makefile.am
@@ -277,6 +277,7 @@ ALL_EMULATION_SOURCES = \
eelf32xtensa.c \
eelf32z80.c \
eelf_i386.c \
@@ -77,7 +50,7 @@ diff -ruN binutils-2.39/ld/Makefile.am binutils-2.39-patched/ld/Makefile.am
eelf_i386_be.c \
eelf_i386_fbsd.c \
eelf_i386_haiku.c \
@@ -453,6 +454,7 @@
@@ -459,6 +460,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64tilegx_be.c \
eelf_mipsel_haiku.c \
eelf_x86_64.c \
@@ -85,26 +58,11 @@ diff -ruN binutils-2.39/ld/Makefile.am binutils-2.39-patched/ld/Makefile.am
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_haiku.c \
@@ -766,6 +768,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_astral.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_haiku.Pc@am__quote@
@@ -941,6 +944,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_astral.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_fbsd.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_haiku.Pc@am__quote@
diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
--- binutils-2.39/ld/Makefile.in 2022-08-05 06:56:53.000000000 -0300
+++ binutils-2.39-patched/ld/Makefile.in 2022-08-07 19:17:51.741807718 -0300
@@ -529,6 +529,7 @@
diff --git binutils-clean/ld/Makefile.in binutils-workdir/ld/Makefile.in
index 3e24bd4..869875f 100644
--- binutils-clean/ld/Makefile.in
+++ binutils-workdir/ld/Makefile.in
@@ -543,6 +543,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
@@ -112,7 +70,7 @@ diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -772,6 +773,7 @@
@@ -788,6 +789,7 @@ ALL_EMULATION_SOURCES = \
eelf32xtensa.c \
eelf32z80.c \
eelf_i386.c \
@@ -120,7 +78,7 @@ diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
eelf_i386_be.c \
eelf_i386_fbsd.c \
eelf_i386_haiku.c \
@@ -949,6 +951,7 @@
@@ -969,6 +971,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64tilegx_be.c \
eelf_mipsel_haiku.c \
eelf_x86_64.c \
@@ -128,7 +86,7 @@ diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_haiku.c \
@@ -1441,6 +1444,7 @@
@@ -1476,6 +1479,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Po@am__quote@
@@ -136,7 +94,7 @@ diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_haiku.Po@am__quote@
@@ -1451,6 +1455,7 @@
@@ -1486,6 +1490,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_s390.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Po@am__quote@
@@ -144,19 +102,37 @@ diff -ruN binutils-2.39/ld/Makefile.in binutils-2.39-patched/ld/Makefile.in
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_haiku.Po@am__quote@
@@ -2432,6 +2437,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xtensa.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32z80.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_astral.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_haiku.Pc@am__quote@
@@ -2607,6 +2613,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_astral.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_fbsd.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_haiku.Pc@am__quote@
diff --git binutils-clean/ld/configure.tgt binutils-workdir/ld/configure.tgt
index ea01ccf..3bcd521 100644
--- binutils-clean/ld/configure.tgt
+++ binutils-workdir/ld/configure.tgt
@@ -998,6 +998,9 @@ vax-*-linux-*) targ_emul=elf32vax
;;
visium-*-elf) targ_emul=elf32visium
;;
+x86_64-*-astral*) targ_emul=elf_x86_64_astral
+ targ_extra_emuls="elf_i386_astral elf_x86_64 elf_i386"
+ ;;
x86_64-*-rdos*) targ_emul=elf64rdos
;;
x86_64-*-cloudabi*) targ_emul=elf_x86_64_cloudabi
diff --git binutils-workdir/ld/emulparams/elf_i386_astral.sh binutils-workdir/ld/emulparams/elf_i386_astral.sh
new file mode 100644
index 0000000..926c55b
--- /dev/null
+++ binutils-workdir/ld/emulparams/elf_i386_astral.sh
@@ -0,0 +1,4 @@
+source ${srcdir}/emulparams/elf_i386.sh
+TEXT_START_ADDR=0x10000000
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
diff --git binutils-workdir/ld/emulparams/elf_x86_64_astral.sh binutils-workdir/ld/emulparams/elf_x86_64_astral.sh
new file mode 100644
index 0000000..0d72b44
--- /dev/null
+++ binutils-workdir/ld/emulparams/elf_x86_64_astral.sh
@@ -0,0 +1,4 @@
+source ${srcdir}/emulparams/elf_x86_64.sh
+TEXT_START_ADDR=0x10000000
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+20
View File
@@ -0,0 +1,20 @@
diff --git curl-clean/src/tool_filetime.c curl-workdir/src/tool_filetime.c
index 1311388..15fd8dc 100644
--- curl-clean/src/tool_filetime.c
+++ curl-workdir/src/tool_filetime.c
@@ -132,15 +132,6 @@ void setfiletime(curl_off_t filetime, const char *filename,
filetime, (unsigned int)GetLastError());
}
-#elif defined(HAVE_UTIMES)
- struct timeval times[2];
- times[0].tv_sec = times[1].tv_sec = (time_t)filetime;
- times[0].tv_usec = times[1].tv_usec = 0;
- if(utimes(filename, times)) {
- warnf(global, "Failed to set filetime %" CURL_FORMAT_CURL_OFF_T
- " on '%s': %s", filetime, filename, strerror(errno));
- }
-
#elif defined(HAVE_UTIME)
struct utimbuf times;
times.actime = (time_t)filetime;
+17 -17
View File
@@ -12,7 +12,7 @@ index 38f3d03..ee981b0 100755
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
diff --git gcc-clean/fixincludes/mkfixinc.sh gcc-workdir/fixincludes/mkfixinc.sh
index df90720..aebfb82 100755
index 7112f4d..0acd4a7 100755
--- gcc-clean/fixincludes/mkfixinc.sh
+++ gcc-workdir/fixincludes/mkfixinc.sh
@@ -11,6 +11,8 @@ target=fixinc.sh
@@ -22,11 +22,11 @@ index df90720..aebfb82 100755
+ *-astral* | \
+ *-*-astral* | \
i?86-*-cygwin* | \
i?86-*-mingw32* | \
x86_64-*-mingw32* | \
*-mingw32* | \
powerpc-*-eabisim* | \
diff --git gcc-workdir/gcc/config/astral.h gcc-workdir/gcc/config/astral.h
new file mode 100644
index 0000000..fe6e2e1
index 0000000..1768e2c
--- /dev/null
+++ gcc-workdir/gcc/config/astral.h
@@ -0,0 +1,24 @@
@@ -55,12 +55,12 @@ index 0000000..fe6e2e1
+ builtin_assert ("system=posix"); \
+ } while(0);
diff --git gcc-clean/gcc/config.gcc gcc-workdir/gcc/config.gcc
index c5064dd..e151646 100644
index 087aaa7..f6f72a0 100644
--- gcc-clean/gcc/config.gcc
+++ gcc-workdir/gcc/config.gcc
@@ -773,6 +773,14 @@ case ${target} in
tmake_file="${tmake_file} t-dragonfly"
target_has_targetdm=yes
@@ -826,6 +826,14 @@ case ${target} in
rust_target_objs="${rust_target_objs} dragonfly-rust.o"
target_has_targetrustm=yes
;;
+*-*-astral*)
+ extra_options="$extra_options gnu-user.opt"
@@ -73,21 +73,21 @@ index c5064dd..e151646 100644
*-*-freebsd*)
# This is the generic ELF configuration of FreeBSD. Later
# machine-specific sections may refine and add to this
@@ -1087,6 +1095,9 @@ case ${target} in
@@ -1186,6 +1194,9 @@ case ${target} in
esac
case ${target} in
+x86_64-*-astral*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h astral.h gnu-user.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h astral.h gnu-user.h"
+ ;;
aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
tm_file="${tm_file} elfos.h newlib-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h"
diff --git gcc-clean/libgcc/config.host gcc-workdir/libgcc/config.host
index 8c56fca..aecb1da 100644
index 6a88ee5..c54151b 100644
--- gcc-clean/libgcc/config.host
+++ gcc-workdir/libgcc/config.host
@@ -751,6 +751,10 @@ i[34567]86-*-openbsd*)
@@ -793,6 +793,10 @@ i[34567]86-*-openbsd*)
;;
x86_64-*-openbsd*)
;;
@@ -99,7 +99,7 @@ index 8c56fca..aecb1da 100644
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
diff --git gcc-clean/libgcc/libgcov.h gcc-workdir/libgcc/libgcov.h
index 40e845c..cbe95b8 100644
index 3d7d52a..cd9d819 100644
--- gcc-clean/libgcc/libgcov.h
+++ gcc-workdir/libgcc/libgcov.h
@@ -25,6 +25,8 @@
@@ -112,10 +112,10 @@ index 40e845c..cbe95b8 100644
#ifndef xmalloc
#define xmalloc malloc
diff --git gcc-clean/libstdc++-v3/configure.ac gcc-workdir/libstdc++-v3/configure.ac
index e59bcdb..c2ac19b 100644
index a6c01b2..9e2faad 100644
--- gcc-clean/libstdc++-v3/configure.ac
+++ gcc-workdir/libstdc++-v3/configure.ac
@@ -118,7 +118,7 @@ fi
@@ -134,7 +134,7 @@ fi
# Use glibcxx_compiler_pic_flag to designate a compile-time flags for
# creating position-independent objects. This varies with the target
# hardware and operating system, but is often: -DPIC -fPIC.
@@ -125,7 +125,7 @@ index e59bcdb..c2ac19b 100644
glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX"
glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED"
diff --git gcc-clean/libstdc++-v3/crossconfig.m4 gcc-workdir/libstdc++-v3/crossconfig.m4
index ae5283b..15d769e 100644
index b3269cb..a5d4014 100644
--- gcc-clean/libstdc++-v3/crossconfig.m4
+++ gcc-workdir/libstdc++-v3/crossconfig.m4
@@ -8,7 +8,12 @@ case "${host}" in
+12 -2
View File
@@ -1,7 +1,17 @@
diff -urN --no-dereference libffi-clean/src/closures.c libffi-workdir/src/closures.c
diff --git libffi-clean/src/closures.c libffi-workdir/src/closures.c
index f7bead6..5a41ff1 100644
--- libffi-clean/src/closures.c
+++ libffi-workdir/src/closures.c
@@ -139,6 +139,9 @@
@@ -27,7 +27,7 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#if defined __linux__ && !defined _GNU_SOURCE
+#if (defined __linux__ || defined __astral__) && !defined _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
@@ -139,6 +139,9 @@ ffi_tramp_is_present (__attribute__((unused)) void *ptr)
executable memory. */
# define FFI_MMAP_EXEC_WRIT 1
# endif
+131 -63
View File
@@ -1,4 +1,5 @@
diff -urN --no-dereference lwjgl3-clean/build.xml lwjgl3-workdir/build.xml
diff --git lwjgl3-clean/build.xml lwjgl3-workdir/build.xml
index d0fad82..1f162b5 100644
--- lwjgl3-clean/build.xml
+++ lwjgl3-workdir/build.xml
@@ -1181,6 +1181,7 @@
@@ -156,8 +157,10 @@ diff -urN --no-dereference lwjgl3-clean/build.xml lwjgl3-workdir/build.xml
</natives>
</release-module>
diff -urN --no-dereference lwjgl3-clean/config/astral/build.xml lwjgl3-workdir/config/astral/build.xml
--- lwjgl3-clean/config/astral/build.xml 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/config/astral/build.xml lwjgl3-workdir/config/astral/build.xml
new file mode 100644
index 0000000..323791d
--- /dev/null
+++ lwjgl3-workdir/config/astral/build.xml
@@ -0,0 +1,482 @@
+<!--
@@ -642,8 +645,10 @@ diff -urN --no-dereference lwjgl3-clean/config/astral/build.xml lwjgl3-workdir/c
+ </sequential>
+ </target>
+</project>
diff -urN --no-dereference lwjgl3-clean/config/astral/version.script lwjgl3-workdir/config/astral/version.script
--- lwjgl3-clean/config/astral/version.script 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/config/astral/version.script lwjgl3-workdir/config/astral/version.script
new file mode 100644
index 0000000..10108e1
--- /dev/null
+++ lwjgl3-workdir/config/astral/version.script
@@ -0,0 +1,9 @@
+LWJGL {
@@ -655,10 +660,11 @@ diff -urN --no-dereference lwjgl3-clean/config/astral/version.script lwjgl3-work
+ # Hide everything else
+ local: *;
+};
diff -urN --no-dereference lwjgl3-clean/config/build-definitions.xml lwjgl3-workdir/config/build-definitions.xml
diff --git lwjgl3-clean/config/build-definitions.xml lwjgl3-workdir/config/build-definitions.xml
index 6fc8796..36f0d9f 100644
--- lwjgl3-clean/config/build-definitions.xml
+++ lwjgl3-workdir/config/build-definitions.xml
@@ -120,10 +120,14 @@
@@ -120,10 +120,14 @@ This script is included in /build.xml and /config/update-dependencies.xml.
<condition property="platform.windows">
<os family="Windows"/>
</condition>
@@ -673,7 +679,7 @@ diff -urN --no-dereference lwjgl3-clean/config/build-definitions.xml lwjgl3-work
<property name="platform.remote" value="macosx" if:set="platform.macos"/>
<property name="platform.remote" value="${platform}"/>
@@ -131,6 +135,7 @@
@@ -131,6 +135,7 @@ This script is included in /build.xml and /config/update-dependencies.xml.
<property name="platform.linux.remote" value="linux"/>
<property name="platform.macos.remote" value="macosx"/>
<property name="platform.windows.remote" value="windows"/>
@@ -681,10 +687,11 @@ diff -urN --no-dereference lwjgl3-clean/config/build-definitions.xml lwjgl3-work
<property name="lib.native" location="${lib}/native/${platform}/${build.arch}" relative="true"/>
diff -urN --no-dereference lwjgl3-clean/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt lwjgl3-workdir/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt
diff --git lwjgl3-clean/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt lwjgl3-workdir/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt
index c4acc53..24dec9f 100644
--- lwjgl3-clean/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt
+++ lwjgl3-workdir/modules/generator/src/main/kotlin/org/lwjgl/generator/Modules.kt
@@ -55,6 +55,11 @@
@@ -55,6 +55,11 @@ enum class Module(
"Contains bindings to native APIs specific to the Windows operating system.",
CallingConvention.STDCALL
),
@@ -696,15 +703,17 @@ diff -urN --no-dereference lwjgl3-clean/modules/generator/src/main/kotlin/org/lw
ASSIMP(
"assimp",
@@ -988,4 +993,4 @@
@@ -988,4 +993,4 @@ private class JNILibraryWithInit constructor(
}
}
-fun String.dependsOn(vararg modules: Module): String? = if (modules.any { it.enabled }) this else null
\ No newline at end of file
+fun String.dependsOn(vararg modules: Module): String? = if (modules.any { it.enabled }) this else null
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/c/astral/AstralConfig.h lwjgl3-workdir/modules/lwjgl/core/src/main/c/astral/AstralConfig.h
--- lwjgl3-clean/modules/lwjgl/core/src/main/c/astral/AstralConfig.h 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/main/c/astral/AstralConfig.h lwjgl3-workdir/modules/lwjgl/core/src/main/c/astral/AstralConfig.h
new file mode 100644
index 0000000..bc8eb8d
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/c/astral/AstralConfig.h
@@ -0,0 +1,18 @@
+/*
@@ -725,7 +734,21 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/c/astral/Ast
+// JNIEXPORT_CRITICAL & CRITICAL are used as a workaround for JDK-8167409 on applicable functions.
+#define JNIEXPORT_CRITICAL static
+#define CRITICAL(function) _JavaCritical_##function
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/c/common_tools.h lwjgl3-workdir/modules/lwjgl/core/src/main/c/common_tools.h
diff --git lwjgl3-clean/modules/lwjgl/core/src/main/c/common_tools.c lwjgl3-workdir/modules/lwjgl/core/src/main/c/common_tools.c
index 73cc397..4911a81 100644
--- lwjgl3-clean/modules/lwjgl/core/src/main/c/common_tools.c
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/c/common_tools.c
@@ -36,7 +36,7 @@ static inline void detachCurrentThread(void) {
}
static inline EnvData* createEnvData(jboolean async, JNIEnv* env) {
- EnvData* data = (EnvData*)calloc(sizeof(EnvData), 1);
+ EnvData* data = (EnvData*)calloc(1, sizeof(EnvData));
data->async = async;
data->env = env;
diff --git lwjgl3-clean/modules/lwjgl/core/src/main/c/common_tools.h lwjgl3-workdir/modules/lwjgl/core/src/main/c/common_tools.h
index 78799c9..16d6903 100644
--- lwjgl3-clean/modules/lwjgl/core/src/main/c/common_tools.h
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/c/common_tools.h
@@ -13,6 +13,9 @@
@@ -738,10 +761,11 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/c/common_too
DISABLE_WARNINGS()
#include <jni.h>
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java
diff --git lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java
index b502294..0aec2e9 100644
--- lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/APIUtil.java
@@ -9,6 +9,7 @@
@@ -9,6 +9,7 @@ import org.lwjgl.system.libffi.*;
import org.lwjgl.system.linux.*;
import org.lwjgl.system.macosx.*;
import org.lwjgl.system.windows.*;
@@ -749,7 +773,7 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwj
import javax.annotation.*;
import java.io.*;
@@ -128,6 +129,8 @@
@@ -128,6 +129,8 @@ public final class APIUtil {
return new LinuxLibrary(name);
case MACOSX:
return MacOSXLibrary.create(name);
@@ -758,20 +782,23 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwj
default:
throw new IllegalStateException();
}
@@ -669,4 +672,4 @@
@@ -669,4 +672,4 @@ public final class APIUtil {
public static void apiClosureRet(long ret, float __result) { memPutFloat(ret, __result); }
public static void apiClosureRet(long ret, double __result) { memPutDouble(ret, __result); }
-}
\ No newline at end of file
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java
diff --git lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java
index 1babac9..37e8476 100644
--- lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/Platform.java
@@ -47,6 +47,18 @@
return System.mapLibraryName(name);
@@ -45,6 +45,18 @@ public enum Platform {
return name;
}
+ return System.mapLibraryName(name);
+ }
+ },
+ ASTRAL("Astral", "astral") {
+ private final Pattern SO = Pattern.compile("(?:^|/)lib\\w+[.]so(?:[.]\\d+)*$");
@@ -782,12 +809,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwj
+ return name;
+ }
+
+ return System.mapLibraryName(name);
+ }
return System.mapLibraryName(name);
}
};
/** The architectures supported by LWJGL. */
@@ -87,6 +99,8 @@
@@ -87,6 +99,8 @@ public enum Platform {
current = LINUX;
} else if (osName.startsWith("Mac OS X") || osName.startsWith("Darwin")) {
current = MACOSX;
@@ -796,15 +821,17 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwj
} else {
throw new LinkageError("Unknown platform: " + osName);
}
@@ -169,4 +183,4 @@
@@ -169,4 +183,4 @@ public enum Platform {
}
}
-}
\ No newline at end of file
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java
--- lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java
new file mode 100644
index 0000000..021c3ab
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/main/java/org/lwjgl/system/astral/AstralLibrary.java
@@ -0,0 +1,54 @@
+/*
@@ -861,8 +888,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/main/java/org/lwj
+ }
+
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt
new file mode 100644
index 0000000..5294cf7
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/LinuxTypes.kt
@@ -0,0 +1,156 @@
+/*
@@ -1022,8 +1051,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ long_long("tv_nsec", "nanoseconds")
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt
new file mode 100644
index 0000000..f0e0f2a
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/WaylandTypes.kt
@@ -0,0 +1,11 @@
+/*
@@ -1038,8 +1069,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+val wl_output = "struct wl_output".opaque
+val wl_surface = "struct wl_surface".opaque
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt
new file mode 100644
index 0000000..37a534a
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XEvents.kt
@@ -0,0 +1,470 @@
+/*
@@ -1513,8 +1546,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ short("y", "the y coordinate of the pointer relative to the origin of the specified window")
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt
new file mode 100644
index 0000000..063b903
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/XTypes.kt
@@ -0,0 +1,79 @@
+/*
@@ -1597,8 +1632,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+val RROutput = typedef(XID, "RROutput")
+val RRCrtc = typedef(XID, "RRCrtc")
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt
new file mode 100644
index 0000000..eb8ecce
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/DynamicLinkLoader.kt
@@ -0,0 +1,90 @@
+/*
@@ -1691,8 +1728,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt
new file mode 100644
index 0000000..a4fbaf9
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/X11.kt
@@ -0,0 +1,718 @@
+/*
@@ -2414,8 +2453,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt
new file mode 100644
index 0000000..2a5efea
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/fcntl.kt
@@ -0,0 +1,760 @@
+/*
@@ -3179,8 +3220,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt
new file mode 100644
index 0000000..5cfb3b2
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/mman.kt
@@ -0,0 +1,280 @@
+/*
@@ -3464,8 +3507,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt
new file mode 100644
index 0000000..7610f37
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/pthread.kt
@@ -0,0 +1,20 @@
+/*
@@ -3489,8 +3534,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt
new file mode 100644
index 0000000..ec7abac
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/socket.kt
@@ -0,0 +1,41 @@
+/*
@@ -3535,8 +3582,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt
new file mode 100644
index 0000000..edb7a25
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/stat.kt
@@ -0,0 +1,34 @@
+/*
@@ -3574,8 +3623,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt
new file mode 100644
index 0000000..43051e6
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/uio.kt
@@ -0,0 +1,115 @@
+/*
@@ -3694,8 +3745,10 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ )
+}
\ No newline at end of file
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt
--- lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt 1970-01-01 01:00:00.000000000 +0100
diff --git lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt
new file mode 100644
index 0000000..149dd05
--- /dev/null
+++ lwjgl3-workdir/modules/lwjgl/core/src/templates/kotlin/core/astral/templates/unistd.kt
@@ -0,0 +1,73 @@
+/*
@@ -3771,10 +3824,11 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/core/src/templates/kotlin/
+ void()
+ )
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java lwjgl3-workdir/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java
diff --git lwjgl3-clean/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java lwjgl3-workdir/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java
index 0a6cfef..9ef32f9 100644
--- lwjgl3-clean/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java
+++ lwjgl3-workdir/modules/lwjgl/openal/src/main/java/org/lwjgl/openal/ALC.java
@@ -64,6 +64,7 @@
@@ -64,6 +64,7 @@ public final class ALC {
switch (Platform.get()) {
case LINUX:
case MACOSX:
@@ -3782,17 +3836,18 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/openal/src/main/java/org/l
libName = "openal";
break;
case WINDOWS:
@@ -350,4 +351,4 @@
@@ -350,4 +351,4 @@ public final class ALC {
}
-}
\ No newline at end of file
+}
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java lwjgl3-workdir/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java
diff --git lwjgl3-clean/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java lwjgl3-workdir/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java
index 6ae1b4f..637eb07 100644
--- lwjgl3-clean/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java
+++ lwjgl3-workdir/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java
@@ -98,6 +98,7 @@
@@ -98,6 +98,7 @@ public final class GL {
SharedLibrary GL;
switch (Platform.get()) {
case LINUX:
@@ -3800,10 +3855,11 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/opengl/src/main/java/org/l
GL = Library.loadNative(GL.class, "org.lwjgl.opengl", Configuration.OPENGL_LIBRARY_NAME, "libGLX.so.0", "libGL.so.1", "libGL.so");
break;
case MACOSX:
diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/remotery/src/main/c/Remotery.h lwjgl3-workdir/modules/lwjgl/remotery/src/main/c/Remotery.h
diff --git lwjgl3-clean/modules/lwjgl/remotery/src/main/c/Remotery.h lwjgl3-workdir/modules/lwjgl/remotery/src/main/c/Remotery.h
index 68868bb..e565217 100644
--- lwjgl3-clean/modules/lwjgl/remotery/src/main/c/Remotery.h
+++ lwjgl3-workdir/modules/lwjgl/remotery/src/main/c/Remotery.h
@@ -130,7 +130,7 @@
@@ -130,7 +130,7 @@ documented just below this comment.
// Platform identification
#if defined(_WINDOWS) || defined(_WIN32)
#define RMT_PLATFORM_WINDOWS
@@ -3812,3 +3868,15 @@ diff -urN --no-dereference lwjgl3-clean/modules/lwjgl/remotery/src/main/c/Remote
#define RMT_PLATFORM_LINUX
#define RMT_PLATFORM_POSIX
#elif defined(__APPLE__)
diff --git lwjgl3-clean/modules/lwjgl/stb/src/main/c/stb_dxt.h lwjgl3-workdir/modules/lwjgl/stb/src/main/c/stb_dxt.h
index 6150a87..89e09ed 100644
--- lwjgl3-clean/modules/lwjgl/stb/src/main/c/stb_dxt.h
+++ lwjgl3-workdir/modules/lwjgl/stb/src/main/c/stb_dxt.h
@@ -83,6 +83,7 @@ STBDDEF void stb_compress_bc5_block(unsigned char *dest, const unsigned char *sr
// #define STB_DXT_USE_ROUNDING_BIAS
#include <stdlib.h>
+#include <string.h>
#if !defined(STBD_FABS)
#include <math.h>
+23 -1
View File
@@ -1,5 +1,5 @@
diff --git mesa-demos-clean/meson.build mesa-demos-workdir/meson.build
index c1853f9..1edc2d9 100644
index c1853f9..d30024f 100644
--- mesa-demos-clean/meson.build
+++ mesa-demos-workdir/meson.build
@@ -99,7 +99,7 @@ if not dep_glu.found() and host_machine.system() != 'darwin'
@@ -11,3 +11,25 @@ index c1853f9..1edc2d9 100644
# xquartz doesn't have a glx.pc, but it does have the header. And all the
# symbols reside in libGL, so let's just use that.
if cc.check_header('GL/glx.h', dependencies: dep_x11)
@@ -163,7 +163,7 @@ if cc.has_function('sincos', prefix: '#define _GNU_SOURCE\n#include <math.h>',
add_project_arguments('-DHAVE_SINCOS', language: 'c')
endif
-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system())
+if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'astral'].contains(host_machine.system())
add_project_arguments('-D_GNU_SOURCE', language: ['c', 'cpp'])
elif host_machine.system() == 'windows'
add_project_arguments(['-D_USE_MATH_DEFINES'], language: ['c', 'cpp'])
diff --git mesa-demos-clean/src/util/matrix.c mesa-demos-workdir/src/util/matrix.c
index 1d1212c..adf71dd 100644
--- mesa-demos-clean/src/util/matrix.c
+++ mesa-demos-workdir/src/util/matrix.c
@@ -9,6 +9,8 @@
#include "matrix.h"
+#define _DEFAULT_SOURCE
+#define _GNU_SOURCE
#include <math.h>
#include <string.h>
#include <stdlib.h>
+34 -585
View File
@@ -1,219 +1,16 @@
diff --git mlibc-clean/options/ansi/generic/stdio.cpp mlibc-workdir/options/ansi/generic/stdio.cpp
index 070168f..7f20cb2 100644
--- mlibc-clean/options/ansi/generic/stdio.cpp
+++ mlibc-workdir/options/ansi/generic/stdio.cpp
@@ -8,6 +8,7 @@
#include <wchar.h>
#include <ctype.h>
#include <limits.h>
+#include <math.h>
#include <abi-bits/fcntl.h>
@@ -379,6 +380,20 @@ static void store_int(void *dest, unsigned int size, unsigned long long i) {
}
}
+static void store_float(void *dest, unsigned int size, long double f) {
+ switch(size) {
+ case SCANF_TYPE_LL:
+ *(long double *)dest = f;
+ break;
+ case SCANF_TYPE_L:
+ *(double *)dest = f;
+ break;
+ default:
+ *(float *)dest = f;
+ break;
+ }
+}
+
template<typename H>
static int do_scanf(H &handler, const char *fmt, __builtin_va_list args) {
#define NOMATCH_CHECK(cond) ({ if(cond) return match_count; }) // if cond is true, matching error
@@ -521,6 +536,141 @@ static int do_scanf(H &handler, const char *fmt, __builtin_va_list args) {
}
switch (*fmt) {
+ case 'a':
+ case 'A':
+ case 'E':
+ case 'e':
+ case 'G':
+ case 'g':
+ case 'F':
+ case 'f': {
+ bool is_negative = false;
+ long double divisor = 10;
+ long double result = 0;
+ int count = 0;
+ bool dot = false;
+ char c = handler.look_ahead();
+ EOF_CHECK(c == '\0');
+
+ if((c == '-')) {
+ handler.consume();
+ is_negative = true;
+ c = handler.look_ahead();
+ }
+
+ if((c == '+')) {
+ handler.consume();
+ c = handler.look_ahead();
+ }
+
+ // nan?
+ if(tolower(c) == 'n') {
+ handler.consume();
+ c = handler.look_ahead();
+ if(tolower(c) != 'a')
+ return match_count;
+
+ handler.consume();
+ c = handler.look_ahead();
+ if(tolower(c) != 'n')
+ return match_count;
+
+ handler.consume();
+ if(dest)
+ store_float(dest, type, NAN);
+
+ continue;
+ }
+
+ // inf?
+ if(tolower(c) == 'i') {
+ handler.consume();
+ c = handler.look_ahead();
+ size_t i;
+ for(i = 0; i < strlen("nfinity"); ++i) {
+ if (tolower(c) != "nfinity"[i])
+ break;
+ handler.consume();
+ c = handler.look_ahead();
+ }
+
+ NOMATCH_CHECK(i != 2 && i != 8);
+
+ if(dest)
+ store_float(dest, type, is_negative ? -INFINITY : INFINITY);
+
+ continue;
+ }
+
+ // check if hexadecimal
+ if (c == '0') {
+ handler.consume();
+ c = handler.look_ahead();
+ if (tolower(c) == 'x') {
+ mlibc::infoLogger() << "mlibc: no support for hexadecimal floats on scanf" << frg::endlog;
+ return match_count;
+ }
+
+ ++count;
+ }
+
+ while(isdigit(c) || (dot == false && c == '.')) {
+ handler.consume();
+ if(c == '.') {
+ dot = true;
+ c = handler.look_ahead();
+ continue;
+ }
+
+ long double character_value = c - '0';
+
+ if(dot) {
+ result = result + character_value / divisor;
+ divisor *= 10;
+ } else {
+ result = result * 10 + character_value;
+ }
+
+ ++count;
+ c = handler.look_ahead();
+ }
+
+ NOMATCH_CHECK(count == 0);
+
+ result = is_negative ? -result : result;
+
+ // check for scientific notation
+ if (tolower(c) == 'e') {
+ handler.consume();
+ c = handler.look_ahead();
+ bool negative_exponent = false;
+ if(c == '+') {
+ handler.consume();
+ c = handler.look_ahead();
+ }
+
+ if(c == '-') {
+ negative_exponent = true;
+ handler.consume();
+ c = handler.look_ahead();
+ }
+
+ int exponent = 0;
+
+ while(isdigit(c)) {
+ handler.consume();
+ int value = c - '0';
+ exponent = exponent * 10 + value;
+ c = handler.look_ahead();
+ }
+
+ result = result * powl(10, negative_exponent ? -exponent : exponent);
+ }
+
+ if (dest)
+ store_float(dest, type, result);
+ break;
+ }
case 'd':
case 'u':
base = 10;
@@ -787,21 +937,24 @@ static int do_scanf(H &handler, const char *fmt, __builtin_va_list args) {
}
for (; *fmt != ']'; fmt++) {
+ auto fmt_unsigned = reinterpret_cast<const unsigned char *>(fmt);
+
if (!*fmt) return EOF;
if (*fmt == '-' && *fmt != ']') {
fmt++;
- for (char c = *(fmt - 2); c < *fmt; c++)
+ fmt_unsigned++;
+ for (unsigned char c = *(fmt_unsigned - 2); c < *fmt_unsigned; c++)
scanset[1 + c] = 1 - invert;
}
- scanset[1 + *fmt] = 1 - invert;
+ scanset[1 + *fmt_unsigned] = 1 - invert;
}
char c = handler.look_ahead();
EOF_CHECK(c == '\0');
while (c && (!width || count < width)) {
- handler.consume();
if (!scanset[1 + c])
break;
+ handler.consume();
if(type == SCANF_TYPE_L)
append_to_wbuffer(c);
diff --git mlibc-clean/options/glibc/generic/execinfo.cpp mlibc-workdir/options/glibc/generic/execinfo.cpp
index 119574e..f9f1cde 100644
index 1ed110d..ded9114 100644
--- mlibc-clean/options/glibc/generic/execinfo.cpp
+++ mlibc-workdir/options/glibc/generic/execinfo.cpp
@@ -7,6 +7,7 @@
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <unistd.h>
#include <unwind.h>
+#include <errno.h>
#include <bits/ensure.h>
#include <mlibc/debug.hpp>
+#include <errno.h>
namespace {
@@ -52,33 +53,15 @@ _Unwind_Reason_Code trace(_Unwind_Context *context, void *arg) {
@@ -52,29 +53,7 @@ _Unwind_Reason_Code trace(_Unwind_Context *context, void *arg) {
} // namespace
int backtrace(void **buffer, int size) {
@@ -223,7 +20,8 @@ index 119574e..f9f1cde 100644
- if (!libgccHandle) {
- libgccHandle = dlopen("libgcc_s.so.1", RTLD_LAZY | RTLD_LOCAL);
- if (!libgccHandle || libgccHandle.value() == nullptr) {
- mlibc::infoLogger() << "Failed to load libgcc_s.so.1: " << (dlerror() ? dlerror() : "") << frg::endlog;
- auto error = dlerror();
- mlibc::infoLogger() << "Failed to load libgcc_s.so.1: " << (error ? error : "") << frg::endlog;
- return 0;
- }
-
@@ -239,383 +37,34 @@ index 119574e..f9f1cde 100644
- UnwindState state{buffer, size};
- unwindBacktrace(trace, &state);
- return state.current_frame;
+ mlibc::infoLogger() << "mlibc: backtrace() is a stub!" << frg::endlog;
+ errno = ENOSYS;
+ return -1;
+ return ENOSYS;
}
char **backtrace_symbols(void *const *, int) {
- __ensure(!"Not implemented");
- __builtin_unreachable();
+ mlibc::infoLogger() << "mlibc: backtrace() is a stub!" << frg::endlog;
+ errno = ENOSYS;
+ return NULL;
@@ -82,25 +61,5 @@ char **backtrace_symbols(void *const *, int) {
__builtin_unreachable();
}
void backtrace_symbols_fd(void *const *buffer, int size, int fd) {
diff --git mlibc-clean/options/internal/include/bits/null.h mlibc-workdir/options/internal/include/bits/null.h
index 176008f..4fddf21 100644
--- mlibc-clean/options/internal/include/bits/null.h
+++ mlibc-workdir/options/internal/include/bits/null.h
@@ -9,7 +9,7 @@
#ifndef __cplusplus
# define NULL ((void *)0)
#else
-# define NULL 0
+# define NULL 0L
#endif
#endif /* MLIBC_NULL_H */
diff --git mlibc-clean/options/posix/generic/lookup.cpp mlibc-workdir/options/posix/generic/lookup.cpp
index c2da918..823d85a 100644
--- mlibc-clean/options/posix/generic/lookup.cpp
+++ mlibc-workdir/options/posix/generic/lookup.cpp
@@ -12,6 +12,7 @@
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
+#include <poll.h>
namespace mlibc {
@@ -116,21 +117,41 @@ int lookup_name_dns(struct lookup_result &buf, const char *name,
(struct sockaddr*)&sin, sizeof(sin));
if (sent != request.size()) {
mlibc::infoLogger() << "lookup_name_dns(): sendto() failed to send everything" << frg::endlog;
+ close(fd);
return -EAI_SYSTEM;
-void backtrace_symbols_fd(void *const *buffer, int size, int fd) {
- if (size <= 0 || fd < 0)
- return;
-
- for (int frame_num = 0; frame_num < size; frame_num++) {
- Dl_info info;
- if (dladdr(buffer[frame_num], &info) != 0) {
- if (info.dli_fname != nullptr)
- write(fd, info.dli_fname, strlen(info.dli_fname));
-
- if (info.dli_sname != nullptr)
- dprintf(fd, "(%s+0x%" PRIxPTR ") ", info.dli_sname,
- reinterpret_cast<uintptr_t>(buffer[frame_num]) - reinterpret_cast<uintptr_t>(info.dli_saddr));
- else if(info.dli_saddr)
- dprintf(fd, "(+%p) ", info.dli_saddr);
- else
- dprintf(fd, "() ");
- }
-
- dprintf(fd, "[%p]\n", buffer[frame_num]);
- }
+void backtrace_symbols_fd(void *const *, int, int) {
}
char response[256];
- ssize_t rlen;
int num_ans = 0;
- while ((rlen = recvfrom(fd, response, 256, 0, nullptr, nullptr)) >= 0) {
+ int fds_ready;
+
+ struct pollfd pollfd;
+ pollfd.fd = fd;
+ pollfd.events = POLLIN;
+
+ // default timeout is 5 seconds
+ // TODO resolv.conf can specify a timeout and we ignore it currently.
+ while ((fds_ready = poll(&pollfd, 1, 5000)) > 0) {
+ ssize_t rlen = recvfrom(fd, response, 256, 0, nullptr, nullptr);
+ if (rlen < 0) {
+ mlibc::infoLogger() << "lookup_name_dns(): recvfrom() failed" << frg::endlog;
+ close(fd);
+ return -EAI_SYSTEM;
+ }
+
if ((size_t)rlen < sizeof(struct dns_header))
continue;
+
auto response_header = reinterpret_cast<struct dns_header*>(response);
- if (response_header->identification != header.identification)
+ if (response_header->identification != header.identification) {
+ close(fd);
return -EAI_FAIL;
+ }
- if ((ntohs(response_header->flags) & 0xF) == RETURN_NXDOMAIN)
+ if ((ntohs(response_header->flags) & 0xF) == RETURN_NXDOMAIN) {
+ close (fd);
return -EAI_NONAME;
+ }
auto it = response + sizeof(struct dns_header);
for (int i = 0; i < ntohs(response_header->no_q); i++) {
@@ -187,6 +208,10 @@ int lookup_name_dns(struct lookup_result &buf, const char *name,
}
close(fd);
+
+ if (fds_ready == 0)
+ return -EAI_AGAIN;
+
return buf.buf.size();
}
@@ -265,18 +290,36 @@ int lookup_addr_dns(frg::span<char> name, frg::array<uint8_t, 16> &addr, int fam
(struct sockaddr*)&sin, sizeof(sin));
if (sent != request.size()) {
mlibc::infoLogger() << "lookup_name_dns(): sendto() failed to send everything" << frg::endlog;
+ close(fd);
return -EAI_SYSTEM;
}
char response[256];
- ssize_t rlen;
int num_ans = 0;
- while ((rlen = recvfrom(fd, response, 256, 0, nullptr, nullptr)) >= 0) {
+ int fds_ready;
+
+ struct pollfd pollfd;
+ pollfd.fd = fd;
+ pollfd.events = POLLIN;
+
+ // default timeout is 5 seconds
+ // TODO resolv.conf can specify a timeout and we ignore it currently.
+ while ((fds_ready = poll(&pollfd, 1, 5000)) > 0) {
+ ssize_t rlen = recvfrom(fd, response, 256, 0, nullptr, nullptr);
+ if (rlen < 0) {
+ mlibc::infoLogger() << "lookup_name_dns(): recvfrom() failed" << frg::endlog;
+ close(fd);
+ return -EAI_SYSTEM;
+ }
+
if ((size_t)rlen < sizeof(struct dns_header))
continue;
+
auto response_header = reinterpret_cast<struct dns_header*>(response);
- if (response_header->identification != header.identification)
+ if (response_header->identification != header.identification) {
+ close(fd);
return -EAI_FAIL;
+ }
auto it = response + sizeof(struct dns_header);
for (int i = 0; i < ntohs(response_header->no_q); i++) {
@@ -300,6 +343,7 @@ int lookup_addr_dns(frg::span<char> name, frg::array<uint8_t, 16> &addr, int fam
switch (rr_type) {
case RECORD_PTR: {
+ close(fd);
auto ptr_name = read_dns_name(response, it);
if (ptr_name.size() >= name.size())
return -EAI_OVERFLOW;
diff --git mlibc-clean/options/posix/generic/search.cpp mlibc-workdir/options/posix/generic/search.cpp
index 5c57cf8..cb2d97f 100644
--- mlibc-clean/options/posix/generic/search.cpp
+++ mlibc-workdir/options/posix/generic/search.cpp
@@ -53,7 +53,7 @@ namespace {
struct node *node = *nodep;
int height_a = height(static_cast<struct node *>(node->a[0]));
int height_b = height(static_cast<struct node *>(node->a[1]));
- if (height_a - height_b < 2) {
+ if (abs(height_a - height_b) < 2) {
int old = node->h;
node->h = height_a < height_b ? height_b + 1 : height_a + 1;
return node->h - old;
@@ -96,7 +96,7 @@ void *tsearch(const void *key, void **rootp, int(*compar)(const void *, const vo
// This implementation is taken from musl
void *tfind(const void *key, void *const *rootp, int (*compar)(const void *, const void *)) {
- if(!rootp)
+ if(!*rootp)
return nullptr;
struct node *n = (struct node *)*rootp;
@@ -111,16 +111,136 @@ void *tfind(const void *key, void *const *rootp, int (*compar)(const void *, con
return n;
}
-void *tdelete(const void *, void **, int(*compar)(const void *, const void *)) {
- (void)compar;
- __ensure(!"Not implemented");
- __builtin_unreachable();
+void *tdelete(const void *key, void **rootp, int(*compar)(const void *, const void *)) {
+ if (!*rootp)
+ return nullptr;
+
+ struct node *node_parent = nullptr;
+ struct node *n = static_cast<struct node *>(*rootp);
+ frg::stack<struct node **, MemoryAllocator> nodes(getAllocator());
+ nodes.push(reinterpret_cast<struct node **>(rootp));
+ int c = 0;
+ for (;;) {
+ if (!n)
+ break;
+ c = compar(key, n->key);
+ if (!c)
+ break;
+
+ nodes.push(reinterpret_cast<struct node **>(&n->a[c > 0]));
+ node_parent = n;
+ n = static_cast<struct node *>(n->a[c > 0]);
+ }
+
+ if (!n)
+ return nullptr;
+
+ int child_count = 0;
+ if (n->a[0])
+ ++child_count;
+ if (n->a[1])
+ ++child_count;
+
+ struct node **nodep = nodes.top();
+
+ // 3 cases:
+ // - no children, remove node
+ // - one child, replace node with it
+ // - two children, the predecessor replaces the node and balance up from the parent of the predecessor
+ switch (child_count) {
+ case 0:
+ nodes.pop();
+ *nodep = nullptr;
+ break;
+ case 1:
+ *nodep = static_cast<struct node *>(n->a[0] ? n->a[0] : n->a[1]);
+ break;
+ case 2: {
+ struct node *pred_parent = n;
+ struct node *predecessor = static_cast<struct node *>(n->a[0]);
+
+ while (predecessor->a[1]) {
+ pred_parent = predecessor;
+ predecessor = static_cast<struct node *>(predecessor->a[1]);
+ nodes.push(reinterpret_cast<struct node **>(&pred_parent->a[1]));
+ }
+
+ // predecessor can only have a left child
+ if (pred_parent == n) {
+ // special case, predecessor is a direct child (left) of node
+ // set right child to the deleted node's right child
+ predecessor->a[1] = n->a[1];
+ } else {
+ // the predecessor will always be a right child
+ // replace the predecessor's place with its left child (if any)
+ pred_parent->a[1] = predecessor->a[0];
+ predecessor->a[0] = static_cast<struct node *>(n->a[0]);
+ predecessor->a[1] = static_cast<struct node *>(n->a[1]);
+ nodes.pop();
+ }
+ *nodep = predecessor;
+ break;
+ }
+ }
+
+ free(static_cast<void *>(n));
+
+ // go up balancing the tree
+ while (!nodes.empty() && balance_tree(nodes.top()))
+ nodes.pop();
+
+ // NOTE: this WILL return a dangling pointer. this is expected behaviour (see glibc's manual page)
+ return node_parent ? node_parent : n;
}
-void twalk(const void *, void (*action)(const void *, VISIT, int)) {
- (void)action;
- __ensure(!"Not implemented");
- __builtin_unreachable();
+void twalk(const void *root, void (*action)(const void *, VISIT, int)) {
+ if (!root)
+ return;
+
+ struct walk_node {
+ const struct node *node;
+ VISIT v;
+ };
+ int depth = 0;
+ const struct node *node = static_cast<const struct node *>(root);
+ frg::stack<struct walk_node, MemoryAllocator> nodes(getAllocator());
+
+ struct walk_node wn = {node, VISIT::preorder};
+ nodes.push(wn);
+
+ while(!nodes.empty()) {
+ wn = nodes.top();
+ nodes.pop();
+
+ if (!wn.node->a[0] && !wn.node->a[1])
+ wn.v = VISIT::leaf;
+
+ action(wn.node, wn.v, depth);
+
+ struct node *next_child = nullptr;
+ switch (wn.v) {
+ case VISIT::endorder:
+ case VISIT::leaf:
+ --depth;
+ break;
+ case VISIT::preorder:
+ next_child = static_cast<struct node *>(wn.node->a[0]);
+ wn.v = VISIT::postorder;
+ nodes.push(wn);
+ break;
+ case VISIT::postorder:
+ next_child = static_cast<struct node *>(wn.node->a[1]);
+ wn.v = VISIT::endorder;
+ nodes.push(wn);
+ break;
+ }
+
+ if (next_child) {
+ ++depth;
+ struct walk_node tmp = {next_child, VISIT::preorder};
+ nodes.push(tmp);
+ }
+ }
}
void tdestroy(void *root, void (*free_node)(void *)) {
diff --git mlibc-clean/options/rtld/generic/main.cpp mlibc-workdir/options/rtld/generic/main.cpp
index b2db152..244ad4b 100644
--- mlibc-clean/options/rtld/generic/main.cpp
+++ mlibc-workdir/options/rtld/generic/main.cpp
@@ -636,8 +636,8 @@ void *__dlapi_open(const char *file, int flags, void *returnAddress) {
// In order to know which RUNPATH / RPATH to process, we must find the calling object.
SharedObject *origin = initialRepository->findCaller(returnAddress);
if (!origin) {
- mlibc::panicLogger() << "rtld: unable to determine calling object of dlopen "
- << "(ra = " << returnAddress << ")" << frg::endlog;
+ // When we can't find the origin, assume it's the main executable (copies glibc behavior)
+ origin = executableSO;
}
objectResult = initialRepository->requestObjectWithName(file, origin, newScope, !isGlobal, rts);
@@ -681,6 +681,9 @@ void *__dlapi_open(const char *file, int flags, void *returnAddress) {
}
}
+ if (isGlobal)
+ object->localScope = globalScope.get();
+
Loader linker{object->localScope, nullptr, false, rts};
linker.linkObjects(object);
linker.initObjects(initialRepository.get());
diff --git mlibc-clean/sysdeps/astral/generic/generic.cpp mlibc-workdir/sysdeps/astral/generic/generic.cpp
index be7ad9e..80cc8d9 100644
--- mlibc-clean/sysdeps/astral/generic/generic.cpp
+++ mlibc-workdir/sysdeps/astral/generic/generic.cpp
@@ -47,6 +47,25 @@ namespace mlibc {
return 0;
}
+ int sys_readv(int fd, const struct iovec *iovs, int iovc, ssize_t *bytes_read) {
+ long r;
+ int error = syscall(SYSCALL_READV, &r, fd, (uint64_t)iovs, iovc);
+ *bytes_read = r;
+ return error;
+ }
+
+ int sys_writev(int fd, const struct iovec *iovs, int iovc, ssize_t *bytes_written) {
+ long r;
+ int error = syscall(SYSCALL_WRITEV, &r, fd, (uint64_t)iovs, iovc);
+ *bytes_written = r;
+ return error;
+ }
+
+ int sys_sysinfo(struct sysinfo *info) {
+ long r;
+ return syscall(SYSCALL_SYSINFO, &r, (uint64_t)info);
+ }
+
int sys_getcpu(int *cpu) {
long ret;
// can never fail
diff --git mlibc-clean/sysdeps/astral/include/astral/syscall.h mlibc-workdir/sysdeps/astral/include/astral/syscall.h
index 8414286..a6c4067 100644
--- mlibc-clean/sysdeps/astral/include/astral/syscall.h
+++ mlibc-workdir/sysdeps/astral/include/astral/syscall.h
@@ -100,6 +100,9 @@
#define SYSCALL_NICE 93
#define SYSCALL_FLOCK 94
#define SYSCALL_GETCPU 95
+#define SYSCALL_SYSINFO 96
+#define SYSCALL_WRITEV 97
+#define SYSCALL_READV 98
#ifndef __MLIBC_ABI_ONLY
+311 -248
View File
@@ -1,8 +1,8 @@
diff --git openjdk17-clean/make/autoconf/platform.m4 openjdk17-workdir/make/autoconf/platform.m4
index 2dd13d0..1aca7f7 100644
index eb66266..891759b 100644
--- openjdk17-clean/make/autoconf/platform.m4
+++ openjdk17-workdir/make/autoconf/platform.m4
@@ -214,6 +214,10 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
@@ -220,6 +220,10 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
VAR_OS=aix
VAR_OS_TYPE=unix
;;
@@ -14,10 +14,10 @@ index 2dd13d0..1aca7f7 100644
AC_MSG_ERROR([unsupported operating system $1])
;;
diff --git openjdk17-clean/make/modules/java.desktop/lib/Awt2dLibraries.gmk openjdk17-workdir/make/modules/java.desktop/lib/Awt2dLibraries.gmk
index 4d0c0c0..0a95a24 100644
index badb6f8..6aaedc2 100644
--- openjdk17-clean/make/modules/java.desktop/lib/Awt2dLibraries.gmk
+++ openjdk17-workdir/make/modules/java.desktop/lib/Awt2dLibraries.gmk
@@ -751,6 +751,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
@@ -786,6 +786,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
$(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
LIBS_aix := -liconv, \
@@ -39,10 +39,10 @@ index 3996ad2..727f312 100644
LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
-framework ApplicationServices, \
diff --git openjdk17-clean/make/modules/jdk.jdwp.agent/Lib.gmk openjdk17-workdir/make/modules/jdk.jdwp.agent/Lib.gmk
index aef358c..fbc1750 100644
index 0a041fe..9db8c4e 100644
--- openjdk17-clean/make/modules/jdk.jdwp.agent/Lib.gmk
+++ openjdk17-workdir/make/modules/jdk.jdwp.agent/Lib.gmk
@@ -61,7 +61,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
@@ -62,7 +62,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(JDKLIB_LIBS), \
@@ -88,10 +88,10 @@ index ba26cbf..e72a9ea 100644
+#endif
}
diff --git openjdk17-clean/src/hotspot/os/linux/os_linux.cpp openjdk17-workdir/src/hotspot/os/linux/os_linux.cpp
index 239cd0d..8090c53 100644
index 3d24234..93e3a9c 100644
--- openjdk17-clean/src/hotspot/os/linux/os_linux.cpp
+++ openjdk17-workdir/src/hotspot/os/linux/os_linux.cpp
@@ -98,7 +98,11 @@
@@ -100,7 +100,11 @@
# include <poll.h>
# include <fcntl.h>
# include <string.h>
@@ -103,7 +103,7 @@ index 239cd0d..8090c53 100644
# include <sys/sysinfo.h>
# include <sys/ipc.h>
# include <sys/shm.h>
@@ -348,9 +352,13 @@ bool os::have_special_privileges() {
@@ -345,9 +349,13 @@ bool os::have_special_privileges() {
// Returns the kernel thread id of the currently running thread. Kernel
// thread id is used to access /proc.
pid_t os::Linux::gettid() {
@@ -116,9 +116,9 @@ index 239cd0d..8090c53 100644
+#endif
}
// Most versions of linux have a bug where the number of processors are
// Returns the amount of swap currently configured, in bytes.
diff --git openjdk17-clean/src/hotspot/os/linux/waitBarrier_linux.cpp openjdk17-workdir/src/hotspot/os/linux/waitBarrier_linux.cpp
index 491f9e6..e9530f0 100644
index 491f9e6..64ab97e 100644
--- openjdk17-clean/src/hotspot/os/linux/waitBarrier_linux.cpp
+++ openjdk17-workdir/src/hotspot/os/linux/waitBarrier_linux.cpp
@@ -26,7 +26,11 @@
@@ -158,7 +158,7 @@ index 491f9e6..e9530f0 100644
static int futex(volatile int *addr, int futex_op, int op_arg) {
+#ifdef __astral__
+ long ret;
+ long err = syscall(SYSCALL_FUTEX, &ret, (uint64_t)addr, futex_op & 1, op_arg, NULL);
+ long err = syscall(SYSCALL_FUTEX, &ret, (uint64_t)addr, futex_op & 1, op_arg, 0);
+ if (err) {
+ errno = err;
+ return -1;
@@ -171,7 +171,7 @@ index 491f9e6..e9530f0 100644
void LinuxWaitBarrier::arm(int barrier_tag) {
diff --git openjdk17-clean/src/hotspot/os/posix/vmError_posix.cpp openjdk17-workdir/src/hotspot/os/posix/vmError_posix.cpp
index 845dda6..ca61d72 100644
index 2e49c53..1c79516 100644
--- openjdk17-clean/src/hotspot/os/posix/vmError_posix.cpp
+++ openjdk17-workdir/src/hotspot/os/posix/vmError_posix.cpp
@@ -35,7 +35,7 @@
@@ -222,10 +222,10 @@ index fa925f5..df152da 100644
}
diff --git openjdk17-clean/src/java.base/share/native/libjli/jli_util.h openjdk17-workdir/src/java.base/share/native/libjli/jli_util.h
index 3512b1e..727be0d 100644
index 6aa26a0..4f92110 100644
--- openjdk17-clean/src/java.base/share/native/libjli/jli_util.h
+++ openjdk17-workdir/src/java.base/share/native/libjli/jli_util.h
@@ -115,6 +115,9 @@ JLI_CmdToArgs(char *cmdline);
@@ -111,6 +111,9 @@ JLI_CmdToArgs(char *cmdline);
#define JLI_Lseek lseek
#endif
#endif /* _WIN32 */
@@ -235,239 +235,6 @@ index 3512b1e..727be0d 100644
/*
* Make launcher spit debug output.
diff --git openjdk17-clean/src/java.base/unix/native/jspawnhelper/jspawnhelper.c openjdk17-workdir/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
index 1388201..db47119 100644
--- openjdk17-clean/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
+++ openjdk17-workdir/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
@@ -33,8 +33,6 @@
#include "childproc.h"
-extern int errno;
-
#define ALLOC(X,Y) { \
void *mptr; \
mptr = malloc (Y); \
diff --git openjdk17-clean/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c openjdk17-workdir/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
index d53e887..35d1121 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
@@ -485,10 +485,10 @@ void unix_getUserInfo(JNIEnv* env, jobject jinfo, uid_t uid) {
}
/*
- * The following functions are common on Solaris, Linux and AIX.
+ * The following functions are common on Solaris, Linux, AIX and Astral.
*/
-#if defined (__linux__) || defined(_AIX)
+#if defined (__linux__) || defined(_AIX) || defined(__astral__)
/*
* Returns the children of the requested pid and optionally each parent and
@@ -607,7 +607,7 @@ jint unix_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
return count;
}
-#endif // defined (__linux__) || defined(_AIX)
+#endif // defined (__linux__) || defined(_AIX) || defined(__astral__)
/*
* The following functions are for AIX.
diff --git openjdk17-clean/src/java.base/unix/native/libjava/TimeZone_md.c openjdk17-workdir/src/java.base/unix/native/libjava/TimeZone_md.c
index 94dfc20..af060ac 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/TimeZone_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/TimeZone_md.c
@@ -59,7 +59,7 @@ static char *isFileIdentical(char* buf, size_t size, char *pathname);
#define fstat64 fstat
#endif
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__astral__)
static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
@@ -75,7 +75,7 @@ static const char popularZones[][4] = {"UTC", "GMT"};
static const char *ETC_ENVIRONMENT_FILE = "/etc/environment";
#endif
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__) || defined(MACOSX) || defined(__astral__)
/*
* Returns a pointer to the zone ID portion of the given zoneinfo file
diff --git openjdk17-clean/src/java.base/unix/native/libjava/io_util_md.c openjdk17-workdir/src/java.base/unix/native/libjava/io_util_md.c
index e207c57..4311740 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/io_util_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/io_util_md.c
@@ -30,7 +30,7 @@
#include <string.h>
#include <unistd.h>
-#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) || defined(__astral__)
#include <sys/ioctl.h>
#endif
diff --git openjdk17-clean/src/java.base/unix/native/libjava/jni_util_md.c openjdk17-workdir/src/java.base/unix/native/libjava/jni_util_md.c
index 460503c..47a0236 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/jni_util_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/jni_util_md.c
@@ -31,7 +31,7 @@
#include "jni_util.h"
#include "dlfcn.h"
-#if defined(LINUX) && (defined(_GNU_SOURCE) || \
+#if defined(__linux__) && (defined(_GNU_SOURCE) || \
(defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE < 200112L \
&& defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 600))
extern int __xpg_strerror_r(int, char *, size_t);
diff --git openjdk17-clean/src/java.base/unix/native/libnet/Inet6AddressImpl.c openjdk17-workdir/src/java.base/unix/native/libnet/Inet6AddressImpl.c
index 058f3d3..bcfd46f 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/Inet6AddressImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnet/Inet6AddressImpl.c
@@ -29,6 +29,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <netinet/in.h>
+#include <netinet/ip.h>
#include <netinet/icmp6.h>
#if defined(_ALLBSD_SOURCE)
diff --git openjdk17-clean/src/java.base/unix/native/libnet/NetworkInterface.c openjdk17-workdir/src/java.base/unix/native/libnet/NetworkInterface.c
index 990bc1b..b231b8b 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/NetworkInterface.c
+++ openjdk17-workdir/src/java.base/unix/native/libnet/NetworkInterface.c
@@ -47,7 +47,7 @@
#include "java_net_InetAddress.h"
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
#endif
@@ -1144,7 +1144,7 @@ static int openSocket(JNIEnv *env, int proto) {
}
/** Linux **/
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
/*
* Opens a socket for further ioctl calls. Tries AF_INET socket first and
diff --git openjdk17-clean/src/java.base/unix/native/libnet/net_util_md.h openjdk17-workdir/src/java.base/unix/native/libnet/net_util_md.h
index 6883598..8a17572 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/net_util_md.h
+++ openjdk17-workdir/src/java.base/unix/native/libnet/net_util_md.h
@@ -29,6 +29,7 @@
#include <netdb.h>
#include <poll.h>
#include <sys/socket.h>
+#include <netinet/in.h>
/************************************************************************
* Macros and constants
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/FileChannelImpl.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
index e0debb0..cdb7435 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <unistd.h>
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
#include <sys/sendfile.h>
#elif defined(_AIX)
#include <string.h>
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
index 8821461..f97ccda 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
@@ -40,6 +40,10 @@
#include <sys/ioctl.h>
#endif
+#ifdef __astral__
+#include <sys/ioctl.h>
+#endif
+
#if defined(_ALLBSD_SOURCE)
#define lseek64 lseek
#define stat64 stat
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/NativeThread.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/NativeThread.c
index 92dcb9e..15f3438 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -34,7 +34,7 @@
#include <signal.h>
#include <pthread.h>
-#ifdef __linux__
+#if defined(__linux__) || defined(__astral__)
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
diff --git openjdk17-clean/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c openjdk17-workdir/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
index 9df8be1..be0aa40 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
@@ -41,7 +41,7 @@
#endif
#include <sys/time.h>
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__astral__)
#include <sys/xattr.h>
#endif
diff --git openjdk17-clean/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c openjdk17-workdir/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
index c591f04..a79b0a8 100644
--- openjdk17-clean/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
+++ openjdk17-workdir/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
@@ -55,8 +55,9 @@ Java_java_util_prefs_FileSystemPreferences_chmod(JNIEnv *env,
return (jint) result;
}
-#if defined(_ALLBSD_SOURCE)
+#if defined(_ALLBSD_SOURCE) || defined(__astral__)
typedef struct flock FLOCK;
+#define F_SETLK64 F_SETLK
#else
typedef struct flock64 FLOCK;
#endif
diff --git openjdk17-clean/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c openjdk17-workdir/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
index e33d9b4..39f784f 100644
--- openjdk17-clean/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
+++ openjdk17-workdir/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
@@ -63,7 +63,7 @@
static jlong page_size = 0;
-#if defined(_ALLBSD_SOURCE) || defined(_AIX)
+#if defined(_ALLBSD_SOURCE) || defined(_AIX) || defined(__astral__)
#define MB (1024UL * 1024UL)
#else
@@ -235,7 +235,7 @@ Java_com_sun_management_internal_OperatingSystemImpl_getFreeMemorySize0
return -1;
}
return (jlong)vm_stats.free_count * page_size;
-#elif defined(_ALLBSD_SOURCE)
+#elif defined(_ALLBSD_SOURCE) || defined(__astral__)
/*
* XXBSDL no way to do it in FreeBSD
*/
@@ -276,6 +276,8 @@ Java_com_sun_management_internal_OperatingSystemImpl_getTotalMemorySize0
return (jlong)(memory_info.real_total * 4L * 1024L);
}
return -1;
+#elif defined(__astral__)
+ return (128 * MB);
#else // solaris / linux
jlong num_physical_pages = sysconf(_SC_PHYS_PAGES);
return (num_physical_pages * page_size);
diff --git openjdk17-clean/src/java.base/unix/classes/java/lang/ProcessImpl.java openjdk17-workdir/src/java.base/unix/classes/java/lang/ProcessImpl.java
index 2bf36f8..705daf3 100644
--- openjdk17-clean/src/java.base/unix/classes/java/lang/ProcessImpl.java
@@ -508,6 +275,214 @@ index 2bf36f8..705daf3 100644
case LINUX:
case BSD:
case AIX:
diff --git openjdk17-clean/src/java.base/unix/native/jspawnhelper/jspawnhelper.c openjdk17-workdir/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
index 5f2f04d..aa16545 100644
--- openjdk17-clean/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
+++ openjdk17-workdir/src/java.base/unix/native/jspawnhelper/jspawnhelper.c
@@ -35,8 +35,6 @@
#include "childproc.h"
-extern int errno;
-
#define ALLOC(X,Y) { \
void *mptr; \
mptr = malloc (Y); \
diff --git openjdk17-clean/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c openjdk17-workdir/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
index 8b900dc..657330e 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
@@ -485,10 +485,10 @@ void unix_getUserInfo(JNIEnv* env, jobject jinfo, uid_t uid) {
}
/*
- * The following functions are common on Solaris, Linux and AIX.
+ * The following functions are common on Solaris, Linux, AIX and Astral.
*/
-#if defined (__linux__) || defined(_AIX)
+#if defined (__linux__) || defined(_AIX) || defined(__astral__)
/*
* Returns the children of the requested pid and optionally each parent and
@@ -607,7 +607,7 @@ jint unix_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
return count;
}
-#endif // defined (__linux__) || defined(_AIX)
+#endif // defined (__linux__) || defined(_AIX) || defined(__astral__)
/*
* The following functions are for AIX.
diff --git openjdk17-clean/src/java.base/unix/native/libjava/TimeZone_md.c openjdk17-workdir/src/java.base/unix/native/libjava/TimeZone_md.c
index 5c40fc8..5a49ad0 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/TimeZone_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/TimeZone_md.c
@@ -59,7 +59,7 @@ static char *isFileIdentical(char* buf, size_t size, char *pathname);
#define fstat64 fstat
#endif
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__astral__)
static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
@@ -75,7 +75,7 @@ static const char popularZones[][4] = {"UTC", "GMT"};
static const char *ETC_ENVIRONMENT_FILE = "/etc/environment";
#endif
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__) || defined(MACOSX) || defined(__astral__)
/*
* Returns a pointer to the zone ID portion of the given zoneinfo file
diff --git openjdk17-clean/src/java.base/unix/native/libjava/io_util_md.c openjdk17-workdir/src/java.base/unix/native/libjava/io_util_md.c
index e207c57..4311740 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/io_util_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/io_util_md.c
@@ -30,7 +30,7 @@
#include <string.h>
#include <unistd.h>
-#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) || defined(__astral__)
#include <sys/ioctl.h>
#endif
diff --git openjdk17-clean/src/java.base/unix/native/libjava/jni_util_md.c openjdk17-workdir/src/java.base/unix/native/libjava/jni_util_md.c
index 460503c..c6968fc 100644
--- openjdk17-clean/src/java.base/unix/native/libjava/jni_util_md.c
+++ openjdk17-workdir/src/java.base/unix/native/libjava/jni_util_md.c
@@ -31,13 +31,19 @@
#include "jni_util.h"
#include "dlfcn.h"
-#if defined(LINUX) && (defined(_GNU_SOURCE) || \
+#if defined(__linux__) && (defined(_GNU_SOURCE) || \
(defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE < 200112L \
&& defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 600))
extern int __xpg_strerror_r(int, char *, size_t);
#define strerror_r(a, b, c) __xpg_strerror_r((a), (b), (c))
#endif
+#if defined(__astral__)
+#undef strerror_r
+extern int __gnu_strerror_r(int, char *, size_t);
+#define strerror_r(a, b, c) __gnu_strerror_r((a), (b), (c))
+#endif
+
void* getProcessHandle() {
static void *procHandle = NULL;
if (procHandle != NULL) {
diff --git openjdk17-clean/src/java.base/unix/native/libnet/Inet6AddressImpl.c openjdk17-workdir/src/java.base/unix/native/libnet/Inet6AddressImpl.c
index e9e7adb..b8efe10 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/Inet6AddressImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnet/Inet6AddressImpl.c
@@ -29,6 +29,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <netinet/in.h>
+#include <netinet/ip.h>
#include <netinet/icmp6.h>
#if defined(_ALLBSD_SOURCE)
diff --git openjdk17-clean/src/java.base/unix/native/libnet/NetworkInterface.c openjdk17-workdir/src/java.base/unix/native/libnet/NetworkInterface.c
index dcaf3fd..9d7389a 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/NetworkInterface.c
+++ openjdk17-workdir/src/java.base/unix/native/libnet/NetworkInterface.c
@@ -47,7 +47,7 @@
#include "java_net_InetAddress.h"
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
#endif
@@ -1144,7 +1144,7 @@ static int openSocket(JNIEnv *env, int proto) {
}
/** Linux **/
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
/*
* Opens a socket for further ioctl calls. Tries AF_INET socket first and
diff --git openjdk17-clean/src/java.base/unix/native/libnet/net_util_md.h openjdk17-workdir/src/java.base/unix/native/libnet/net_util_md.h
index 6883598..8a17572 100644
--- openjdk17-clean/src/java.base/unix/native/libnet/net_util_md.h
+++ openjdk17-workdir/src/java.base/unix/native/libnet/net_util_md.h
@@ -29,6 +29,7 @@
#include <netdb.h>
#include <poll.h>
#include <sys/socket.h>
+#include <netinet/in.h>
/************************************************************************
* Macros and constants
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/FileChannelImpl.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
index 8cc753e..85650fe 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileChannelImpl.c
@@ -29,7 +29,7 @@
#include <sys/types.h>
#include <unistd.h>
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
#include <sys/sendfile.h>
#elif defined(_AIX)
#include <string.h>
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
index c0c31d6..cf4251c 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
@@ -40,6 +40,10 @@
#include <sys/ioctl.h>
#endif
+#ifdef __astral__
+#include <sys/ioctl.h>
+#endif
+
#if defined(_ALLBSD_SOURCE)
#define lseek64 lseek
#define stat64 stat
diff --git openjdk17-clean/src/java.base/unix/native/libnio/ch/NativeThread.c openjdk17-workdir/src/java.base/unix/native/libnio/ch/NativeThread.c
index 92dcb9e..15f3438 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -34,7 +34,7 @@
#include <signal.h>
#include <pthread.h>
-#ifdef __linux__
+#if defined(__linux__) || defined(__astral__)
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
diff --git openjdk17-clean/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c openjdk17-workdir/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
index 7bc14a0..a77a112 100644
--- openjdk17-clean/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
+++ openjdk17-workdir/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
@@ -41,7 +41,7 @@
#endif
#include <sys/time.h>
-#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(__astral__)
#include <sys/xattr.h>
#endif
@@ -54,7 +54,7 @@
#include <sys/sysmacros.h> // makedev macros
#endif
-#if defined(__linux__) || defined(_AIX)
+#if defined(__linux__) || defined(__astral__) || defined(_AIX)
#include <string.h>
#endif
diff --git openjdk17-clean/src/java.desktop/share/classes/sun/awt/OSInfo.java openjdk17-workdir/src/java.desktop/share/classes/sun/awt/OSInfo.java
index 8770ed2..fe02b7d 100644
--- openjdk17-clean/src/java.desktop/share/classes/sun/awt/OSInfo.java
@@ -531,3 +506,91 @@ index 8770ed2..fe02b7d 100644
// determine another OS here
}
diff --git openjdk17-clean/src/java.desktop/unix/native/common/awt/fontpath.c openjdk17-workdir/src/java.desktop/unix/native/common/awt/fontpath.c
index df35e78..ac8b36e 100644
--- openjdk17-clean/src/java.desktop/unix/native/common/awt/fontpath.c
+++ openjdk17-workdir/src/java.desktop/unix/native/common/awt/fontpath.c
@@ -23,7 +23,7 @@
* questions.
*/
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
#include <string.h>
#endif /* __linux__ */
#include <stdio.h>
@@ -61,7 +61,7 @@ extern Display *awt_display;
#define MAXFDIRS 512 /* Max number of directories that contain fonts */
-#if defined( __linux__)
+#if defined( __linux__) || defined(__astral__)
/* All the known interesting locations we have discovered on
* various flavors of Linux
*/
@@ -324,7 +324,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1, jboolean is
*/
fcdirs = getFontConfigLocations();
-#if defined(__linux__)
+#if defined(__linux__) || defined(__astral__)
knowndirs = fullLinuxFontPath;
#elif defined(_AIX)
knowndirs = fullAixFontPath;
diff --git openjdk17-clean/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c openjdk17-workdir/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
index 4e15ddd..61c998c 100644
--- openjdk17-clean/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
+++ openjdk17-workdir/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c
@@ -55,7 +55,7 @@ Java_java_util_prefs_FileSystemPreferences_chmod(JNIEnv *env,
return (jint) result;
}
-#if defined(_ALLBSD_SOURCE)
+#if defined(_ALLBSD_SOURCE) || defined(__astral__)
typedef struct flock FLOCK;
#else
typedef struct flock64 FLOCK;
diff --git openjdk17-clean/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c openjdk17-workdir/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
index 3068f47..e2debec 100644
--- openjdk17-clean/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
+++ openjdk17-workdir/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c
@@ -280,7 +280,7 @@ static attach_state_t ptrace_attach(pid_t pid, char* err_buf, size_t err_buf_len
// GNU-specific: char *strerror_r(int errnum, char *buf, size_t buflen);
// XSI-compliant: int strerror_r(int errnum, char *buf, size_t buflen);
char buf[200];
-#if defined(__GLIBC__) && defined(_GNU_SOURCE)
+#if (defined(__GLIBC__) || defined(__astral__)) && defined(_GNU_SOURCE)
char* msg = strerror_r(errno, buf, sizeof(buf));
#else
int rc = strerror_r(errno, buf, sizeof(buf));
diff --git openjdk17-clean/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c openjdk17-workdir/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
index e33d9b4..39f784f 100644
--- openjdk17-clean/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
+++ openjdk17-workdir/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c
@@ -63,7 +63,7 @@
static jlong page_size = 0;
-#if defined(_ALLBSD_SOURCE) || defined(_AIX)
+#if defined(_ALLBSD_SOURCE) || defined(_AIX) || defined(__astral__)
#define MB (1024UL * 1024UL)
#else
@@ -235,7 +235,7 @@ Java_com_sun_management_internal_OperatingSystemImpl_getFreeMemorySize0
return -1;
}
return (jlong)vm_stats.free_count * page_size;
-#elif defined(_ALLBSD_SOURCE)
+#elif defined(_ALLBSD_SOURCE) || defined(__astral__)
/*
* XXBSDL no way to do it in FreeBSD
*/
@@ -276,6 +276,8 @@ Java_com_sun_management_internal_OperatingSystemImpl_getTotalMemorySize0
return (jlong)(memory_info.real_total * 4L * 1024L);
}
return -1;
+#elif defined(__astral__)
+ return (128 * MB);
#else // solaris / linux
jlong num_physical_pages = sysconf(_SC_PHYS_PAGES);
return (num_physical_pages * page_size);
+14 -2
View File
@@ -1,8 +1,8 @@
diff --git openssl-clean/Configurations/10-main.conf openssl-workdir/Configurations/10-main.conf
index 2a047ca..357fd04 100644
index 2fcb96a..02517f4 100644
--- openssl-clean/Configurations/10-main.conf
+++ openssl-workdir/Configurations/10-main.conf
@@ -192,6 +192,35 @@ my %targets = (
@@ -187,6 +187,35 @@ my %targets = (
thread_scheme => "(unknown)",
},
@@ -38,3 +38,15 @@ index 2a047ca..357fd04 100644
#### VOS Configurations
"vos-gcc" => {
inherit_from => [ "BASE_unix" ],
diff --git openssl-clean/test/v3ext.c openssl-workdir/test/v3ext.c
index 386135f..5f79492 100644
--- openssl-clean/test/v3ext.c
+++ openssl-workdir/test/v3ext.c
@@ -13,6 +13,7 @@
#include <openssl/pem.h>
#include <openssl/err.h>
#include "internal/nelem.h"
+#include <string.h>
#include "testutil.h"
+4 -2
View File
@@ -66,14 +66,16 @@ index 1137e83..bbdcb95 100644
diff --git shadow-clean/lib/user_busy.c shadow-workdir/lib/user_busy.c
index a622376..f0ef2a4 100644
index a622376..e6ab4c5 100644
--- shadow-clean/lib/user_busy.c
+++ shadow-workdir/lib/user_busy.c
@@ -24,6 +24,7 @@
@@ -24,6 +24,9 @@
#endif /* ENABLE_SUBIDS */
#include "shadowlog.h"
#include "string/sprintf.h"
+#include <utmpx.h>
+#include <signal.h>
+
#ifdef __linux__
+12
View File
@@ -1,3 +1,15 @@
diff --git sudo-clean/plugins/sudoers/auth/passwd.c sudo-workdir/plugins/sudoers/auth/passwd.c
index 7524ada..87d18e6 100644
--- sudo-clean/plugins/sudoers/auth/passwd.c
+++ sudo-workdir/plugins/sudoers/auth/passwd.c
@@ -33,6 +33,7 @@
#include <string.h>
#include <unistd.h>
#include <pwd.h>
+#include <crypt.h>
#include <sudoers.h>
#include "sudo_auth.h"
diff --git sudo-clean/plugins/sudoers/getspwuid.c sudo-workdir/plugins/sudoers/getspwuid.c
index dd5092d..319facd 100644
--- sudo-clean/plugins/sudoers/getspwuid.c
+13
View File
@@ -34,3 +34,16 @@ index 31f66b1..0244c96 100644
alarm_pending = FALSE;
}
diff --git vim-clean/src/time.c vim-workdir/src/time.c
index 62b38b4..a26dfea 100644
--- vim-clean/src/time.c
+++ vim-workdir/src/time.c
@@ -6,7 +6,7 @@
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
-
+#define _XOPEN_SOURCE
/*
* time.c: functions related to time and timers
*/
+3 -3
View File
@@ -60,7 +60,7 @@ index fe7464a..02f7a89 100755
if test "x$ac_cv_func_fstatfs" = xyes
then :
diff --git wine-clean/dlls/ntdll/unix/signal_x86_64.c wine-workdir/dlls/ntdll/unix/signal_x86_64.c
index caa8524..9f4448d 100644
index caa8524..9d35af1 100644
--- wine-clean/dlls/ntdll/unix/signal_x86_64.c
+++ wine-workdir/dlls/ntdll/unix/signal_x86_64.c
@@ -75,6 +75,10 @@
@@ -120,8 +120,8 @@ index caa8524..9f4448d 100644
+
+#elif defined(__astral__)
+ arch_ctl(ARCH_CTL_SET_GSBASE, teb);
+ arch_ctl(ARCH_CTL_GET_FSBASE, &thread_data->pthread_teb);
+ if (fs32_sel) alloc_fs_sel( fs32_sel >> 3, get_wow_teb( teb ));
+ //arch_ctl(ARCH_CTL_GET_FSBASE, &thread_data->pthread_teb);
+ //if (fs32_sel) alloc_fs_sel( fs32_sel >> 3, get_wow_teb( teb ));
#else
# error Please define setting %gs for your architecture
#endif
+24
View File
@@ -0,0 +1,24 @@
diff --git xneko-clean/xneko.c xneko-workdir/xneko.c
index 92a9e34..a81d0c1 100644
--- xneko-clean/xneko.c
+++ xneko-workdir/xneko.c
@@ -99,7 +99,9 @@
#include <signal.h>
#include <math.h>
#include <sys/time.h>
-
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#ifndef lint
static char
@@ -451,7 +453,7 @@ BitmapGCData BitmapGCDataTable[] =
&RightTogi1Xbm, rtogi1_bits, rtogi1_width, rtogi1_height },
{ &RightTogi2GC,
&RightTogi2Xbm, rtogi2_bits, rtogi2_width, rtogi2_height },
- { NULL, NULL, NULL, NULL, NULL }
+ { 0, 0, 0, 0, 0 }
};
typedef struct {
+27 -9
View File
@@ -25,10 +25,16 @@ index e4c4e09..272cd1c 100755
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
diff --git xterm-clean/main.c xterm-workdir/main.c
index 3d2ad4c..3f235d0 100644
index 3d2ad4c..92ff910 100644
--- xterm-clean/main.c
+++ xterm-workdir/main.c
@@ -92,6 +92,7 @@
@@ -89,9 +89,13 @@
#define RES_OFFSET(field) XtOffsetOf(XTERM_RESOURCE, field)
+#define _GNU_SOURCE
+#include <stdlib.h>
+
#include <xterm.h>
#include <version.h>
#include <graphics.h>
@@ -36,7 +42,7 @@ index 3d2ad4c..3f235d0 100644
/* xterm uses these X Toolkit resource names, which are exported in array */
#undef XtNborderWidth
@@ -172,7 +173,7 @@ static GCC_NORETURN void HsSysError(int);
@@ -172,7 +176,7 @@ static GCC_NORETURN void HsSysError(int);
#define KANJI
#endif
@@ -45,7 +51,7 @@ index 3d2ad4c..3f235d0 100644
#define USE_SYSV_PGRP
#define USE_SYSV_SIGNALS
#define WTMP
@@ -315,7 +316,7 @@ ttyslot(void)
@@ -315,7 +319,7 @@ ttyslot(void)
#ifndef NOFILE
#define NOFILE OPEN_MAX
#endif
@@ -54,7 +60,7 @@ index 3d2ad4c..3f235d0 100644
#include <sys/param.h> /* for NOFILE */
#endif
@@ -716,11 +717,12 @@ static struct {
@@ -716,11 +720,12 @@ static struct {
#endif
#ifndef TAB3
@@ -72,7 +78,7 @@ index 3d2ad4c..3f235d0 100644
#endif
#ifndef TABDLY
@@ -3011,7 +3013,7 @@ main(int argc, char *argv[]ENVP_ARG)
@@ -3011,7 +3016,7 @@ main(int argc, char *argv[]ENVP_ARG)
}
#endif
#endif
@@ -81,7 +87,7 @@ index 3d2ad4c..3f235d0 100644
if (0 > (mode = fcntl(screen->respond, F_GETFL, 0)))
SysError(ERROR_F_GETFL);
#ifdef O_NDELAY
@@ -3753,7 +3755,7 @@ ourValidShell(const char *pathname)
@@ -3753,7 +3758,7 @@ ourValidShell(const char *pathname)
return findValidShell(x_strtrim(resource.valid_shells), pathname);
}
@@ -90,7 +96,7 @@ index 3d2ad4c..3f235d0 100644
static Boolean
validShell(const char *pathname)
{
@@ -4356,7 +4358,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
@@ -4356,7 +4361,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
/*
* now in child process
*/
@@ -99,7 +105,7 @@ index 3d2ad4c..3f235d0 100644
int pgrp = setsid(); /* variable may not be used... */
#else
int pgrp = getpid();
@@ -4496,7 +4498,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
@@ -4496,7 +4501,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
/* make /dev/tty work */
ioctl(ttyfd, TCSETCTTY, 0);
#endif
@@ -108,6 +114,18 @@ index 3d2ad4c..3f235d0 100644
/* make /dev/tty work */
ioctl(ttyfd, TIOCSCTTY, 0);
#endif
diff --git xterm-clean/util.c xterm-workdir/util.c
index 4e609a2..f4d716f 100644
--- xterm-clean/util.c
+++ xterm-workdir/util.c
@@ -54,6 +54,7 @@
/* util.c */
+#define _GNU_SOURCE
#include <xterm.h>
#include <data.h>
diff --git xterm-clean/xterm.h xterm-workdir/xterm.h
index 89590cb..9a99f0c 100644
--- xterm-clean/xterm.h
+1 -1
View File
@@ -10,7 +10,7 @@ configure() {
}
build() {
make CC=x86_64-astral-gcc TERMINAL=YES DATADIR="/usr/share/games/brogue" RELEASE=YES GRAPHICS=NO LDLIBS=-ltinfow
CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration" make CC=x86_64-astral-gcc TERMINAL=YES DATADIR="/usr/share/games/brogue" RELEASE=YES GRAPHICS=NO LDLIBS=-ltinfow
}
package() {
+2 -2
View File
@@ -7,11 +7,11 @@ deps="base openssl zlib"
configure() {
cp -rpv ${source_dir}/* .
./configure --host=x86_64-astral --prefix=${prefix} --with-openssl --with-zlib --disable-ipv6 --with-ca-path=/etc/ssl/certs --disable-static
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration" ./configure --host=x86_64-astral --prefix=${prefix} --with-openssl --with-zlib --disable-ipv6 --with-ca-path=/etc/ssl/certs --disable-static
}
build() {
make -j ${parallelism}
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration" make -j ${parallelism}
}
package() {
+1 -1
View File
@@ -7,7 +7,7 @@ deps="base"
build() {
cp -rp ${source_dir}/doomgeneric/* .
make
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration" make
}
package() {
+1 -1
View File
@@ -8,7 +8,7 @@ deps="base libx11"
build() {
cp -rp ${source_dir}/doomgeneric/* .
cp -vp Makefile.x11 Makefile
make
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration -Wno-error=int-conversion" make
}
package() {
+1 -1
View File
@@ -6,7 +6,7 @@ hostdeps="xgcc xbinutils pkgconfig"
deps="base zlib openssl bzip2 libpng libxext freetype fontconfig libjpeg-turbo"
configure() {
CC=x86_64-astral-gcc ${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --enable-graphics --without-directfb --without-librsvg --with-bzip2 --with-X --x-includes=${sysroot_dir}/usr/include --x-libraries=${sysroot_dir}/usr/lib --with-zlib --with-openssl --without-libtiff --without-openmp --without-lzma --with-freetype --without-ipv6
CFLAGS="$CFLAGS -Wno-error=implicit-int" CC=x86_64-astral-gcc ${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --enable-graphics --without-directfb --without-librsvg --with-bzip2 --with-X --x-includes=${sysroot_dir}/usr/include --x-libraries=${sysroot_dir}/usr/lib --with-zlib --with-openssl --without-libtiff --without-openmp --without-lzma --with-freetype --without-ipv6
}
build() {
+1 -2
View File
@@ -8,8 +8,7 @@ deps="base bzip2 libxcrypt zlib libintl gettext"
configure() {
cp -rp ${source_dir}/* .
cp -rp /usr/local/share/perl-cross/* .
CFLAGS="${CFLAGS} -DNO_LOCALE" ./configure --target=x86_64-astral --prefix=${prefix} -Dvendorprefix=${prefix} --target-tools-prefix=x86_64-astral- --mode=cross --targetarch=x86_64-astral --sysroot=${sysroot_dir}
bash
CFLAGS="${CFLAGS} -DNO_LOCALE -Wno-error=implicit-function-declaration" ./configure --target=x86_64-astral --prefix=${prefix} -Dvendorprefix=${prefix} --target-tools-prefix=x86_64-astral- --mode=cross --targetarch=x86_64-astral --sysroot=${sysroot_dir}
}
build() {
+1 -1
View File
@@ -6,7 +6,7 @@ hostdeps="xgcc xbinutils pkgconfig automake autoconf util-macros libtool"
deps="base xorg-server"
configure() {
SYSROOT=${sysroot_dir} ${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --disable-static
CFLAGS="$CFLAGS -Wno-error=incompatible-pointer-types" SYSROOT=${sysroot_dir} ${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --disable-static
}
build() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=binutils
version=2.39
version=2.45.1
source_method=tarball
tarball_url="https://ftpmirror.gnu.org/binutils/binutils-${version}.tar.xz"
tarball_sha512="68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3"
tarball_sha512="ea030419eba387579ab717be7e3223fc99e93b586860b06003c12489f93441640d4082736f76aa5e98233db4f46e232f536a45e471486de1f5b64e1b827c167e"
hostdeps="autoconf automake"
prepare() {
+2 -2
View File
@@ -3,8 +3,8 @@ version=4.2
source_method=tarball
tarball_url="https://github.com/dosfstools/dosfstools/releases/download/v${version}/dosfstools-${version}.tar.gz"
tarball_sha512=3cc0808edb4432428df8a67da4bb314fd1f27adc4a05754c1a492091741a7b6875ebd9f6a509cc4c5ad85643fc40395b6e0cadee548b25cc439cc9b725980156
hostdeps="libtool"
hostdeps="automake"
prepare() {
libtoolize -f
cp -v $(find /usr/local/share/automake* -name config.sub) .
}
+2 -2
View File
@@ -1,8 +1,8 @@
name=frigg
version=98220ab8f3ac6b1f146c360598a334f7f1fc06e1
version=a07d90225def2c6177f0cc271bfff62e466b04eb
source_method=tarball
tarball_url="https://github.com/managarm/frigg/archive/${version}.tar.gz"
tarball_sha512=ce24773d6fbcdd2b894c4ea600ac96f9c4d6a503f8dcf94c4e7f5309ef5ae9688a1f2d3d84c01ca2a031eb48d9619432a86c57e7bd0666ac4bef5a948d8813d8
tarball_sha512=c4bf752a26233bd4b57a8bf4abe3d78c9dd5193d8dc2f9d86ea5f9c9f0f9220eccf73b95016cd22b807501ad46c9cfd0e22e86b157f5bf64c1a8e158dd2c6b53
prepare() {
true
+2 -2
View File
@@ -1,8 +1,8 @@
name=gcc
version=12.1.0
version=14.3.0
source_method=tarball
tarball_url="https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz"
tarball_sha512="2121d295292814a6761edf1fba08c5f633ebe16f52b80e7b73a91050e71e1d2ed98bf17eebad263e191879561c02b48906c53faa4c4670c486a26fc75df23900"
tarball_sha512="cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93"
hostdeps="automake autoconf"
prepare() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=mlibc
version=54a131411151696afab9acf7268a695dff0fd392
version=774251b74b11a7fe4d3fce9ea45d2e9c56e1f478
source_method=tarball
tarball_url="https://github.com/managarm/mlibc/archive/${version}.tar.gz"
tarball_sha512="7ededaeee170d8ba35249c0677572bb94f48ae56af01b24aed1add09ac520a2726360b353c2827889d338455a8d0bb36f5fd0b4680152b7cf6a6ef4685d3999b"
tarball_sha512="0373862e379c4eff992a77ba2b12fe74840c210318045b1f3bbfe061b33a3a873630cc2bac5692f00ff7e111505fc7e310beb02664ae6038418469e3461f7c02"
prepare() {
true
+2 -2
View File
@@ -1,8 +1,8 @@
name=openjdk17
version=17.0.35
source_method=tarball
tarball_url="https://github.com/openjdk/jdk17/archive/refs/tags/jdk-17+35.tar.gz"
tarball_sha512=c43fea864059ec2e5ca8c9ac96253cf429359774105842353c413a3bf0f4a348d6a2a4948f3a5a9af83667b0312b066002d5d5efa8234a37e2370b14ed6733df
tarball_url="https://github.com/openjdk/jdk17u/archive/refs/tags/jdk-17.0.17+10.tar.gz"
tarball_sha512=f2c9c32c2b0d6b1e1f257d1633a27fd107912db5d184bb79c78a41b539db11a1edc602c212bf7589ee3310ff56425f3127cad608bf32873d18c35e20086deedd
hostdeps="autoconf automake pkgconfig libtool"
prepare() {
cp -v $(find /usr/local/share/automake* -name config.sub) make/autoconf/build-aux/
+1 -1
View File
@@ -1,7 +1,7 @@
name=openssh
version=9.7p1
source_method=tarball
tarball_url="https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${version}.tar.gz"
tarball_url="https://cloudflare.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${version}.tar.gz"
tarball_sha512="0cafc17d22851605a4a5495a1d82c2b3fbbe6643760aad226dbf2a25b5f49d4375c3172833706ea3cb6c05d5d02a40feb9a7e790eae5c4570dd344a43e94ca55"
hostdeps="autoconf automake pkgconfig libtool"
prepare() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=xf86-input-mouse
version=1.9.4
source_method=tarball
tarball_url="https://xorg.freedesktop.org/archive/individual/driver/xf86-input-mouse-${version}.tar.gz"
tarball_sha512=31c23fa6fe7f77707b6eeb61e8d928b0fe8ffb49c3a5ddda36e36d48d20618c438580c573c5d9e40bc32d28612dd60886b3fff983aafd90b20a198b14c228587
tarball_url="https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse/-/archive/xf86-input-mouse-1.9.4/xf86-input-mouse-xf86-input-mouse-1.9.4.tar.gz"
tarball_sha512=50b9c57bac762bbebf644af8f2220b69eb13de99df12e6d69feed93feb86d3f079e809b2f2d0f45514248005b411f6a817b003610470de920f3b92927a9bf8e8
hostdeps="autoconf automake libtool pkgconfig util-macros"
prepare() {
autoreconf -fvi
+2 -2
View File
@@ -1,8 +1,8 @@
name=xf86-video-fbdev
version=0.5.0
source_method=tarball
tarball_url="https://www.x.org/pub/individual/driver/xf86-video-fbdev-${version}.tar.bz2"
tarball_sha512="c1217b943bbe3301b3c2a8649ed1004c3c67b02607bd56bbc14f6dfa05e7f0184332c81a6a19595514745501ed88526aee932e555779b7c3a8233646b0979448"
tarball_url="https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/archive/xf86-video-fbdev-0.5.0/xf86-video-fbdev-xf86-video-fbdev-0.5.0.tar.gz"
tarball_sha512="a49e5d2a53ed635d14bc675af5e0c9b42eac42446518a552a0c181fbbe06e5e7dc6d360cd8c7ba9366b8ad66ff3fb05cdd14d0525ae098363bba4a6bbfd8dac1"
hostdeps="autoconf automake libtool pkgconfig util-macros"
prepare() {
autoreconf -fvi
+2 -2
View File
@@ -1,8 +1,8 @@
name=xfontalias
version=1.0.5
source_method=tarball
tarball_url="https://www.x.org/pub/individual/font/font-alias-${version}.tar.xz"
tarball_sha512="86bffa6b9ff789eeba715c079965157806ed633d44cd3dbf5e2a4bba2b390a0f48db65edc8e3264acbc2368d78a8d7e05bc2e2e3a86ddbf6b08bfe7f5e862bcc"
tarball_url="https://gitlab.freedesktop.org/xorg/font/alias/-/archive/font-alias-1.0.5/alias-font-alias-1.0.5.tar.gz?ref_type=tags"
tarball_sha512="497a4204ca9e7112d74b40f38cc0369d7a7fee44000c87a48148b581db80b07ddacf7103148bf39430435c4162b6e1fbad9766d9ee342b994d9b5c5c33535245"
hostdeps="automake autoconf libtool pkgconfig util-macros fontutil"
prepare() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=xfontmiscethipic
version=1.0.5
source_method=tarball
tarball_url="https://www.x.org/pub/individual/font/font-misc-ethiopic-${version}.tar.xz"
tarball_sha512="7732a828c005e3762b6383729134c5656fd575ac59288504d047fbe26e9965a80519a37b0cc4c6b89379a85a62160c5ea76017f790447a230c015aa7a9143ba0"
tarball_url="https://gitlab.freedesktop.org/xorg/font/misc-ethiopic/-/archive/font-misc-ethiopic-1.0.5/misc-ethiopic-font-misc-ethiopic-1.0.5.tar.gz"
tarball_sha512="fd01b73e775387993aff3dd6179e385440d0c6bafa4a3fa9afedb6e2f4a8fde1cb0e952f39bda7a53faa17a1709090e4570dc81e5451ab8944b17c5404a74e5a"
hostdeps="automake autoconf libtool pkgconfig util-macros fontutil"
prepare() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=xfontmiscmisc
version=1.1.3
source_method=tarball
tarball_url="https://www.x.org/archive//individual/font/font-misc-misc-${version}.tar.xz"
tarball_sha512="fac4bfda0e4189d1a9999abc47bdd404f2beeec5301da190d92afc2176cd344789b7223c1b2f4748bd0efe1b9a81fa7f13f7037015d5d800480fa2236f369b48"
tarball_url="https://gitlab.freedesktop.org/xorg/font/misc-misc/-/archive/font-misc-misc-1.1.3/misc-misc-font-misc-misc-1.1.3.tar.gz?ref_type=tags"
tarball_sha512="9d1ec911e0f9048423ea3ce684378c1c9a732fddb32c7ffd0059af4138a0d52c9d8dcde4403ab5923860b4ce0c935a7be813368f1fe1845421c7669d1631c112"
hostdeps="automake autoconf libtool pkgconfig util-macros fontutil"
prepare() {
+2 -2
View File
@@ -1,8 +1,8 @@
name=xrandr
version=1.5.1
source_method=tarball
tarball_url="https://www.x.org/pub/individual/app/xrandr-${version}.tar.xz"
tarball_sha512="3d0d37e974b9dffb996276ee7fd676327fd0956e5f5f572dd142a651a35d3cdfa2f6dd415cf27bf87f306981957aba4cc014c12baebefcabaa5d66b78a114922"
tarball_url="https://gitlab.freedesktop.org/xorg/app/xrandr/-/archive/xrandr-1.5.1/xrandr-xrandr-1.5.1.tar.gz?ref_type=tags"
tarball_sha512="47501581cc40bc654b008b37abbb03a840c6977e0020666c55f30621e51fa4e36f8fce86ac1f57a4866e68a121a17bb9f3d6bc3753458ab8fa187e3d2fd8d1c8"
hostdeps="autoconf automake util-macros pkgconfig libtool"
prepare() {
autoreconf -fvi