From d6ec6a408b68fc70df16b28fb150a6746fff6a24 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Jun 05 2018 20:27:08 +0000 Subject: fixing various build issues --- diff --git a/mono-4.8.0-aarch64-glibc-2.26.patch b/mono-4.8.0-aarch64-glibc-2.26.patch deleted file mode 100644 index b11521e..0000000 --- a/mono-4.8.0-aarch64-glibc-2.26.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up mono-4.8.0/mono/utils/mono-context.c.than mono-4.8.0/mono/utils/mono-context.c ---- mono-4.8.0/mono/utils/mono-context.c.than 2017-09-20 20:58:53.854625078 +0200 -+++ mono-4.8.0/mono/utils/mono-context.c 2017-09-20 22:53:40.863538894 +0200 -@@ -387,7 +387,11 @@ mono_sigctx_to_monoctx (void *sigctx, Mo - mctx->pc = UCONTEXT_REG_PC (sigctx); - mctx->regs [ARMREG_SP] = UCONTEXT_REG_SP (sigctx); - #ifdef __linux__ -+#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 26))) -+ struct fpsimd_context *fpctx = (struct fpsimd_context*)&((ucontext_t*)sigctx)->uc_mcontext.__glibc_reserved1; -+#else - struct fpsimd_context *fpctx = (struct fpsimd_context*)&((ucontext_t*)sigctx)->uc_mcontext.__reserved; -+#endif - int i; - - g_assert (fpctx->head.magic == FPSIMD_MAGIC); diff --git a/mono-4.8.0-sysmacros.patch b/mono-4.8.0-sysmacros.patch new file mode 100644 index 0000000..92e559a --- /dev/null +++ b/mono-4.8.0-sysmacros.patch @@ -0,0 +1,10 @@ +--- a/mono/io-layer/processes.c 2017-03-15 09:36:22.000000000 +0000 ++++ b/mono/io-layer/processes.c 2018-06-05 19:58:57.657838748 +0000 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #ifdef HAVE_SIGNAL_H + #include diff --git a/mono-4.8.0-terminfo.patch b/mono-4.8.0-terminfo.patch new file mode 100644 index 0000000..ffc9817 --- /dev/null +++ b/mono-4.8.0-terminfo.patch @@ -0,0 +1,139 @@ +diff --git a/mcs/class/corlib/System/TermInfoReader.cs b/mcs/class/corlib/System/TermInfoReader.cs +index a171706add61..2be4627e7910 100644 +--- a/mcs/class/corlib/System/TermInfoReader.cs ++++ b/mcs/class/corlib/System/TermInfoReader.cs +@@ -32,7 +32,8 @@ + using System.Text; + namespace System { + // This class reads data from a byte array or file containing the terminfo capabilities +- // information for any given terminal. The maximum allowed size is 4096 bytes. ++ // information for any given terminal. The maximum allowed size is 4096 (or ++ // 32768 for terminfo2) bytes. + // + // Terminfo database files are divided in the following sections: + // +@@ -45,7 +46,7 @@ namespace System { + // + // The header is as follows: + // +- // Magic number (0x1 and 0x1A) ++ // Magic number (0x11A/0432 or 0x21e/01036 for terminfo2) + // Terminal names size + // Boolean section size + // Numeric section size +@@ -58,8 +59,9 @@ namespace System { + // The boolean capabilities section has bytes that are set to 1 if the capability is supported + // and 0 otherwise. If the index of a capability is greater than the section size, 0 is assumed. + // +- // The numeric capabilities section holds 2-byte integers in little endian format. No negative +- // values are allowed and the absence of a capability is marked as two 0xFF. ++ // The numeric capabilities section holds 2-byte integers (4-byte integers for terminfo2) in ++ // little endian format. No negative values are allowed and the absence of a capability is marked ++ // as two 0xFF (four 0xFF for terminfo2). + // + // The string offsets section contains 2-byte integer offsets into the string capabilies section. + // If the capability is not supported, the index will be two 0xFF bytes. +@@ -72,17 +74,17 @@ namespace System { + // + + class TermInfoReader { +- //short nameSize; +- short boolSize; +- short numSize; +- short strOffsets; +- //short strSize; ++ int boolSize; ++ int numSize; ++ int strOffsets; + + //string [] names; // Last one is the description + byte [] buffer; + int booleansOffset; + //string term; + ++ int intOffset; ++ + public TermInfoReader (string term, string filename) + { + using (FileStream st = File.OpenRead (filename)) { +@@ -114,12 +116,21 @@ public TermInfoReader (string term, byte [] buffer) + // get { return term; } + // } + ++ void DetermineVersion (short magic) ++ { ++ if (magic == 0x11a) ++ intOffset = 2; ++ else if (magic == 0x21e) ++ intOffset = 4; ++ else ++ throw new Exception (String.Format ("Magic number is unexpected: {0}", magic)); ++ } ++ + void ReadHeader (byte [] buffer, ref int position) + { + short magic = GetInt16 (buffer, position); + position += 2; +- if (magic != 282) +- throw new Exception (String.Format ("Magic number is wrong: {0}", magic)); ++ DetermineVersion (magic); + + /*nameSize =*/ GetInt16 (buffer, position); + position += 2; +@@ -161,8 +172,8 @@ public int Get (TermInfoNumbers number) + if ((offset % 2) == 1) + offset++; + +- offset += ((int) number) * 2; +- return GetInt16 (buffer, offset); ++ offset += ((int) number) * intOffset; ++ return GetInteger (buffer, offset); + } + + public string Get (TermInfoStrings tstr) +@@ -175,7 +186,7 @@ public string Get (TermInfoStrings tstr) + if ((offset % 2) == 1) + offset++; + +- offset += numSize * 2; ++ offset += numSize * intOffset; + int off2 = GetInt16 (buffer, offset + (int) tstr * 2); + if (off2 == -1) + return null; +@@ -193,7 +204,7 @@ public string Get (TermInfoStrings tstr) + if ((offset % 2) == 1) + offset++; + +- offset += numSize * 2; ++ offset += numSize * intOffset; + int off2 = GetInt16 (buffer, offset + (int) tstr * 2); + if (off2 == -1) + return null; +@@ -211,6 +222,27 @@ short GetInt16 (byte [] buffer, int offset) + return (short) (uno + dos * 256); + } + ++ int GetInt32 (byte [] buffer, int offset) ++ { ++ int b1 = (int) buffer [offset]; ++ int b2 = (int) buffer [offset + 1]; ++ int b3 = (int) buffer [offset + 2]; ++ int b4 = (int) buffer [offset + 3]; ++ if (b1 == 255 && b2 == 255 && b3 == 255 && b4 == 255) ++ return -1; ++ ++ return b1 + b2 << 8 + b3 << 16 + b4 << 24; ++ } ++ ++ int GetInteger (byte [] buffer, int offset) ++ { ++ if (intOffset == 2) ++ return GetInt16 (buffer, offset); ++ else ++ // intOffset == 4 ++ return GetInt32 (buffer, offset); ++ } ++ + string GetString (byte [] buffer, int offset) + { + int length = 0; diff --git a/mono.spec b/mono.spec index 9196425..b0fb965 100644 --- a/mono.spec +++ b/mono.spec @@ -16,7 +16,7 @@ Name: mono Version: 4.8.0 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Cross-platform, Open Source, .NET development framework Group: Development/Languages @@ -37,7 +37,12 @@ Patch5: mono-4.6.1-aarch64.patch # fix bz#1484151, bz#1484149 due to new glibc which # drops the struct ucontext Patch6: mono-4.8.0.520-glibc-ucontext.patch -Patch7: mono-4.8.0-aarch64-glibc-2.26.patch +# fix bz#1580447, due to new file format terminfo2 introduced with ncurses6.1 +Patch7: mono-4.8.0-terminfo.patch +# glibc change: The inclusion of by is deprecated. This +# means that in a future release, the macros “major”, “minor”, and “makedev” +# will only be available from . +Patch8: mono-4.8.0-sysmacros.patch BuildRequires: bison BuildRequires: cmake @@ -282,6 +287,7 @@ Development file for monodoc %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # Add undeclared Arg sed -i "61a #define ARG_MAX _POSIX_ARG_MAX" mono/io-layer/wapi_glob.h @@ -796,6 +802,11 @@ rm -f %{buildroot}%{_libdir}/pkgconfig/cecil.pc %{_libdir}/pkgconfig/monodoc.pc %changelog +* Tue Jun 05 2018 Timotheus Pokorra - 4.8.0-14 +- backport a patch for new file format terminfo2 introduced with ncurses6.1 +- dropping patch for glibc on aarch64 because it now breaks the build on Fedora 28 +- adding patch for glibc change regarding sysmacros, for Fedora 29 + * Thu Feb 08 2018 Fedora Release Engineering - 4.8.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild