From: Paul Eggert <eggert@cs.ucla.edu>
To: Luis Machado <luis.machado@arm.com>
Cc: gdb-patches@sourceware.org, binutils@sourceware.org,
Eli Zaretskii <eliz@gnu.org>, Simon Marchi <simark@simark.ca>
Subject: Re: [PATCH] Disable year 2038 support on 32-bit hosts by default
Date: Tue, 9 Aug 2022 08:49:53 -0700 [thread overview]
Message-ID: <126b860d-0c2c-9fab-a87b-7b97df5ee034@cs.ucla.edu> (raw)
In-Reply-To: <26aee793-5d5a-62c7-38ee-e133db897984@arm.com>
[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]
On 8/8/22 11:01, Luis Machado wrote:
> BFD is left in the dark about the 64-bit time_t support for 32-bit hosts.
OK, but how about if we fix that by syncing non-Gnulib-using code with
Gnulib-using code? This should be relatively easy. Something like the
first attached patch, say. If there's still interest in 32-bit binutils
this would be a better approach. (If there's not, then we don't have to
install any patch. :-)
PS. While looking into this I noticed a grep portability bug in a couple
of 'configure.ac's, fixed in the 2nd attached patch.
PPS. I couldn't get a 32-bit version of binutils-gdb to build on Fedora
x86-64, even without either of the attached patches. See the 3rd
attached file, which is a compressed log of my attempt to build. Here's
the first part of the failing output:
/bin/sh ../libtool --tag=CXX --mode=link gcc -m32 -Wall -pthread
-Wno-switch -g -O2 -o gp-archive gp-archive.o ArchiveExp.o
libgprofng.la -L../../zlib -lz
libtool: link: gcc -m32 -Wall -pthread -Wno-switch -g -O2 -o
gp-archive gp-archive.o ArchiveExp.o ./.libs/libgprofng.a
-L/home/eggert/src/gnu/build/zlib -L/home/eggert/src/gnu/build/libiberty
/home/eggert/src/gnu/build/opcodes/.libs/libopcodes.a
/home/eggert/src/gnu/build/bfd/.libs/libbfd.a -liberty -lpthread -ldl
-lz -pthread
/usr/bin/ld: gp-archive.o: in function `er_archive::check_args(int,
char**)':
/home/eggert/src/gnu/build/gprofng/src/../../../binutils-gdb/gprofng/src/gp-archive.cc:573:
undefined reference to `operator new(unsigned int)'
[-- Attachment #2: 0001-Use-the-same-_TIME_BITS-everywhere.patch --]
[-- Type: text/x-patch, Size: 1394 bytes --]
From 4809a5538015f82fdbe5aec5d6fdaab5fefa07ba Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 9 Aug 2022 07:44:49 -0700
Subject: [PATCH 1/2] Use the same _TIME_BITS everywhere
* largefile.m4: Include Gnulib's largefile.m4 and year2038.m4.
---
config/ChangeLog | 5 +++++
config/largefile.m4 | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/config/ChangeLog b/config/ChangeLog
index 3385292b3dc..f19422f27e7 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use the same _TIME_BITS everywhere
+ * largefile.m4: Include Gnulib's largefile.m4 and year2038.m4.
+
2022-07-08 Nick Clifton <nickc@redhat.com>
* 2.39 branch created.
diff --git a/config/largefile.m4 b/config/largefile.m4
index 937596334cd..1521e7c59bd 100644
--- a/config/largefile.m4
+++ b/config/largefile.m4
@@ -3,6 +3,12 @@
# bfd's configure script so that all the directories agree on the size
# of structures used to describe files.
+# Use the same version of AC_SYS_LARGEFILE that Gnulib uses,
+# as it may set _FILE_OFFSET_BITS and/or _TIME_BITS and this
+# needs to be consistent across binutils.
+m4_include([../gnulib/import/m4/largefile.m4])
+m4_include([../gnulib/import/m4/year2038.m4])
+
AC_DEFUN([ACX_LARGEFILE],[dnl
# The tests for host and target for $enable_largefile require
--
2.37.1
[-- Attachment #3: 0002-Avoid-undefined-in-regexp.patch --]
[-- Type: text/x-patch, Size: 2238 bytes --]
From 4695c75036bb6c632baa646e4dd2d084d81b23f7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 9 Aug 2022 07:48:25 -0700
Subject: [PATCH 2/2] Avoid undefined \- in regexp
* configure.ac, libiberty/configure.ac:
(AR_PLUGIN_OPTION, RANLIB_PLUGIN_OPTION):
Don't use 'grep "\-..."' as POSIX says the interpretation
of \- is undefined in a regular expression.
---
ChangeLog | 8 ++++++++
configure.ac | 4 ++--
libiberty/configure.ac | 4 ++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8a84e119e53..44b4233bde6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-08-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ Avoid undefined \- in regexp
+ * configure.ac, libiberty/configure.ac:
+ (AR_PLUGIN_OPTION, RANLIB_PLUGIN_OPTION):
+ Don't use 'grep "\-..."' as POSIX says the interpretation
+ of \- is undefined in a regular expression.
+
2022-07-08 Nick Clifton <nickc@redhat.com>
* 2.39 branch created.
diff --git a/configure.ac b/configure.ac
index 1651cbf3b02..4738294dbd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3475,10 +3475,10 @@ GCC_PLUGIN_OPTION(PLUGIN_OPTION)
AR_PLUGIN_OPTION=
RANLIB_PLUGIN_OPTION=
if test -n "$PLUGIN_OPTION"; then
- if $AR --help 2>&1 | grep -q "\--plugin"; then
+ if $AR --help 2>&1 | grep -q "[-]-plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+ if $RANLIB --help 2>&1 | grep -q "[-]-plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
fi
else
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 6c1ff9c6093..28933d5fcc1 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -116,11 +116,11 @@ AC_CHECK_TOOL(RANLIB, ranlib, :)
GCC_PLUGIN_OPTION(PLUGIN_OPTION)
if test -n "$PLUGIN_OPTION"; then
- if $AR --help 2>&1 | grep -q "\--plugin"; then
+ if $AR --help 2>&1 | grep -q "[-]-plugin"; then
AR_PLUGIN_OPTION="$PLUGIN_OPTION"
AC_SUBST(AR_PLUGIN_OPTION)
fi
- if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+ if $RANLIB --help 2>&1 | grep -q "[-]-plugin"; then
RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
AC_SUBST(RANLIB_PLUGIN_OPTION)
fi
--
2.37.1
[-- Attachment #4: binutils-gdb-fedora-x86-64-32.txt.gz --]
[-- Type: application/gzip, Size: 52383 bytes --]
next prev parent reply other threads:[~2022-08-09 15:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 7:51 Luis Machado
2022-08-01 14:08 ` Simon Marchi
2022-08-01 14:17 ` Luis Machado
2022-08-01 15:37 ` Simon Marchi
2022-08-01 15:58 ` Eli Zaretskii
2022-08-02 6:42 ` Luis Machado
2022-08-08 11:34 ` Luis Machado
2022-08-08 11:58 ` Eli Zaretskii
2022-08-08 12:04 ` Luis Machado
2022-08-08 12:38 ` Eli Zaretskii
2022-08-08 17:55 ` Paul Eggert
2022-08-08 18:00 ` Luis Machado
2022-08-08 18:01 ` Luis Machado
2022-08-09 15:49 ` Paul Eggert [this message]
2022-08-09 15:59 ` Luis Machado
2022-08-09 16:13 ` Paul Eggert
2022-08-10 9:41 ` Nick Clifton
2022-08-10 10:14 ` Luis Machado
2022-08-09 16:29 ` Eli Zaretskii
2022-08-09 17:02 ` Paul Eggert
2022-08-10 8:38 ` Alan Modra
2022-08-08 14:51 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=126b860d-0c2c-9fab-a87b-7b97df5ee034@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=binutils@sourceware.org \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@arm.com \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).