This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: Update autotools version used for gnulib import


On 2018-05-04 02:42 PM, Simon Marchi wrote:
> When trying to run the update-gnulib.sh script, I get this:
> 
> Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^      =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
> Aborting.
> 
> It's an issue with a regex in automake that triggers a warning starting
> with Perl 5.22.  It has been fixed in automake 1.15.1.  So I think it's
> a good excuse to bump the versions of autoconf and automake used in the
> gnulib import.
> 
> For autoconf, the 2.69 version is universally available, so it'S an easy
> choice.  For automake, different distros and distro versions have
> different automake versions, so there's no version that would make
> everybody happy.  I just went with 1.16.1, the latest release.  It's
> quite easy to build it from source.
> 
> The newer automake errors out and points out that we should modernize
> our usage of AM_INIT_AUTOMAKE:
> 
>   https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
> 
> so I did that too.
> 
> It also complains about missing ../../ar-lib, so I ran automake
> --add-missing to add it (which is why I CCed the binutils mailing list).

When doing a full build, I got a few of these errors which I did not get previously:

  CXX    gdb.o
In file included from /home/emaisin/src/binutils-gdb/gdb/common/common-defs.h:32:0,
                 from /home/emaisin/src/binutils-gdb/gdb/defs.h:28,
                 from /home/emaisin/src/binutils-gdb/gdb/gdb.c:19:
./build-gnulib/config.h:1596:0: error: "PACKAGE_NAME" redefined [-Werror]
 #define PACKAGE_NAME "libgnu"
 ^
In file included from /home/emaisin/src/binutils-gdb/gdb/common/common-defs.h:23:0,
                 from /home/emaisin/src/binutils-gdb/gdb/defs.h:28,
                 from /home/emaisin/src/binutils-gdb/gdb/gdb.c:19:
./config.h:615:0: note: this is the location of the previous definition
 #define PACKAGE_NAME ""
 ^

The problem is that gdb/configure and gdb/gnulib/configure now generate different
value for these macros.  I don't think we really care about these values, so
we can probably just undef them between including both config.h files.  To be safe,
I also suggest undefining them after, to be sure we don't rely on them anywhere.  I
would amend the original patch with the one below.


diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h
index 881a4ea..eb0ec21 100644
--- a/gdb/common/common-defs.h
+++ b/gdb/common/common-defs.h
@@ -21,12 +21,23 @@
 #define COMMON_DEFS_H

 #include "config.h"
+
+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
 #ifdef GDBSERVER
 #include "build-gnulib-gdbserver/config.h"
 #else
 #include "build-gnulib/config.h"
 #endif

+#undef PACKAGE_NAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]