diff --git a/SOURCES/0001-EditresCom-Fix-build-with-modern-systems.patch b/SOURCES/0001-EditresCom-Fix-build-with-modern-systems.patch new file mode 100644 index 0000000..139fdf0 --- /dev/null +++ b/SOURCES/0001-EditresCom-Fix-build-with-modern-systems.patch @@ -0,0 +1,54 @@ +From 591ae206f83a359a590090524c286cb03e5c2494 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 6 Sep 2022 17:39:19 +0200 +Subject: [PATCH] EditresCom: Fix build with modern systems. + +The code in _XtGetStringValues() depends on the LONG_BIT define. + +However, modern system require -D_XOPEN_SOURCE to set LONG_BIT, so with +the current code as it is, LONG_BIT is not defined (from limits.h) and +the build wrongly assumes this is a 32bit build. + +Unfortunately, defining _XOPEN_SOURCE to have LONG_BIT set would disable +the definition of caddr_t, a deprecated definition inherited from BSD, +so we also need to replace that with a simple cast to (long *). + +Signed-off-by: Olivier Fourdan +--- + lib/Xm/EditresCom.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/Xm/EditresCom.c b/lib/Xm/EditresCom.c +index 4114ff8b..c93d6844 100644 +--- a/lib/Xm/EditresCom.c ++++ b/lib/Xm/EditresCom.c +@@ -43,6 +43,9 @@ in this Software without prior written authorization from the X Consortium. + #include + #endif + ++#ifndef _XOPEN_SOURCE ++#define _XOPEN_SOURCE 700 ++#endif + + #include /* To get into the composite and core widget + structures. */ +@@ -59,6 +62,7 @@ in this Software without prior written authorization from the X Consortium. + #include + + #include ++#include + + #define _XEditResPutBool _XEditResPut8 + #define _XEditResPutResourceType _XEditResPut8 +@@ -1608,7 +1612,7 @@ _XtGetStringValues(Widget w, Arg *warg, int numargs) + old_handler = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), + EditResCvtWarningHandler); + from.size = res->resource_size; +- from.addr = (caddr_t)&value; ++ from.addr = (void *)&value; + to.addr = NULL; + to.size = 0; + to_color.addr = NULL; +-- +2.37.3 + diff --git a/SPECS/motif.spec b/SPECS/motif.spec index 68ac9ff..a1dff43 100644 --- a/SPECS/motif.spec +++ b/SPECS/motif.spec @@ -1,7 +1,7 @@ Summary: Run-time libraries and programs Name: motif Version: 2.3.4 -Release: 26%{?dist} +Release: 27%{?dist} License: LGPLv2+ Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz Source1: xmbind @@ -38,6 +38,8 @@ Patch54: motifzone_1612.patch # FTBFS #1448819 Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch +# rhbz#2125560 +Patch55: 0001-EditresCom-Fix-build-with-modern-systems.patch Conflicts: lesstif <= 0.92.32-6 @@ -83,6 +85,7 @@ This package contains the static Motif libraries. %patch52 -p1 -b .revert-of-motifzone_1565 %patch53 -p1 -b .motifzone_1660 %patch54 -p1 -b .motifzone_1612 +%patch55 -p1 -b .long_bit %build ./autogen.sh @@ -132,6 +135,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{_libdir}/lib*.a %changelog +* Mon Sep 26 2022 Olivier Fourdan - 2.3.4-27 +- Fix LONG_BIT definition missing (rhbz#2125560) + * Thu May 12 2022 Mika Penttila - 2.3.4-26 - Added patches from rhel-7