public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: malloc: bump OBSTACK_INTERFACE_VERSION
@ 2022-12-09 12:21 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2022-12-09 12:21 UTC (permalink / raw)
  To: glibc-cvs

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-09 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 12:21 [glibc/arm/morello/main] cheri: malloc: bump OBSTACK_INTERFACE_VERSION Szabolcs Nagy

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).