tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] fix devl/gdb portability fail with == operator



Hi.

Trying to build gdb from 2020Q1 (sorry for not checking CVS, just
trying to get my first 2020Q1 build rolling because users are waiting)
results in this:

INFO: [subst.mk:pkglocaledir] Nothing changed in ./sim/testsuite/m32r-elf/Makefile.in.
INFO: [subst.mk:pkglocaledir] Nothing changed in ./sim/testsuite/Makefile.in.
INFO: [subst.mk:pkglocaledir] Nothing changed in ./sim/testsuite/mips64el-elf/Makefile.in.
INFO: [subst.mk:pkglocaledir] Nothing changed in ./sim/v850/Makefile.in.
=> Checking for portability problems in extracted files
ERROR: [check-portability.awk] => Found test ... == ...:
ERROR: [check-portability.awk] gdb/testsuite/Makefile.in:200:   test "x$$racyiter" == "x" && \
ERROR: [check-portability.awk] gdb/testsuite/Makefile.in:230:   test "x$$racyiter" == "x" && \

Explanation:
===========================================================================
The "test" command, as well as the "[" command, are not required to know
the "==" operator. Only a few implementations like bash and some
versions of ksh support it.

When you run "test foo == foo" on a platform that does not support the
"==" operator, the result will be "false" instead of "true". This can
lead to unexpected behavior.

There are two ways to fix this error message. If the file that contains
the "test ==" is needed for building the package, you should create a
patch for it, replacing the "==" operator with "=". If the file is not
needed, add its name to the CHECK_PORTABILITY_SKIP variable in the
package Makefile.
===========================================================================

I guess a fix is easy enough. Please consider including the attached
patch. I asked upstream on IRC about including this little fix. Btw, an
alternative to the patch would be

	perl -pi -e 's: == : = :' gdb/testsuite/Makefile.in

(or the sed equivalent, of course).

Oh, while we're at it, gdb seriously needs an update. Version 8.3.1
came out September 2019. Current is 9.1, released in Februrary.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg
diff -ruN -x CVS pkgsrc-2020Q1/devel/gdb/distinfo pkgsrc/devel/gdb/distinfo
--- pkgsrc-2020Q1/devel/gdb/distinfo	2019-10-11 11:23:42.000000000 +0200
+++ pkgsrc/devel/gdb/distinfo	2020-05-23 09:09:08.210069196 +0200
@@ -6,5 +6,6 @@
 Size (gdb-8.1.tar.gz) = 37334207 bytes
 SHA1 (patch-Makefile.in) = 48f65798f96fdda2a35eb8b18a7cc2993023bcc7
 SHA1 (patch-gdb_proc-events.c) = 0ff0e3b33beacd83384f4b1b07e337d5271cea8c
+SHA1 (patch-gdb-testsuite-Makefile.in) = 68110c863414c9d89f2a9ca2154ea797666ef2b4
 SHA1 (patch-opcodes_i386-dis_c) = 57b2b2ce85567faf112ec9f435b9aed0ffc943fb
 SHA1 (patch-sim_ppc_emul_netbsd.c) = 34fcb884c3c82e8eae6cd6f8c87ce42e9354c347
diff -ruN -x CVS pkgsrc-2020Q1/devel/gdb/patches/patch-gdb-testsuite-Makefile.in pkgsrc/devel/gdb/patches/patch-gdb-testsuite-Makefile.in
--- pkgsrc-2020Q1/devel/gdb/patches/patch-gdb-testsuite-Makefile.in	1970-01-01 01:00:00.000000000 +0100
+++ pkgsrc/devel/gdb/patches/patch-gdb-testsuite-Makefile.in	2020-05-23 09:07:58.710047397 +0200
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- gdb/testsuite/Makefile.in.orig	2020-05-23 08:54:57.739210406 +0200
++++ gdb/testsuite/Makefile.in	2020-05-23 08:55:44.618875730 +0200
+@@ -197,7 +197,7 @@
+ 	-rm -rf cache racy_outputs temp
+ 	mkdir -p racy_outputs; \
+ 	racyiter="$(RACY_ITER)"; \
+-	test "x$$racyiter" == "x" && \
++	test "x$$racyiter" = "x" && \
+ 	  racyiter=$(DEFAULT_RACY_ITER); \
+ 	if test $$racyiter -lt 2 ; then \
+ 	  echo "RACY_ITER must be at least 2."; \
+@@ -227,7 +227,7 @@
+ check-parallel-racy:
+ 	-rm -rf cache racy_outputs temp
+ 	racyiter="$(RACY_ITER)"; \
+-	test "x$$racyiter" == "x" && \
++	test "x$$racyiter" = "x" && \
+ 	  racyiter=$(DEFAULT_RACY_ITER); \
+ 	if test $$racyiter -lt 2 ; then \
+ 	  echo "RACY_ITER must be at least 2."; \
diff -ruN -x CVS pkgsrc-2020Q1/devel/gdb/PLIST.Linux pkgsrc/devel/gdb/PLIST.Linux
--- pkgsrc-2020Q1/devel/gdb/PLIST.Linux	2018-01-31 21:33:11.000000000 +0100
+++ pkgsrc/devel/gdb/PLIST.Linux	2020-05-23 00:53:27.973126481 +0200
@@ -1,3 +1,4 @@
 @comment $NetBSD: PLIST.Linux,v 1.5 2018/01/31 20:33:11 maya Exp $
 bin/gdbserver
 lib/libinproctrace.so
+${PLIST.gcore}man/man1/gcore.1


Home | Main Index | Thread Index | Old Index