diff --git a/coreutils-9.5-gcc14-gnulib-lto.patch b/coreutils-9.5-gcc14-gnulib-lto.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc4d60564e2bfd54252fa55d7ea4083d252f7691 --- /dev/null +++ b/coreutils-9.5-gcc14-gnulib-lto.patch @@ -0,0 +1,65 @@ +From 4602765093f04e597f87d78cf29d21eea03b6fa4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?P=C3=A1draig=20Brady?= +Date: Wed, 28 Aug 2024 12:10:43 +0100 +Subject: avoid GCC -Wmaybe-uninitialized false positives with LTO + +Avoids false warnings with GCC 14.2.1 with -flto + +* lib/canonicalize.c: Initialize END_IDX. +* lib/getndelim2.c: Initialize C. +--- + ChangeLog | 8 ++++++++ + lib/canonicalize.c | 9 ++++++++- + lib/getndelim2.c | 8 +++++--- + 3 files changed, 21 insertions(+), 4 deletions(-) + +--- a/lib/canonicalize.c ++++ b/lib/canonicalize.c +@@ -34,6 +34,13 @@ + #include "hash-triple.h" + #include "xalloc.h" + ++/* Suppress bogus GCC -Wmaybe-uninitialized warnings. */ ++#if defined GCC_LINT || defined lint ++# define IF_LINT(Code) Code ++#else ++# define IF_LINT(Code) /* empty */ ++#endif ++ + #ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT + # define DOUBLE_SLASH_IS_DISTINCT_ROOT false + #endif +@@ -367,7 +374,7 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode, + buf[n] = '\0'; + + char *extra_buf = bufs->extra.data; +- idx_t end_idx; ++ idx_t end_idx IF_LINT (= 0); + if (end_in_extra_buffer) + end_idx = end - extra_buf; + size_t len = strlen (end); +diff --git a/lib/getndelim2.c b/lib/getndelim2.c +index 89989ae..db61e2a 100644 +--- a/lib/getndelim2.c ++++ b/lib/getndelim2.c +@@ -47,8 +47,10 @@ + #include "memchr2.h" + + /* Avoid false GCC warning "'c' may be used uninitialized". */ +-#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 +-# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" ++#if defined GCC_LINT || defined lint ++# define IF_LINT(Code) Code ++#else ++# define IF_LINT(Code) /* empty */ + #endif + + /* The maximum value that getndelim2 can return without suffering from +@@ -102,7 +104,7 @@ getndelim2 { + /* Here always ptr + size == read_pos + nbytes_avail. + Also nbytes_avail > 0 || size < nmax. */ + +- int c; ++ int c IF_LINT (= EOF); + const char *buffer; + size_t buffer_len; diff --git a/coreutils-9.0-sw.patch b/coreutils-9.5-sw.patch similarity index 66% rename from coreutils-9.0-sw.patch rename to coreutils-9.5-sw.patch index e4f7658c45f66b6b1bef9fa3ceeea1af7bc093bc..a43c1cda5cc2eb1aa1323c817414c32298f5cae3 100755 --- a/coreutils-9.0-sw.patch +++ b/coreutils-9.5-sw.patch @@ -1,7 +1,7 @@ -diff -Nuar coreutils-9.0.org/build-aux/config.guess coreutils-9.0.sw/build-aux/config.guess ---- coreutils-9.0.org/build-aux/config.guess 2022-02-17 15:38:25.880000000 +0000 -+++ coreutils-9.0.sw/build-aux/config.guess 2022-02-17 16:03:14.150000000 +0000 -@@ -973,6 +973,14 @@ +diff -ur coreutils-9.5.orig/build-aux/config.guess coreutils-9.5/build-aux/config.guess +--- coreutils-9.5.orig/build-aux/config.guess 2024-09-02 09:08:54.651545374 +0800 ++++ coreutils-9.5/build-aux/config.guess 2024-09-02 09:10:13.785486378 +0800 +@@ -1008,6 +1008,14 @@ UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; @@ -16,21 +16,21 @@ diff -Nuar coreutils-9.0.org/build-aux/config.guess coreutils-9.0.sw/build-aux/c alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; -diff -Nuar coreutils-9.0.org/build-aux/config.sub coreutils-9.0.sw/build-aux/config.sub ---- coreutils-9.0.org/build-aux/config.sub 2022-02-17 15:38:25.880000000 +0000 -+++ coreutils-9.0.sw/build-aux/config.sub 2022-02-17 16:03:30.560000000 +0000 -@@ -1177,6 +1177,7 @@ +diff -ur coreutils-9.5.orig/build-aux/config.sub coreutils-9.5/build-aux/config.sub +--- coreutils-9.5.orig/build-aux/config.sub 2024-09-02 09:08:54.652545386 +0800 ++++ coreutils-9.5/build-aux/config.sub 2024-09-02 09:10:31.238693918 +0800 +@@ -1183,6 +1183,7 @@ | a29k \ - | aarch64 | aarch64_be \ + | aarch64 | aarch64_be | aarch64c | arm64ec \ | abacus \ + | sw_64 \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ | alphapca5[67] | alpha64pca5[67] \ -diff -Nuar coreutils-9.0.org/configure coreutils-9.0.sw/configure ---- coreutils-9.0.org/configure 2022-02-17 15:38:26.280000000 +0000 -+++ coreutils-9.0.sw/configure 2022-02-17 15:58:05.480000000 +0000 -@@ -7845,6 +7845,12 @@ +diff -ur coreutils-9.5.orig/configure coreutils-9.5/configure +--- coreutils-9.5.orig/configure 2024-09-02 09:08:53.994537562 +0800 ++++ coreutils-9.5/configure 2024-09-02 09:12:45.750293437 +0800 +@@ -8769,6 +8769,12 @@ # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 # and the GCC 4.1.2 manual). case "$host_cpu" in @@ -43,27 +43,27 @@ diff -Nuar coreutils-9.0.org/configure coreutils-9.0.sw/configure alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at -@@ -18808,7 +18814,7 @@ - case "$gl_cv_host_cpu_c_abi" in - i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) - gl_cv_host_cpu_c_abi_32bit=yes ;; -- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) -+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) - gl_cv_host_cpu_c_abi_32bit=no ;; - *) - gl_cv_host_cpu_c_abi_32bit=unknown ;; -@@ -18837,7 +18843,7 @@ - ;; +@@ -23004,7 +23010,7 @@ + ;; - # CPUs that only support a 64-bit ABI. -- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ -+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ - | mmix ) - gl_cv_host_cpu_c_abi_32bit=no - ;; -diff -Nuar coreutils-9.0.org/lib/uname.c coreutils-9.0.sw/lib/uname.c ---- coreutils-9.0.org/lib/uname.c 2022-02-17 15:38:26.740000000 +0000 -+++ coreutils-9.0.sw/lib/uname.c 2022-02-17 15:59:09.500000000 +0000 + # CPUs that only support a 64-bit ABI. +- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ ++ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) + gl_cv_host_cpu_c_abi_32bit=no + ;; +@@ -23014,7 +23020,7 @@ + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; +- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) ++ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; +diff -ur coreutils-9.5.orig/lib/uname.c coreutils-9.5/lib/uname.c +--- coreutils-9.5.orig/lib/uname.c 2024-09-02 09:08:54.765546730 +0800 ++++ coreutils-9.5/lib/uname.c 2024-09-02 09:13:34.891877792 +0800 @@ -228,6 +228,10 @@ case PROCESSOR_ARCHITECTURE_MIPS: strcpy (buf->machine, "mips"); @@ -75,9 +75,9 @@ diff -Nuar coreutils-9.0.org/lib/uname.c coreutils-9.0.sw/lib/uname.c case PROCESSOR_ARCHITECTURE_ALPHA: case PROCESSOR_ARCHITECTURE_ALPHA64: strcpy (buf->machine, "alpha"); -diff -Nuar coreutils-9.0.org/m4/fpieee.m4 coreutils-9.0.sw/m4/fpieee.m4 ---- coreutils-9.0.org/m4/fpieee.m4 2022-02-17 15:38:25.890000000 +0000 -+++ coreutils-9.0.sw/m4/fpieee.m4 2022-02-17 15:41:57.490000000 +0000 +diff -ur coreutils-9.5.orig/m4/fpieee.m4 coreutils-9.5/m4/fpieee.m4 +--- coreutils-9.5.orig/m4/fpieee.m4 2024-09-02 09:08:54.055538287 +0800 ++++ coreutils-9.5/m4/fpieee.m4 2024-09-02 09:14:22.824447773 +0800 @@ -30,6 +30,12 @@ # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 # and the GCC 4.1.2 manual). @@ -91,9 +91,9 @@ diff -Nuar coreutils-9.0.org/m4/fpieee.m4 coreutils-9.0.sw/m4/fpieee.m4 alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at -diff -Nuar coreutils-9.0.org/m4/host-cpu-c-abi.m4 coreutils-9.0.sw/m4/host-cpu-c-abi.m4 ---- coreutils-9.0.org/m4/host-cpu-c-abi.m4 2022-02-17 15:38:25.900000000 +0000 -+++ coreutils-9.0.sw/m4/host-cpu-c-abi.m4 2022-02-17 15:41:29.970000000 +0000 +diff -ur coreutils-9.5.orig/m4/host-cpu-c-abi.m4 coreutils-9.5/m4/host-cpu-c-abi.m4 +--- coreutils-9.5.orig/m4/host-cpu-c-abi.m4 2024-09-02 09:08:54.075538525 +0800 ++++ coreutils-9.5/m4/host-cpu-c-abi.m4 2024-09-02 09:16:15.858791895 +0800 @@ -91,6 +91,12 @@ ;; @@ -117,27 +117,27 @@ diff -Nuar coreutils-9.0.org/m4/host-cpu-c-abi.m4 coreutils-9.0.sw/m4/host-cpu-c #ifndef __alpha__ #undef __alpha__ #endif -@@ -468,7 +477,7 @@ - case "$gl_cv_host_cpu_c_abi" in - i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) - gl_cv_host_cpu_c_abi_32bit=yes ;; -- x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) -+ x86_64 | sw_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) - gl_cv_host_cpu_c_abi_32bit=no ;; - *) - gl_cv_host_cpu_c_abi_32bit=unknown ;; -@@ -498,7 +507,7 @@ +@@ -491,7 +500,7 @@ - # CPUs that only support a 64-bit ABI. + # CPUs that only support a 64-bit ABI. changequote(,)dnl -- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ -+ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ - | mmix ) +- alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ ++ sw_64* | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) changequote([,])dnl - gl_cv_host_cpu_c_abi_32bit=no -diff -Nuar coreutils-9.0.org/src/longlong.h coreutils-9.0.sw/src/longlong.h ---- coreutils-9.0.org/src/longlong.h 2022-02-17 15:38:26.750000000 +0000 -+++ coreutils-9.0.sw/src/longlong.h 2022-02-17 15:55:26.520000000 +0000 + gl_cv_host_cpu_c_abi_32bit=no +@@ -503,7 +512,7 @@ + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; +- x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) ++ x86_64 | sw_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; +diff -ur coreutils-9.5.orig/src/longlong.h coreutils-9.5/src/longlong.h +--- coreutils-9.5.orig/src/longlong.h 2024-09-02 09:08:53.933536836 +0800 ++++ coreutils-9.5/src/longlong.h 2024-09-02 09:17:29.550668195 +0800 @@ -170,6 +170,92 @@ don't need to be under !NO_ASM */ #if ! defined (NO_ASM) diff --git a/coreutils.spec b/coreutils.spec index e82c0eb7a75a0fab643428b58aad3871a820fe9f..9ba46931105af11d1772d4701c45aa360d6ff5b6 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils Version: 9.5 -Release: 2 +Release: 3 License: GPLv3+ Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -19,15 +19,14 @@ Patch4: skip-the-tests-that-require-selinux-if-selinux-is-di.patch Patch5: backport-config-color-alias-for-ls.patch Patch6: backport-coreutils-df-direct.patch Patch7: backport-coreutils-i18n.patch -patch8: test-skip-overlay-filesystem-because-of-no-inotify_add_watch.patch +Patch8: test-skip-overlay-filesystem-because-of-no-inotify_add_watch.patch +Patch9: coreutils-9.5-gcc14-gnulib-lto.patch #patch9: backport-sort-don-t-trust-st_size-on-proc-files.patch #patch10: backport-cat-don-t-trust-st_size-on-proc-files.patch #patch11: backport-dd-don-t-trust-st_size-on-proc-files.patch #patch12: backport-split-don-t-trust-st_size-on-proc-files.patch -%ifarch sw_64 -Patch9001: coreutils-9.0-sw.patch -%endif +Patch9001: coreutils-9.5-sw.patch Conflicts: filesystem < 3 @@ -135,21 +134,9 @@ EOF %check pushd separate -make check VERBOSE=yes +%make_build check VERBOSE=yes popd -%preun -if [ $1 = 0 ]; then - if [ -f %{_infodir}/%{name}.info.gz ]; then - /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || : - fi -fi - -%post -if [ -f %{_infodir}/%{name}.info.gz ]; then - /sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || : -fi - %files -f %{name}.lang %{_bindir}/* %{_sbindir}/chroot @@ -167,6 +154,10 @@ fi %{_mandir}/man*/* %changelog +* Mon Sep 02 2024 Funda Wang - 9.5-3 +- Avoids false warnings with GCC 14.2.1 with -flto +- rediff sw_64 patch + * Tue Aug 13 2024 huyubiao - 9.5-2 - fix alias sm3sum not working on bash delete redundant backport-chmod-fix-exit-status-when-ignoring-symlinks.patch