diff options
author | Repository mirror & CI <repomirrorci@gentoo.org> | 2022-01-22 22:38:31 +0000 |
---|---|---|
committer | Repository mirror & CI <repomirrorci@gentoo.org> | 2022-01-22 22:38:31 +0000 |
commit | 0706a3bccb6bd08ef7c7e0c2235a00269d4e0054 (patch) | |
tree | b8e3a9e8ac76e3fba3779aa723fbb999ea6124f3 | |
parent | 2022-01-22 22:07:00 UTC (diff) | |
parent | autotools.eclass: update for autoconf 2.71 (diff) | |
download | gentoo-0706a3bccb6bd08ef7c7e0c2235a00269d4e0054.tar.gz gentoo-0706a3bccb6bd08ef7c7e0c2235a00269d4e0054.tar.bz2 gentoo-0706a3bccb6bd08ef7c7e0c2235a00269d4e0054.zip |
Merge updates from master
-rw-r--r-- | eclass/autotools.eclass | 34 | ||||
-rw-r--r-- | eclass/flag-o-matic.eclass | 52 |
2 files changed, 59 insertions, 27 deletions
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index 95c92cc6df8c..85be205c1032 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: autotools.eclass @@ -74,7 +74,7 @@ inherit gnuconfig libtool # Do NOT change this variable in your ebuilds! # If you want to force a newer minor version, you can specify the correct # WANT value by using a colon: <PV>:<WANT_AUTOMAKE> -_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) +_LATEST_AUTOMAKE=( 1.16.4:1.16 ) _automake_atom="sys-devel/automake" _autoconf_atom="sys-devel/autoconf" @@ -95,7 +95,7 @@ if [[ -n ${WANT_AUTOCONF} ]] ; then none) _autoconf_atom="" ;; # some packages don't require autoconf at all 2.1) _autoconf_atom="~sys-devel/autoconf-2.13" ;; # if you change the "latest" version here, change also autotools_env_setup - latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.69" ;; + latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.71" ;; *) die "Invalid WANT_AUTOCONF value '${WANT_AUTOCONF}'" ;; esac export WANT_AUTOCONF @@ -332,8 +332,26 @@ eaclocal_amflags() { # They also force installing the support files for safety. # Respects AT_M4DIR for additional directories to search for macros. eaclocal() { + # Feed in a list of paths: + # - ${BROOT}/usr/share/aclocal + # - ${ESYSROOT}/usr/share/aclocal + # See bug #677002 + if [[ ${EAPI} != [56] ]] ; then + if [[ ! -f "${T}"/aclocal/dirlist ]] ; then + mkdir "${T}"/aclocal || die + cat <<- EOF > "${T}"/aclocal/dirlist || die + ${BROOT}/usr/share/aclocal + ${ESYSROOT}/usr/share/aclocal + EOF + fi + + local system_acdir=" --system-acdir=${T}/aclocal" + else + local system_acdir="" + fi + [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ - autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) + autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) ${system_acdir} } # @FUNCTION: _elibtoolize @@ -510,7 +528,7 @@ autotools_env_setup() { [[ ${WANT_AUTOMAKE} == "latest" ]] && \ die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}" fi - [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.5 + [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.71 } # @FUNCTION: autotools_run_tool @@ -666,12 +684,6 @@ autotools_m4sysdir_include() { # First try to use the paths the system integrator has set up. local paths=( $(eval echo ${AT_SYS_M4DIR}) ) - if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then - # If they didn't give us anything, then default to the SYSROOT. - # This helps when cross-compiling. - local path="${SYSROOT}/usr/share/aclocal" - [[ -d ${path} ]] && paths+=( "${path}" ) - fi _autotools_m4dir_include "${paths[@]}" } diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 32119cb9a526..50caa401bacf 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: flag-o-matic.eclass @@ -48,21 +48,39 @@ setup-allowed-flags() { # Note: shell globs and character lists are allowed _setup-allowed-flags() { ALLOWED_FLAGS=( - -pipe -O '-O[12sg]' -mcpu -march -mtune + -pipe -O '-O[12sg]' '-mcpu=*' '-march=*' '-mtune=*' + + # Hardening flags '-fstack-protector*' - '-fsanitize*' '-fno-sanitize*' '-fstack-check*' -fno-stack-check - -fbounds-check -fbounds-checking -fno-strict-overflow - -fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time + -fstack-clash-protection + '-fcf-protection=*' + -fbounds-check -fbounds-checking + -fno-PIE -fno-pie -nopie -no-pie + # Spectre mitigations, bug #646076 + '-mindirect-branch=*' + -mindirect-branch-register + '-mfunction-return=*' + -mretpoline + + # Misc + -fno-unit-at-a-time -fno-strict-overflow + + # Sanitizers + '-fsanitize*' '-fno-sanitize*' - # debugging symbols should generally be very safe to add + # Debugging symbols should generally be very safe to add -g '-g[0-9]' -ggdb '-ggdb[0-9]' -gdwarf '-gdwarf-*' -gstabs -gstabs+ -gz + -glldb + # Cosmetic/output related, see e.g. bug #830534 + -fno-diagnostics-color '-fmessage-length=*' -fno-ident -fpermissive -frecord-gcc-switches + -frecord-command-line '-fdiagnostics*' '-fplugin*' '-W*' -w @@ -70,7 +88,7 @@ _setup-allowed-flags() { '-[DUILR]*' '-Wl,*' # Linker choice flag - '-fuse-ld' + '-fuse-ld=*' ) # allow a bunch of flags that negate features / control ABI @@ -80,19 +98,22 @@ _setup-allowed-flags() { -fno-omit-frame-pointer '-fno-builtin*' ) ALLOWED_FLAGS+=( - -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse + '-mregparm=*' -mno-app-regs -mapp-regs -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt - -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu - -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe + -msoft-float -mno-soft-float -mhard-float -mno-hard-float '-mfpu=*' + -mieee -mieee-with-inexact '-mschedule=*' -mfloat-gprs -mspe -mno-spe -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat - -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi - -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel - -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi + -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 '-mabi=*' + -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 '-mcmodel=*' + -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' '-mfloat-abi=*' -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 -mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000 - -mr10k-cache-barrier -mthumb -marm + '-mr10k-cache-barrier=*' -mthumb -marm + + # needed for arm64 (and in particular SCS) + -ffixed-x18 # gcc 4.5 -mno-fma4 -mno-movbe -mno-xop -mno-lwp @@ -452,9 +473,8 @@ strip-flags() { local new=() for x in ${!var} ; do - local flag=${x%%=*} for y in "${ALLOWED_FLAGS[@]}" ; do - if [[ -z ${flag%%${y}} ]] ; then + if [[ ${x} == ${y} ]] ; then new+=( "${x}" ) break fi |