diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 2a0211496bd..4a94f5cff75 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -284,7 +284,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`pt2-clone`](pt2-clone/) | ProTracker 2 clone | 1.63 | https://github.com/8bitbubsy/pt2-clone | | [`pv`](pv/) | Pipe Viewer | 1.12.0 | http://www.ivarch.com/programs/pv.shtml | | [`python3`](python3/) | Python | 3.15.0 | https://www.python.org/ | -| [`qemu`](qemu/) | QEMU | 8.1.3 | https://qemu.org | +| [`qemu`](qemu/) | QEMU | 11.1.2 | https://qemu.org | | [`qoi`](qoi/) | Quite OK Image Format for fast, lossless image compression | 351450e | https://github.com/phoboslab/qoi | | [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake | | [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/shamazmazum/quake2sdl | diff --git a/Ports/qemu/package.sh b/Ports/qemu/package.sh index 4e3b65160d9..b038a9deef7 100755 --- a/Ports/qemu/package.sh +++ b/Ports/qemu/package.sh @@ -6,11 +6,9 @@ port='qemu' version="${QEMU_VERSION}" useconfigure='true' configopts=( - '--target-list=aarch64-softmmu,i386-softmmu,riscv64-softmmu,x86_64-softmmu' + '--target-list=aarch64-softmmu,riscv64-softmmu,x86_64-softmmu' "--cross-prefix=${SERENITY_ARCH}-serenity-" - '--extra-ldflags=-lm' '--without-default-features' - '--disable-strip' '--enable-pie' '--enable-sdl' '--enable-slirp' @@ -36,7 +34,7 @@ post_install() { # Add a drop-in fstab entry to make sure that we can use anonymous executable memory and bypass W^X mkdir -p "${SERENITY_INSTALL_ROOT}/etc/fstab.d" rm -rf "${SERENITY_INSTALL_ROOT}/etc/fstab.d/qemu" - for i in /usr/local/bin/qemu-system-{aarch64,i386,riscv64,x86_64}; do + for i in /usr/local/bin/qemu-system-{aarch64,riscv64,x86_64}; do echo "${i} ${i} bind bind,wxallowed,axallowed" >> "${SERENITY_INSTALL_ROOT}/etc/fstab.d/qemu" done } diff --git a/Ports/qemu/patches/0001-Add-build-system-support-for-SerenityOS.patch b/Ports/qemu/patches/0001-Add-build-system-support-for-SerenityOS.patch index f322591795c..b5e738ca2b1 100644 --- a/Ports/qemu/patches/0001-Add-build-system-support-for-SerenityOS.patch +++ b/Ports/qemu/patches/0001-Add-build-system-support-for-SerenityOS.patch @@ -4,37 +4,33 @@ Date: Thu, 5 May 2022 18:49:17 +0200 Subject: [PATCH] Add build system support for SerenityOS --- - configure | 6 ++++++ - 1 file changed, 6 insertions(+) + configure | 2 ++ + meson.build | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure -index 133f4e3235125222083bf77368ea714b7cc0b703..004e2d5893a4834d4cc209ce4c0f91978b89422f 100755 +index 6ddfe4b5342805d9c6a7ae9480a084d4dc1e7d98..ee772d0076a55183388cc2030581e2ed9466e27e 100755 --- a/configure +++ b/configure -@@ -365,6 +365,8 @@ elif check_define __NetBSD__; then - targetos=netbsd - elif check_define __APPLE__; then - targetos=darwin -+elif check_define __serenity__; then -+ targetos=serenity +@@ -373,6 +373,8 @@ elif check_define EMSCRIPTEN ; then + cross_compile="yes" + elif check_define __GNU__; then + host_os=gnu ++elif check_define __serenity__ ; then ++ host_os=serenity else # This is a fatal error, but don't report it yet, because we # might be going to just print the --help text, or it might -@@ -378,6 +380,7 @@ mingw32="no" - bsd="no" - linux="no" - solaris="no" -+serenity="no" - case $targetos in - windows) - mingw32="yes" -@@ -413,6 +416,9 @@ haiku) - linux) - linux="yes" - ;; -+serenity) -+ serenity="yes" -+;; - esac - - if test ! -z "$cpu" ; then +diff --git a/meson.build b/meson.build +index 40e3f4ec44c8d36c44ec505bc4f54cbe5724ea73..69777176b2ced3e66b92bf244595d76012cd2ba2 100644 +--- a/meson.build ++++ b/meson.build +@@ -1371,7 +1371,7 @@ spice_headers = spice.partial_dependency(compile_args: true, includes: true) + rt = not_found + if host_os != 'windows' + have_shm_open = cc.has_function('shm_open') +- if not have_shm_open ++ if not have_shm_open and host_os != 'serenity' + rt = cc.find_library('rt', required: true) + endif + endif diff --git a/Ports/qemu/patches/0002-Extend-short-scan-sets-into-the-full-list.patch b/Ports/qemu/patches/0002-Extend-short-scan-sets-into-the-full-list.patch index 247f7d0f73a..b1a16f275e7 100644 --- a/Ports/qemu/patches/0002-Extend-short-scan-sets-into-the-full-list.patch +++ b/Ports/qemu/patches/0002-Extend-short-scan-sets-into-the-full-list.patch @@ -10,10 +10,10 @@ sets, so extend them into a full list manually. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chardev/char.c b/chardev/char.c -index 661ad8176a982c641531cdab8e05c3815504cc2f..c9f701ffc59837a0480bb56c63d5f8ef7ee022e6 100644 +index 22e5bae388ad085568f624747cf94285877c0f34..1be8b28fdece9c783a63b7f77a7a45efda84a656 100644 --- a/chardev/char.c +++ b/chardev/char.c -@@ -383,11 +383,11 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename, +@@ -430,11 +430,11 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename, if (strstart(filename, "vc", &p)) { qemu_opt_set(opts, "backend", "vc", &error_abort); if (*p == ':') { diff --git a/Ports/qemu/patches/0003-Use-the-coarse-monotonic-clock-for-timing-CPU-ticks.patch b/Ports/qemu/patches/0003-Use-the-coarse-monotonic-clock-for-timing-CPU-ticks.patch index 5b232e8cbe1..ca5b2a2ce5e 100644 --- a/Ports/qemu/patches/0003-Use-the-coarse-monotonic-clock-for-timing-CPU-ticks.patch +++ b/Ports/qemu/patches/0003-Use-the-coarse-monotonic-clock-for-timing-CPU-ticks.patch @@ -13,10 +13,10 @@ HPET timer read for each tick. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h -index 9a91cb1248a29d884cd3ddc8806e8c7eb922bd21..fec731a3811f57d2a5d9b56bc1f5fee2d2e7365e 100644 +index 9a62ac8cded11cc5c538117bda6826d33ff3cc76..bb6b56ec19c6a601a0f1cded426d2beba51aee10 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h -@@ -833,7 +833,7 @@ static inline int64_t get_clock(void) +@@ -839,7 +839,7 @@ static inline int64_t get_clock(void) { if (use_rt_clock) { struct timespec ts; diff --git a/Ports/qemu/patches/0004-file-posix-Include-the-correct-file-for-ioctl-on-Ser.patch b/Ports/qemu/patches/0004-file-posix-Include-the-correct-file-for-ioctl-on-Ser.patch index fced56fdeb6..1d3dce94199 100644 --- a/Ports/qemu/patches/0004-file-posix-Include-the-correct-file-for-ioctl-on-Ser.patch +++ b/Ports/qemu/patches/0004-file-posix-Include-the-correct-file-for-ioctl-on-Ser.patch @@ -8,10 +8,10 @@ Subject: [PATCH] file-posix: Include the correct file for ioctl on SerenityOS 1 file changed, 4 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c -index 7f540b03ed4f3e3ea87288cda485fee8c809c34c..b034080300923f4a1acfbfc7ac1595ca93c3ece4 100644 +index 3c985da94f563be9463b05c3573ac95e2d726f06..ce0d3343d7e43c8221436be76aa6ae262fda7648 100644 --- a/block/file-posix.c +++ b/block/file-posix.c -@@ -110,6 +110,10 @@ +@@ -109,6 +109,10 @@ #include #endif diff --git a/Ports/qemu/patches/0005-util-Disable-POSIX-shared-memory-on-SerenityOS.patch b/Ports/qemu/patches/0005-util-Disable-POSIX-shared-memory-on-SerenityOS.patch new file mode 100644 index 00000000000..b871cd36e48 --- /dev/null +++ b/Ports/qemu/patches/0005-util-Disable-POSIX-shared-memory-on-SerenityOS.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Linus Groh +Date: Wed, 14 Oct 2026 17:40:14 +0200 +Subject: [PATCH] util: Disable POSIX shared memory on SerenityOS + +--- + util/oslib-posix.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/util/oslib-posix.c b/util/oslib-posix.c +index dc001da66dd484acdce9de5e69c2b743e3e74a4d..394cee8d1c02a3810d67e8c01470fad71e3b637e 100644 +--- a/util/oslib-posix.c ++++ b/util/oslib-posix.c +@@ -984,6 +984,10 @@ void qemu_close_all_open_fd(const int *skip, unsigned int nskip) + + int qemu_shm_alloc(size_t size, Error **errp) + { ++#ifdef __serenity__ ++ error_setg(errp, "POSIX shared memory is not supported on SerenityOS"); ++ return -1; ++#else + g_autoptr(GString) shm_name = g_string_new(NULL); + int fd, oflag, cur_sequence; + static int sequence; +@@ -1032,4 +1036,5 @@ int qemu_shm_alloc(size_t size, Error **errp) + } + + return fd; ++#endif + } diff --git a/Ports/qemu/patches/ReadMe.md b/Ports/qemu/patches/ReadMe.md index 210ebfbf1d9..d19b2b645ed 100644 --- a/Ports/qemu/patches/ReadMe.md +++ b/Ports/qemu/patches/ReadMe.md @@ -27,3 +27,8 @@ HPET timer read for each tick. file-posix: Include the correct file for ioctl on SerenityOS +## `0005-util-Disable-POSIX-shared-memory-on-SerenityOS.patch` + +util: Disable POSIX shared memory on SerenityOS + + diff --git a/Ports/qemu/version.sh b/Ports/qemu/version.sh index f2143fbb400..3aaa1075221 100644 --- a/Ports/qemu/version.sh +++ b/Ports/qemu/version.sh @@ -1,4 +1,4 @@ -QEMU_VERSION="8.1.3" +QEMU_VERSION="11.1.2" QEMU_ARCHIVE="qemu-${QEMU_VERSION}.tar.xz" QEMU_ARCHIVE_URL="https://download.qemu.org/${QEMU_ARCHIVE}" -QEMU_ARCHIVE_SHA256SUM="43cc176804105586f74f90398f34e9f85787dff400d3b640d81f7779fbe265bb" +QEMU_ARCHIVE_SHA256SUM="731b5681e4bb18be313231579b8efd0296c5b015fa36dc533874b639ba838016"