From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Cc: Roger Sayle <roger@nextmovesoftware.com>
Subject: [PATCH] libstdc++: Disable embedded tzdata for all 16-bit targets
Date: Tue, 16 May 2023 18:30:37 +0100 [thread overview]
Message-ID: <20230516173037.1807702-1-jwakely@redhat.com> (raw)
Tested powerpc64le-linux. Builds OK for avr too.
Roger, does this work for xstormy16?
-- >8 --
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ZONEINFO_DIR): Extend logic for avr and
msp430 to all 16-bit targets.
* configure: Regenerate.
---
libstdc++-v3/acinclude.m4 | 15 +++++++++------
libstdc++-v3/configure | 18 ++++++++++++------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 8129373e9dd..eb30c4f00a5 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -5426,12 +5426,15 @@ AC_DEFUN([GLIBCXX_ZONEINFO_DIR], [
zoneinfo_dir=none
;;
esac
- case "$host" in
- avr-*-* | msp430-*-* ) embed_zoneinfo=no ;;
- *)
- # Also embed a copy of the tzdata.zi file as a static string.
- embed_zoneinfo=yes ;;
- esac
+
+ AC_COMPUTE_INT(glibcxx_cv_at_least_32bit, [sizeof(void*) >= 4])
+ if test "$glibcxx_cv_at_least_32bit" -ne 0; then
+ # Also embed a copy of the tzdata.zi file as a static string.
+ embed_zoneinfo=yes
+ else
+ # The embedded data is too large for 16-bit targets.
+ embed_zoneinfo=no
+ fi
elif test "x${with_libstdcxx_zoneinfo}" = xno; then
# Disable tzdb support completely.
zoneinfo_dir=none
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 188be08d716..345ba5721a8 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -71903,12 +71903,18 @@ fi
zoneinfo_dir=none
;;
esac
- case "$host" in
- avr-*-* | msp430-*-* ) embed_zoneinfo=no ;;
- *)
- # Also embed a copy of the tzdata.zi file as a static string.
- embed_zoneinfo=yes ;;
- esac
+
+ if ac_fn_c_compute_int "$LINENO" "sizeof(void*) >= 4" "glibcxx_cv_at_least_32bit" ""; then :
+
+fi
+
+ if test "$glibcxx_cv_at_least_32bit" -ne 0; then
+ # Also embed a copy of the tzdata.zi file as a static string.
+ embed_zoneinfo=yes
+ else
+ # The embedded data is too large for 16-bit targets.
+ embed_zoneinfo=no
+ fi
elif test "x${with_libstdcxx_zoneinfo}" = xno; then
# Disable tzdb support completely.
zoneinfo_dir=none
--
2.40.1
reply other threads:[~2023-05-16 17:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230516173037.1807702-1-jwakely@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
--cc=roger@nextmovesoftware.com \
/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).