From 99fec129987025eae5b3b9054ca2c677e0ba5b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= Date: Tue, 14 Feb 2023 13:23:42 +0100 Subject: [PATCH 1/3] gnuconfig: sync with upstream git --- config.guess | 14 ++++++++++---- config.sub | 35 ++++++++++++++++++++++++++--------- redhat-rpm-config.spec | 5 ++++- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/config.guess b/config.guess index 1817bdc..69188da 100644 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2023 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-05-25' +timestamp='2023-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -966,6 +966,12 @@ EOF GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; @@ -1036,7 +1042,7 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) diff --git a/config.sub b/config.sub index dba16e8..de4259e 100644 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2023 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-01-03' +timestamp='2023-01-21' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -76,7 +76,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +145,7 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 basic_os=$maybe_os ;; @@ -1075,7 +1075,7 @@ case $cpu-$vendor in pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 ;; - pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) cpu=i686 ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) @@ -1207,7 +1207,7 @@ case $cpu-$vendor in | k1om \ | le32 | le64 \ | lm32 \ - | loongarch32 | loongarch64 | loongarchx32 \ + | loongarch32 | loongarch64 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ @@ -1341,6 +1341,10 @@ EOF kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; + managarm*) + kernel=managarm + os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` + ;; *) kernel= os=$basic_os @@ -1754,7 +1758,7 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* ) + | fiwix* | mlibc* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1762,6 +1766,9 @@ case $os in ;; none) ;; + kernel* ) + # Restricted further below + ;; *) echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 exit 1 @@ -1772,16 +1779,26 @@ esac # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) + | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) ;; uclinux-uclibc* ) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + managarm-mlibc* | managarm-kernel* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; + -kernel* ) + echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel* ) + echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 + exit 1 + ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index c639d50..16d0f2b 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 249 +%global baserelease 250 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -253,6 +253,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %doc buildflags.md %changelog +* Tue Feb 14 2023 Frederic Berat - 250-1 +- update config.{guess,sub} to gnuconfig git HEAD + * Thu Feb 09 2023 Jerry James - 249-1 - Add macros.gap-srpm From e64c3b8273bd93a0dd3346537a5209e1974d7ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 23 Feb 2023 01:31:27 +0100 Subject: [PATCH 2/3] Drop the requirement of orphaned nim-srpm-macros No Fedora package uses the %nim_arches macro. This reverts commit ebb7ec32a46278bb58b91fe1a305951473d3fd8a. --- redhat-rpm-config.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 16d0f2b..82d0fd6 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 250 +%global baserelease 251 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -111,7 +111,6 @@ Requires: pyproject-srpm-macros %if ! 0%{?rhel} Requires: fpc-srpm-macros Requires: gnat-srpm-macros -Requires: nim-srpm-macros Requires: ansible-srpm-macros %endif @@ -253,6 +252,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %doc buildflags.md %changelog +* Thu Feb 23 2023 Miro Hrončok - 251-1 +- Drop the requirement of orphaned nim-srpm-macros +- No Fedora package uses the %%nim_arches macro + * Tue Feb 14 2023 Frederic Berat - 250-1 - update config.{guess,sub} to gnuconfig git HEAD From e0e0971163313c9e21f183dc97c7568ac8d818ff Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 10 Feb 2023 19:21:01 +0000 Subject: [PATCH 3/3] Rename _pkg_extra_* macros to _distro_extra_* macros The two intended uses cases for the _pkg_extra_* macros were to make it easier for packagers to add new compile flags for use with their package and also to make it easier to do distro wide experiments with new flags. However, it was pointed out on the mailing list[1] that you can't satisfy both of these uses cases at the same time with just one set of macros. For example, if a packager uses _pkg_extra_* macros to add flags specific to their own package, then someone using _pkg_extra_* macros to apply a new flag distro wide would override the package specific flag. I feel like the distro-wide use case is much more important, so rather than create two sets of new flags, one for each use case, I think it's best to rename the _pkg_extra_* macros to _distro_extra_* and document that they are only meant to be used for adding distro-wide flags and packagers should not use this macro. [1] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/TOG5RHWPS3VYMM52HFGZOUJVRCGZ7VXB/ --- macros | 8 ++++---- redhat-rpm-config.spec | 5 ++++- tests/distro-extra-flags/main.fmf | 8 ++++++++ tests/distro-extra-flags/runtest.sh | 6 ++++++ tests/pkg-extra-flags/main.fmf | 8 -------- tests/pkg-extra-flags/runtest.sh | 6 ------ 6 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 tests/distro-extra-flags/main.fmf create mode 100755 tests/distro-extra-flags/runtest.sh delete mode 100644 tests/pkg-extra-flags/main.fmf delete mode 100755 tests/pkg-extra-flags/runtest.sh diff --git a/macros b/macros index d778275..b9dccf1 100644 --- a/macros +++ b/macros @@ -57,14 +57,14 @@ # C compiler flags. This is traditionally called CFLAGS in makefiles. # Historically also available as %%{optflags}, and %%build sets the # environment variable RPM_OPT_FLAGS to this value. -%build_cflags %{optflags} %{?_pkg_extra_cflags} +%build_cflags %{optflags} %{?_distro_extra_cflags} # C++ compiler flags. This is traditionally called CXXFLAGS in makefiles. -%build_cxxflags %{optflags} %{?_pkg_extra_cxxflags} +%build_cxxflags %{optflags} %{?_distro_extra_cxxflags} # Fortran compiler flags. Makefiles use both FFLAGS and FCFLAGS as # the corresponding variable names. -%build_fflags %{optflags} -I%{_fmoddir} %{?_pkg_extra_fflags} +%build_fflags %{optflags} -I%{_fmoddir} %{?_distro_extra_fflags} # Vala compiler flags. This is used to set VALAFLAGS. %build_valaflags -g @@ -79,7 +79,7 @@ # the flags, while intended for ld, are still passed through the gcc # compiler driver. At the beginning of %%build, the environment # variable RPM_LD_FLAGS to this value. -%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags} %{_annotation_ldflags} %[ "%{toolchain}" == "clang" ? "%{?_clang_extra_ldflags}" : "" ] %{_build_id_flags} %{?_package_note_flags} %{?_pkg_extra_ldflags} +%build_ldflags -Wl,-z,relro %{_ld_as_needed_flags} %{_ld_symbols_flags} %{_hardened_ldflags} %{_annotation_ldflags} %[ "%{toolchain}" == "clang" ? "%{?_clang_extra_ldflags}" : "" ] %{_build_id_flags} %{?_package_note_flags} %{?_distro_extra_ldflags} # Expands to shell code to set the compiler/linker environment # variables CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, VALAFLAGS, LDFLAGS if they diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 82d0fd6..3dc603b 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 251 +%global baserelease 252 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -252,6 +252,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %doc buildflags.md %changelog +* Tue Feb 28 2023 Tom Stellard - 252-1 +- Rename _pkg_extra_* macros to _distro_extra_* + * Thu Feb 23 2023 Miro Hrončok - 251-1 - Drop the requirement of orphaned nim-srpm-macros - No Fedora package uses the %%nim_arches macro diff --git a/tests/distro-extra-flags/main.fmf b/tests/distro-extra-flags/main.fmf new file mode 100644 index 0000000..496e8c7 --- /dev/null +++ b/tests/distro-extra-flags/main.fmf @@ -0,0 +1,8 @@ +summary: > + Check that the %_distro_extra_* macros allow users to append new flags to the + list of default flags. + +require: + - rpm + +test: ./runtest.sh diff --git a/tests/distro-extra-flags/runtest.sh b/tests/distro-extra-flags/runtest.sh new file mode 100755 index 0000000..09105b0 --- /dev/null +++ b/tests/distro-extra-flags/runtest.sh @@ -0,0 +1,6 @@ +set -ex + +rpm -D '%_distro_extra_cflags -Wall' -E %{build_cflags} | grep -e '\-Wall$' +rpm -D '%_distro_extra_cxxflags -Wall' -E %{build_cxxflags} | grep -e '\-Wall$' +rpm -D '%_distro_extra_ldflags -Wall' -E %{build_ldflags} | grep -e '\-Wall$' +rpm -D '%_distro_extra_fflags -Wall' -E %{build_fflags} | grep -e '\-Wall$' diff --git a/tests/pkg-extra-flags/main.fmf b/tests/pkg-extra-flags/main.fmf deleted file mode 100644 index 069fc6b..0000000 --- a/tests/pkg-extra-flags/main.fmf +++ /dev/null @@ -1,8 +0,0 @@ -summary: > - Check that the %_pkg_extra_* macros allow users to append new flags to the - list of default flags. - -require: - - rpm - -test: ./runtest.sh diff --git a/tests/pkg-extra-flags/runtest.sh b/tests/pkg-extra-flags/runtest.sh deleted file mode 100755 index 4d65044..0000000 --- a/tests/pkg-extra-flags/runtest.sh +++ /dev/null @@ -1,6 +0,0 @@ -set -ex - -rpm -D '%_pkg_extra_cflags -Wall' -E %{build_cflags} | grep -e '\-Wall$' -rpm -D '%_pkg_extra_cxxflags -Wall' -E %{build_cxxflags} | grep -e '\-Wall$' -rpm -D '%_pkg_extra_ldflags -Wall' -E %{build_ldflags} | grep -e '\-Wall$' -rpm -D '%_pkg_extra_fflags -Wall' -E %{build_fflags} | grep -e '\-Wall$'