]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
cheri: malloc: bump OBSTACK_INTERFACE_VERSION
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 1 Dec 2022 16:58:55 +0000 (16:58 +0000)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 8 Dec 2022 17:27:31 +0000 (17:27 +0000)
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).

include/gnu-versions.h
malloc/obstack.c

index f2566683ec303efe00e9d5ea3f9c1f1421d52fd9..842a215b17456528ac76b9a456e96e12ff699b12 100644 (file)
    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
index 40b9c29b79e4e461ab4887e258b13df38384cffd..aad6a34f5860486a646bdf90e1cbada919e57781 100644 (file)
 /* 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