bochs: 2.6.11 -> 2.7 (#132848)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Anderson Torres 2021-08-06 05:09:22 -03:00 committed by GitHub
parent 585bf4039a
commit a0e731154d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 85 deletions

View file

@ -1,13 +0,0 @@
diff -Naur bochs-2.6.10.orig/iodev/network/slirp/slirp.h bochs-2.6.10.mod/iodev/network/slirp/slirp.h
--- bochs-2.6.10.orig/iodev/network/slirp/slirp.h 2019-11-02 16:30:39.843938000 -0300
+++ bochs-2.6.10.mod/iodev/network/slirp/slirp.h 2019-12-29 12:55:49.541630697 -0300
@@ -44,8 +44,8 @@
#endif
#include <sys/types.h>
-#if defined(__OpenBSD__) || defined(__linux__)
#include <stdint.h>
+#if defined(__OpenBSD__) || defined(__linux__)
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_BITYPES_H

View file

@ -1,29 +0,0 @@
------------------------------------------------------------------------
r13882 | vruppert | 2020-06-09 09:30:01 +0200 (Tue, 09 Jun 2020) | 2 lines
Compilation fix for MSYS2 gcc 10.1.0 (narrowing conversion).
Index: iodev/display/voodoo_data.h
===================================================================
--- a/iodev/display/voodoo_data.h (revision 13881)
+++ b/iodev/display/voodoo_data.h (revision 13882)
@@ -1837,11 +1837,11 @@
/* fifo content defines */
#define FIFO_TYPES (7 << 29)
-#define FIFO_WR_REG (1 << 29)
-#define FIFO_WR_TEX (2 << 29)
-#define FIFO_WR_FBI_32 (3 << 29)
-#define FIFO_WR_FBI_16L (4 << 29)
-#define FIFO_WR_FBI_16H (5 << 29)
+#define FIFO_WR_REG (1U << 29)
+#define FIFO_WR_TEX (2U << 29)
+#define FIFO_WR_FBI_32 (3U << 29)
+#define FIFO_WR_FBI_16L (4U << 29)
+#define FIFO_WR_FBI_16H (5U << 29)
BX_CPP_INLINE void fifo_reset(fifo_state *f)
{
------------------------------------------------------------------------

View file

@ -20,22 +20,13 @@
stdenv.mkDerivation rec {
pname = "bochs";
version = "2.6.11";
version = "2.7";
src = fetchurl {
url = "mirror://sourceforge/project/bochs/bochs/${version}/${pname}-${version}.tar.gz";
sha256 = "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3";
url = "mirror://sourceforge/project/bochs/bochs/${version}/bochs-${version}.tar.gz";
hash = "sha256-oBCrG/3HKsWgjS4kEs1HHA/r1mrx2TSbwNeWh53lsXo=";
};
patches = [
# A flip between two lines of code, in order to compile with GLIBC 2.26
./bochs-2.6.11-glibc-2.26.patch
# Fix compilation for MSYS2 GCC 10; remove it when the next version arrives
./bochs_fix_narrowing_conv_warning.patch
# SMP-enabled configs; remove it when the next version arrives
./fix-build-smp.patch
];
nativeBuildInputs = [
docbook_xml_dtd_45
docbook_xsl
@ -62,7 +53,6 @@ stdenv.mkDerivation rec {
"--with-rfb=no"
"--with-vncsrv=no"
"--with-svga=no" # it doesn't compile on NixOS
# These will always be "yes" on NixOS
"--enable-ltdl-install=yes"
@ -92,7 +82,6 @@ stdenv.mkDerivation rec {
"--enable-cpu-level=6" # from 3 to 6
"--enable-debugger" #conflicts with gdb-stub option
"--enable-debugger-gui"
"--enable-disasm"
"--enable-e1000"
"--enable-es1370"
"--enable-evex"
@ -105,7 +94,7 @@ stdenv.mkDerivation rec {
"--enable-largefile"
"--enable-ne2000"
"--enable-pci"
"--enable-plugins=no" # Plugins are a bit buggy in Bochs
"--enable-plugins=yes"
"--enable-pnic"
"--enable-repeat-speedups"
"--enable-sb16"
@ -126,11 +115,6 @@ stdenv.mkDerivation rec {
++ lib.optionals (ncurses != null) [ "--with-term" ]
++ lib.optionals (gtk2 != null && wxGTK != null) [ "--with-wx" ];
NIX_CFLAGS_COMPILE="-I${gtk2.dev}/include/gtk-2.0/ -I${libtool}/include/";
NIX_LDFLAGS="-L${libtool.lib}/lib";
hardeningDisable = [ "format" ];
enableParallelBuilding = true;
meta = with lib; {
@ -146,5 +130,5 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
};
}
# TODO: plugins
# TODO: a better way to organize the options
# TODO: docbook (install docbook-tools from RedHat mirrors can help)

View file

@ -1,21 +0,0 @@
Description: A fix for SMP-enable configurations
Inspired in: https://sourceforge.net/p/bochs/code/13778/
============
diff -Naur bochs-2.6.11-old/bx_debug/dbg_main.cc bochs-2.6.11-new/bx_debug/dbg_main.cc
--- bochs-2.6.11-old/bx_debug/dbg_main.cc 2019-12-20 04:57:59.818924000 -0300
+++ bochs-2.6.11-new/bx_debug/dbg_main.cc 2020-03-30 23:20:29.402195707 -0300
@@ -1494,11 +1494,11 @@
{
char cpu_param_name[16];
- Bit32u index = BX_ITLB_INDEX_OF(laddr);
+ Bit32u index = BX_CPU(dbg_cpu)->ITLB.get_index_of(laddr);
sprintf(cpu_param_name, "ITLB.entry%d", index);
bx_dbg_show_param_command(cpu_param_name, 0);
- index = BX_DTLB_INDEX_OF(laddr, 0);
+ index = BX_CPU(dbg_cpu)->DTLB.get_index_of(laddr);
sprintf(cpu_param_name, "DTLB.entry%d", index);
bx_dbg_show_param_command(cpu_param_name, 0);
}

View file

@ -2043,7 +2043,9 @@ in
boca = callPackage ../development/libraries/boca { };
bochs = callPackage ../applications/virtualization/bochs { };
bochs = callPackage ../applications/virtualization/bochs {
wxGTK = wxGTK30;
};
bubblewrap = callPackage ../tools/admin/bubblewrap { };