commit 1f3775e252cea7dfb72f931ac5f46c999299523f
Author: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
Date: Fri Aug 28 11:30:14 2020 +0900
Don't mark pointers to be modified as const (bug 5663)
Disable lto for now
...on-t-mark-pointer-to-be-modified-as-const.patch | 59 ++++++++++++++++++++++
dosemu.spec | 17 ++++++-
2 files changed, 74 insertions(+), 2 deletions(-)
---
diff --git a/0001-memory.h-don-t-mark-pointer-to-be-modified-as-const.patch
b/0001-memory.h-don-t-mark-pointer-to-be-modified-as-const.patch
new file mode 100644
index 0000000..304fc5b
--- /dev/null
+++ b/0001-memory.h-don-t-mark-pointer-to-be-modified-as-const.patch
@@ -0,0 +1,59 @@
+From e8c7950a17b7821eff628e191727b13869cddbb2 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
+Date: Sun, 23 Aug 2020 16:21:55 +0900
+Subject: [PATCH] memory.h: don't mark pointer to be modified as const
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1866474
+https://bugzilla.rpmfusion.org/show_bug.cgi?id=5663
+
+Pointers to be modified cannot be declared as "const *". gcc10 defaults to
-fno-common,
+and with this flag, trying to modify "const *" pointer variable causes
segfault.
+---
+ src/arch/linux/mapping/mapping.c | 4 ++--
+ src/include/memory.h | 7 ++-----
+ 2 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/src/arch/linux/mapping/mapping.c b/src/arch/linux/mapping/mapping.c
+index 1d6c0725..19055434 100644
+--- a/src/arch/linux/mapping/mapping.c
++++ b/src/arch/linux/mapping/mapping.c
+@@ -47,8 +47,8 @@ static int kmem_mappings = 0;
+ static struct mem_map_struct kmem_map[MAX_KMEM_MAPPINGS];
+
+ static int init_done = 0;
+-unsigned char * const mem_base;
+-char * const lowmem_base;
++unsigned char * mem_base;
++char * lowmem_base;
+
+ static struct mappingdrivers *mappingdrv[] = {
+ #ifdef HAVE_SHM_OPEN
+diff --git a/src/include/memory.h b/src/include/memory.h
+index a5d6e96a..3d362a07 100644
+--- a/src/include/memory.h
++++ b/src/include/memory.h
+@@ -213,7 +213,7 @@ void *lowmemp(const void *ptr);
+ restrictions it can be non-zero. Non-zero values block vm86 but at least
+ give NULL pointer protection.
+ */
+-extern unsigned char * const mem_base;
++extern unsigned char * mem_base;
+
+ /* lowmem_base points to a shared memory image of the area 0--1MB+64K.
+ It does not have any holes or mapping for video RAM etc.
+@@ -221,11 +221,8 @@ extern unsigned char * const mem_base;
+ DOSEMU writes will not be trapped. This allows easy interference with
+ simx86, NULL page protection, and removal of the VGA protected memory
+ access hack.
+-
+- It is set "const" to help GCC optimize accesses. In reality it is set only
+- once, at startup
+ */
+-extern char * const lowmem_base;
++extern char * lowmem_base;
+
+ #define UNIX_READ_BYTE(addr) (*(Bit8u *) (addr))
+ #define UNIX_WRITE_BYTE(addr, val) (*(Bit8u *) (addr) = (val) )
+--
+2.26.2
+
diff --git a/dosemu.spec b/dosemu.spec
index 66271be..fdb9ef1 100644
--- a/dosemu.spec
+++ b/dosemu.spec
@@ -1,6 +1,6 @@
Name: dosemu
Version: 1.4.0.8
-Release: 27.20131022git%{?dist}
+Release: 28.20131022git%{?dist}
Summary: DOS Emulator for Linux
URL:
http://dosemu.sf.net
License: GPLv2+
@@ -20,6 +20,11 @@ License: GPLv2+
Source: %{name}-%{version}.tgz
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1866474
+#
https://bugzilla.rpmfusion.org/show_bug.cgi?id=5663
+# memory.h: don't mark pointer to be modified as const
+Patch0: 0001-memory.h-don-t-mark-pointer-to-be-modified-as-const.patch
+
# Made a FreeDOS bootable image, must be done manually.
Source1: %{name}-freedos-bin.tgz
@@ -58,8 +63,12 @@ programs forever!
%prep
-%autosetup
+%autosetup -p1
+# lto doesn't seem to work:
+# DEBUG: /usr/bin/ld: /tmp/dosemu.bin.1hmolM.ltrans0.ltrans.o: in function
`stub_rep__':
+# DEBUG: <artificial>:(.text+0xe): undefined reference to `rep_movs_stos'
+%define _lto_cflags %{nil}
%build
%configure --with-fdtarball=%{SOURCE1}
@@ -110,6 +119,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%changelog
+* Sun Aug 23 2020 Mamoru TASAKA <mtasaka(a)fedoraproject.org> -
1.4.0.8-28.20131022git
+- Don't mark pointers to be modified as const (bug 5663)
+- Disable lto for now
+
* Mon Aug 17 2020 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
1.4.0.8-27.20131022git
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild