From 8bd47ef1b2e1f31127bda3b4428d1243a0daa303 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 24 Nov 2023 14:45:50 +0100 Subject: [PATCH] Restore compatibility with C90 compilers (RHEL-15867) Resolves: RHEL-15867 --- glibc-RHEL-15867.patch | 47 ++++++++++++++++++++++++++++++++++++++++++ glibc.spec | 6 +++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 glibc-RHEL-15867.patch diff --git a/glibc-RHEL-15867.patch b/glibc-RHEL-15867.patch new file mode 100644 index 0000000..7df2fb8 --- /dev/null +++ b/glibc-RHEL-15867.patch @@ -0,0 +1,47 @@ +commit 2337e04e21ba6040926ec871e403533f77043c40 +Author: Siddhesh Poyarekar +Date: Thu Feb 2 07:49:02 2023 -0500 + + cdefs: Limit definition of fortification macros + + Define the __glibc_fortify and other macros only when __FORTIFY_LEVEL > + 0. This has the effect of not defining these macros on older C90 + compilers that do not have support for variable length argument lists. + + Also trim off the trailing backslashes from the definition of + __glibc_fortify and __glibc_fortify_n macros. + + Signed-off-by: Siddhesh Poyarekar + Reviewed-by: Florian Weimer + +diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h +index f3d7efdd2a9320f7..46ec4ef71e14c569 100644 +--- a/misc/sys/cdefs.h ++++ b/misc/sys/cdefs.h +@@ -133,6 +133,7 @@ + # define __glibc_objsize(__o) __bos (__o) + #endif + ++#if __USE_FORTIFY_LEVEL > 0 + /* Compile time conditions to choose between the regular, _chk and _chk_warn + variants. These conditions should get evaluated to constant and optimized + away. */ +@@ -168,7 +169,7 @@ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \ +- : __ ## f ## _chk (__VA_ARGS__, __osz))) \ ++ : __ ## f ## _chk (__VA_ARGS__, __osz))) + + /* Fortify function f, where object size argument passed to f is the number of + elements and not total size. */ +@@ -178,7 +179,8 @@ + ? __ ## f ## _alias (__VA_ARGS__) \ + : (__glibc_unsafe_len (__l, __s, __osz) \ + ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ +- : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \ ++ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) ++#endif + + #if __GNUC_PREREQ (4,3) + # define __warndecl(name, msg) \ diff --git a/glibc.spec b/glibc.spec index 0429d91..35c54dc 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 -%define glibcrelease 243%{?dist} +%define glibcrelease 244%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -1060,6 +1060,7 @@ Patch872: glibc-RHEL-3639.patch Patch873: glibc-RHEL-10481.patch Patch874: glibc-RHEL-13720-1.patch Patch875: glibc-RHEL-13720-2.patch +Patch876: glibc-RHEL-15867.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2891,6 +2892,9 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Fri Nov 24 2023 Florian Weimer - 2.28-244 +- Restore compatibility with C90 compilers (RHEL-15867) + * Tue Nov 21 2023 Florian Weimer - 2.28-243 - ldconfig should skip temporary files created by RPM (RHEL-13720)