public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation
@ 2026-06-27 23:58 Jan Kratochvil
  0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2026-06-27 23:58 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gdb
            Branch : gdb-17.2-rebase-f44
            Commit : 4a848ebc3807cfd4c60bd26b6edfcb93c4bb931b
            Author : Jan Kratochvil <jan.kratochvil@redhat.com>
            Date   : 2018-02-04T21:49:30+01:00
            Stats  : +76/-1 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdb/c/4a848ebc3807cfd4c60bd26b6edfcb93c4bb931b?branch=gdb-17.2-rebase-f44

            Log:
            Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation
Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare.

---
diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include
index d9dc3fc..ee35a62 100644
--- a/_gdb.spec.Patch.include
+++ b/_gdb.spec.Patch.include
@@ -520,3 +520,6 @@ Patch124: gdb-vla-intel-fix-print-char-array.patch
 # Fix -D_GLIBCXX_DEBUG gdb-add-index regression (RH BZ 1540559).
 Patch125: gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch
 
+# Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare.
+Patch126: gdb-ppc64-stwux-tautological-compare.patch
+

diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include
index bd3879e..1bc02ff 100644
--- a/_gdb.spec.patch.include
+++ b/_gdb.spec.patch.include
@@ -123,3 +123,4 @@
 %patch123 -p1
 %patch124 -p1
 %patch125 -p1
+%patch126 -p1

diff --git a/_patch_order b/_patch_order
index 55d22e1..f3a5edf 100644
--- a/_patch_order
+++ b/_patch_order
@@ -123,3 +123,4 @@ gdb-testsuite-readline63-sigint.patch
 gdb-archer.patch
 gdb-vla-intel-fix-print-char-array.patch
 gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch
+gdb-ppc64-stwux-tautological-compare.patch

diff --git a/gdb-ppc64-stwux-tautological-compare.patch b/gdb-ppc64-stwux-tautological-compare.patch
new file mode 100644
index 0000000..1847a40
--- /dev/null
+++ b/gdb-ppc64-stwux-tautological-compare.patch
@@ -0,0 +1,56 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Jan Kratochvil <jan.kratochvil@redhat.com>
+Date: Sun, 4 Feb 2018 21:42:18 +0100
+Subject: gdb-ppc64-stwux-tautological-compare.patch
+
+FileName: gdb-ppc64-stwux-tautological-compare.patch
+
+;; Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare.
+
+[patch] ppc64: Fix stwux encoding
+https://sourceware.org/ml/gdb-patches/2018-02/msg00058.html
+
+with gcc-8.0.1-0.9.fc28.x86_64 I get:
+
+../../gdb/rs6000-tdep.c: In function 'CORE_ADDR skip_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, rs6000_framedata*)':
+../../gdb/rs6000-tdep.c:1911:34: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
+       else if ((op & 0xfc1f016a) == 0x7c01016e)
+                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
+
+The code is there since:
+	commit 98f08d3d9b69b344bb8b0cd2a4bda1cf4d966e20
+	Author: Kevin Buettner <kevinb@redhat.com>
+	Date:   Thu May 29 19:47:14 2003 +0000
+		    From Jimi X <jimix@watson.ibm.com>:
+		    * rs6000-tdep.c (skip_prologue): Improve support for 64-bit code.
+So I do not think we can find the original author.
+
+https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.alangref/idalangref_stwux_stux_instrs.htm
+says
+	bit 21 - 30 = 183
+	Those are bits 1..10 in normal bit order: 183<<1 = 0x16e
+
+gdb/ChangeLog
+2018-02-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* rs6000-tdep.c (skip_prologue): Fix stwux encoding.
+---
+ gdb/rs6000-tdep.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
+index 23d0db3b8f..5275ff5b91 100644
+--- a/gdb/rs6000-tdep.c
++++ b/gdb/rs6000-tdep.c
+@@ -1908,7 +1908,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
+ 	  offset = fdata->offset;
+ 	  continue;
+ 	}
+-      else if ((op & 0xfc1f016a) == 0x7c01016e)
++      else if ((op & 0xfc1f016e) == 0x7c01016e)
+ 	{			/* stwux rX,r1,rY */
+ 	  /* No way to figure out what r1 is going to be.  */
+ 	  fdata->frameless = 0;
+-- 
+2.14.3
+

diff --git a/gdb.spec b/gdb.spec
index 83d3057..d5590cb 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -26,7 +26,7 @@ Version: 8.1
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 4%{?dist}
+Release: 5%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
 Group: Development/Debuggers
@@ -497,6 +497,16 @@ cd %{gdb_build}$fprofile
 export CFLAGS="$RPM_OPT_FLAGS %{?_with_asan:-fsanitize=address}"
 export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}"
 
+# FIXME: gcc-8.0:
+# ./elf32-target.h:215:4: error: cast between incompatible function types from 'void * (*)(bfd *)' {aka 'void * (*)(struct bfd *)'} to 'asymbol * (*)(bfd *, void *, long unsigned int)' {aka 'struct bfd_symbol * (*)(struct bfd *, void *, long unsigned int)'} [-Werror=cast-function-type]
+#    ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
+CFLAGS="$CFLAGS -Wno-error=cast-function-type"
+
+# FIXME: gcc-8.0:
+# linux-tdep.c:1767:11: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 17 equals destination size [-Werror=stringop-truncation]
+#    strncpy (p->pr_fname, basename, sizeof (p->pr_fname));
+CFLAGS="$CFLAGS -Wno-error=stringop-truncation"
+
 %if 0%{!?rhel:1} || 0%{?rhel} > 7
 CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL"
 %endif
@@ -1017,6 +1027,10 @@ then
 fi
 
 %changelog
+* Sun Feb  4 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.1-5.fc28
+- Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation
+- Fix ppc64 stwux encoding as found by gcc-8.0 -Werror=tautological-compare.
+
 * Sun Feb  4 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.1-4.fc28
 - Fix -D_GLIBCXX_DEBUG gdb-add-index regression (RH BZ 1540559).
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-27 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 23:58 [rpms/gdb] gdb-17.2-rebase-f44: Workaround gcc-8.0: -Wno-error=cast-function-type,stringop-truncation Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox