public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/arm/morello/main] cheri: malloc: bump OBSTACK_INTERFACE_VERSION
Date: Fri,  9 Dec 2022 12:21:30 +0000 (GMT)	[thread overview]
Message-ID: <20221209122130.C07B1383CD20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1861652b2ee82eda7d466ae582d195b3b0dae116

commit 1861652b2ee82eda7d466ae582d195b3b0dae116
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Dec 1 16:58:55 2022 +0000

    cheri: malloc: bump OBSTACK_INTERFACE_VERSION
    
    The obstack version should have been bumped after
    
      commit 2fd4de4b15a66f821057af90714145d2c034a609
      [BZ #321]
    
    which changed a ptrdiff_t struct member into a union of ptrdiff_t and a
    pointer and thus changed the ABI on targets where ptrdiff_t and pointer
    have different size or alignment. This affects CHERI targets.
    
    Old versions of obstack are used in the wild and conflict with the one
    provided by glibc so at least on CHERI targets it has to be bumped.
    On other targets we don't bump the version as it changes compile time
    behaviour (the ABI remains backward compatible either way).

Diff:
---
 include/gnu-versions.h | 4 ++++
 malloc/obstack.c       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/include/gnu-versions.h b/include/gnu-versions.h
index f2566683ec..842a215b17 100644
--- a/include/gnu-versions.h
+++ b/include/gnu-versions.h
@@ -43,7 +43,11 @@
    remember, if any of these versions change, the libc.so major version
    number must change too (so avoid it)!  */
 
+#ifdef __CHERI_PURE_CAPABILITY__
+#define _GNU_OBSTACK_INTERFACE_VERSION	2 /* vs malloc/obstack.c */
+#else
 #define _GNU_OBSTACK_INTERFACE_VERSION	1 /* vs malloc/obstack.c */
+#endif
 #define _GNU_REGEX_INTERFACE_VERSION	1 /* vs posix/regex.c */
 #define _GNU_GLOB_INTERFACE_VERSION	2 /* vs posix/glob.c */
 #define _GNU_GETOPT_INTERFACE_VERSION	2 /* vs posix/getopt.c and
diff --git a/malloc/obstack.c b/malloc/obstack.c
index 40b9c29b79..aad6a34f58 100644
--- a/malloc/obstack.c
+++ b/malloc/obstack.c
@@ -28,7 +28,11 @@
 /* NOTE BEFORE MODIFYING THIS FILE: This version number must be
    incremented whenever callers compiled using an old obstack.h can no
    longer properly call the functions in this obstack.c.  */
+#ifdef __CHERI_PURE_CAPABILITY__
+#define OBSTACK_INTERFACE_VERSION 2
+#else
 #define OBSTACK_INTERFACE_VERSION 1
+#endif
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself, and the installed library

                 reply	other threads:[~2022-12-09 12:21 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=20221209122130.C07B1383CD20@sourceware.org \
    --to=nsz@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /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).