summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin41376 -> 41368 bytes
-rw-r--r--eclass/tmpfiles.eclass30
-rw-r--r--eclass/toolchain-funcs.eclass10
-rw-r--r--eclass/toolchain.eclass69
4 files changed, 66 insertions, 43 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 65fed791d8d5..841d0edfa7f4 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 2a158c482a58..6a461d4df859 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: tmpfiles.eclass
@@ -17,10 +17,16 @@
# https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
#
# The dotmpfiles and newtmpfiles functions are used to install
-# configuration files into /usr/lib/tmpfiles.d, then in pkg_postinst, the
-# tmpfiles_process function can be called to process the newly
+# configuration files into /usr/lib/tmpfiles.d, then in pkg_postinst,
+# the tmpfiles_process function must be called to process the newly
# installed tmpfiles.d entries.
#
+# The tmpfiles.d files can be used by service managers to recreate/clean
+# up temporary directories on boot or periodically. Additionally,
+# the pkg_postinst() call ensures that the directories are created
+# on systems that do not support tmpfiles.d natively, without a need
+# for explicit fallback.
+#
# @EXAMPLE:
# Typical usage of this eclass:
#
@@ -53,7 +59,7 @@ case "${EAPI}" in
*) die "API is undefined for EAPI ${EAPI}" ;;
esac
-RDEPEND="kernel_linux? ( virtual/tmpfiles )"
+RDEPEND="virtual/tmpfiles"
# @FUNCTION: dotmpfiles
# @USAGE: dotmpfiles <tmpfiles.d_file> ...
@@ -62,7 +68,6 @@ RDEPEND="kernel_linux? ( virtual/tmpfiles )"
dotmpfiles() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
local f
for f; do
if [[ ${f} != *.conf ]]; then
@@ -83,7 +88,6 @@ dotmpfiles() {
newtmpfiles() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
if [[ $2 != *.conf ]]; then
die "tmpfiles.d files must end with .conf"
fi
@@ -102,12 +106,22 @@ newtmpfiles() {
tmpfiles_process() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
[[ ${EBUILD_PHASE} == postinst ]] || die "${FUNCNAME}: Only valid in pkg_postinst"
[[ ${#} -gt 0 ]] || die "${FUNCNAME}: Must specify at least one filename"
# Only process tmpfiles for the currently running system
- [[ ${ROOT} == / ]] || return 0
+ if [[ ${ROOT} != / ]]; then
+ ewarn "Warning: tmpfiles.d not processed on ROOT != /. If you do not use"
+ ewarn "a service manager supporting tmpfiles.d, you need to run"
+ ewarn "the following command after booting (or chroot-ing with all"
+ ewarn "appropriate filesystems mounted) into the ROOT:"
+ ewarn
+ ewarn " tmpfiles --create"
+ ewarn
+ ewarn "Failure to do so may result in missing runtime directories"
+ ewarn "and failures to run programs or start services."
+ return
+ fi
if type systemd-tmpfiles &> /dev/null; then
systemd-tmpfiles --create "$@"
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index aeb6f7c70299..4b1876b8e09b 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-funcs.eclass
@@ -40,7 +40,13 @@ _tc-getPROG() {
export ${var}="${prog[*]}"
echo "${!var}"
}
-tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }
+tc-getBUILD_PROG() {
+ local vars="BUILD_$1 $1_FOR_BUILD HOST$1"
+ # respect host vars if not cross-compiling
+ # https://bugs.gentoo.org/630282
+ tc-is-cross-compiler || vars+=" $1"
+ _tc-getPROG CBUILD "${vars}" "${@:2}"
+}
tc-getPROG() { _tc-getPROG CHOST "$@"; }
# @FUNCTION: tc-getAR
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a038303ec7f5..36d344012d44 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -496,7 +496,7 @@ toolchain_src_prepare() {
do_gcc_PIE_patches
epatch_user
- if ( tc_version_is_at_least 4.8.2 || use hardened ) && ! use vanilla ; then
+ if ( tc_version_is_at_least 4.8.2 || use_if_iuse hardened ) && ! use vanilla ; then
make_gcc_hard
fi
@@ -538,7 +538,7 @@ toolchain_src_prepare() {
fi
# >= gcc-4.3 doesn't bundle ecj.jar, so copy it
- if tc_version_is_at_least 4.3 && use gcj ; then
+ if tc_version_is_at_least 4.3 && use_if_iuse gcj ; then
if tc_version_is_at_least 4.5 ; then
einfo "Copying ecj-4.5.jar"
cp -pPR "${DISTDIR}/ecj-4.5.jar" "${S}/ecj.jar" || die
@@ -648,20 +648,20 @@ make_gcc_hard() {
# Gcc >= 6.X we can use configurations options to turn pie/ssp on as default
if tc_version_is_at_least 6.0 ; then
- if use pie ; then
+ if use_if_iuse pie ; then
einfo "Updating gcc to use automatic PIE building ..."
fi
- if use ssp ; then
+ if use_if_iuse ssp ; then
einfo "Updating gcc to use automatic SSP building ..."
fi
- if use hardened ; then
+ if use_if_iuse hardened ; then
# Will add some optimatizion as default.
gcc_hard_flags+=" -DEXTRA_OPTIONS"
# rebrand to make bug reports easier
BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
fi
else
- if use hardened ; then
+ if use_if_iuse hardened ; then
# rebrand to make bug reports easier
BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
if hardened_gcc_works ; then
@@ -909,7 +909,7 @@ toolchain_src_configure() {
# Use the default ("release") checking because upstream usually neglects
# to test "disabled" so it has a history of breaking. #317217
- if tc_version_is_at_least 3.4 ; then
+ if tc_version_is_at_least 3.4 && in_iuse debug ; then
# The "release" keyword is new to 4.0. #551636
local off=$(tc_version_is_at_least 4.0 && echo release || echo no)
confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug yes ${off})}" )
@@ -922,7 +922,7 @@ toolchain_src_configure() {
)
# If we want hardened support with the newer piepatchset for >=gcc 4.4
- if tc_version_is_at_least 4.4 && want_minispecs ; then
+ if tc_version_is_at_least 4.4 && want_minispecs && in_iuse hardened ; then
confgcc+=( $(use_enable hardened esp) )
fi
@@ -934,7 +934,7 @@ toolchain_src_configure() {
fi
# Support to disable pch when building libstdcxx
- if tc_version_is_at_least 6.0 && ! use pch ; then
+ if tc_version_is_at_least 6.0 && ! use_if_iuse pch ; then
confgcc+=( --disable-libstdcxx-pch )
fi
@@ -1058,12 +1058,12 @@ toolchain_src_configure() {
gcc-multilib-configure
# ppc altivec support
- confgcc+=( $(use_enable altivec) )
+ in_iuse altivec && confgcc+=( $(use_enable altivec) )
# gcc has fixed-point arithmetic support in 4.3 for mips targets that can
# significantly increase compile time by several hours. This will allow
# users to control this feature in the event they need the support.
- tc_version_is_at_least 4.3 && confgcc+=( $(use_enable fixed-point) )
+ tc_version_is_at_least 4.3 && in_iuse fixed-point && confgcc+=( $(use_enable fixed-point) )
case $(tc-is-softfloat) in
yes) confgcc+=( --with-float=soft ) ;;
@@ -1229,23 +1229,26 @@ toolchain_src_configure() {
# graphite was added in 4.4 but we only support it in 4.8+ due to external
# library issues. #448024
- if tc_version_is_at_least 5.0 ; then
+ if tc_version_is_at_least 5.0 && in_iuse graphite ; then
confgcc+=( $(use_with graphite isl) )
use graphite && confgcc+=( --disable-isl-version-check )
- elif tc_version_is_at_least 4.8 ; then
+ elif tc_version_is_at_least 4.8 && in_iuse graphite ; then
confgcc+=( $(use_with graphite cloog) )
use graphite && confgcc+=( --disable-isl-version-check )
elif tc_version_is_at_least 4.4 ; then
confgcc+=( --without-{cloog,ppl} )
fi
- if tc_version_is_at_least 4.8 ; then
+ if tc_version_is_at_least 4.8 && in_iuse sanitize ; then
confgcc+=( $(use_enable sanitize libsanitizer) )
fi
- if tc_version_is_at_least 6.0 ; then
+ if tc_version_is_at_least 6.0 && in_iuse pie ; then
+ confgcc+=( $(use_enable pie default-pie) )
+ fi
+
+ if tc_version_is_at_least 6.0 && in_iuse ssp ; then
confgcc+=(
- $(use_enable pie default-pie)
# This defaults to -fstack-protector-strong.
$(use_enable ssp default-ssp)
)
@@ -1575,7 +1578,7 @@ gcc_do_make() {
# resulting binaries natively ^^;
GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all}
else
- if tc_version_is_at_least 3.3 && use pgo; then
+ if tc_version_is_at_least 3.3 && use_if_iuse pgo; then
GCC_MAKE_TARGET=${GCC_MAKE_TARGET-profiledbootstrap}
else
GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean}
@@ -1619,7 +1622,7 @@ gcc_do_make() {
${GCC_MAKE_TARGET} \
|| die "emake failed with ${GCC_MAKE_TARGET}"
- if ! is_crosscompile && use cxx && use_if_iuse doc ; then
+ if ! is_crosscompile && use_if_iuse cxx && use_if_iuse doc ; then
if type -p doxygen > /dev/null ; then
if tc_version_is_at_least 4.3 ; then
cd "${CTARGET}"/libstdc++-v3/doc
@@ -1786,7 +1789,7 @@ toolchain_src_install() {
# Rather install the script, else portage with changing $FILESDIR
# between binary and source package borks things ....
- if ! is_crosscompile ; then
+ if ! is_crosscompile && [[ ${PN} != "kgcc64" ]] ; then
insinto "${DATAPATH#${EPREFIX}}"
newins "$(prefixify_ro "${FILESDIR}"/awk/fixlafiles.awk-no_gcc_la)" fixlafiles.awk || die
exeinto "${DATAPATH#${EPREFIX}}"
@@ -2080,7 +2083,7 @@ toolchain_pkg_postinst() {
eselect compiler-shadow update all
fi
- if ! is_crosscompile ; then
+ if ! is_crosscompile && [[ ${PN} != "kgcc64" ]] ; then
echo
ewarn "If you have issues with packages unable to locate libstdc++.la,"
ewarn "then try running 'fix_libtool_files.sh' on the old gcc versions."
@@ -2245,13 +2248,13 @@ gcc-lang-supported() {
is_ada() {
gcc-lang-supported ada || return 1
- use ada
+ use_if_iuse ada
}
is_cxx() {
gcc-lang-supported 'c++' || return 1
! is_crosscompile && tc_version_is_at_least 4.8 && return 0
- use cxx
+ use_if_iuse cxx
}
is_d() {
@@ -2261,27 +2264,27 @@ is_d() {
is_f77() {
gcc-lang-supported f77 || return 1
- use fortran
+ use_if_iuse fortran
}
is_f95() {
gcc-lang-supported f95 || return 1
- use fortran
+ use_if_iuse fortran
}
is_fortran() {
gcc-lang-supported fortran || return 1
- use fortran
+ use_if_iuse fortran
}
is_gcj() {
gcc-lang-supported java || return 1
- use cxx && use_if_iuse gcj
+ use_if_iuse cxx && use_if_iuse gcj
}
is_go() {
gcc-lang-supported go || return 1
- use cxx && use_if_iuse go
+ use_if_iuse cxx && use_if_iuse go
}
is_jit() {
@@ -2291,7 +2294,7 @@ is_jit() {
is_multilib() {
tc_version_is_at_least 3 || return 1
- use multilib
+ use_if_iuse multilib
}
is_objc() {
@@ -2301,7 +2304,7 @@ is_objc() {
is_objcxx() {
gcc-lang-supported 'obj-c++' || return 1
- use cxx && use_if_iuse objc++
+ use_if_iuse cxx && use_if_iuse objc++
}
# Grab a variable from the build system (taken from linux-info.eclass)
@@ -2369,12 +2372,12 @@ want_minispecs() {
if tc_version_is_at_least 6.0 ; then
return 0
fi
- if tc_version_is_at_least 4.3.2 && use hardened ; then
+ if tc_version_is_at_least 4.3.2 && use_if_iuse hardened ; then
if ! want_pie ; then
ewarn "PIE_VER or SPECS_VER is not defined in the GCC ebuild."
elif use vanilla ; then
ewarn "You will not get hardened features if you have the vanilla USE-flag."
- elif use nopie && use nossp ; then
+ elif use_if_iuse nopie && use_if_iuse nossp ; then
ewarn "You will not get hardened features if you have the nopie and nossp USE-flag."
elif ! hardened_gcc_works ; then
ewarn "Your $(tc-arch) arch is not supported."
@@ -2388,11 +2391,11 @@ want_minispecs() {
}
want_pie() {
- ! use hardened && [[ -n ${PIE_VER} ]] && use nopie && return 1
+ ! use_if_iuse hardened && [[ -n ${PIE_VER} ]] && use_if_iuse nopie && return 1
[[ -n ${PIE_VER} ]] && [[ -n ${SPECS_VER} ]] && return 0
tc_version_is_at_least 4.3.2 && return 1
[[ -z ${PIE_VER} ]] && return 1
- use !nopie && return 0
+ use_if_iuse nopie || return 0
return 1
}