mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-12 23:46:59 +02:00
app-arch/xz-utils: Sync with Gentoo
It's from Gentoo commit 5e95594973108f1836a35efec996cfbd69e209c0.
This commit is contained in:
parent
66d71bf365
commit
fb633eb0b0
@ -9,6 +9,7 @@
|
|||||||
<flag name="extra-filters">Build additional filters that are not
|
<flag name="extra-filters">Build additional filters that are not
|
||||||
used in any of the default xz presets. This includes delta
|
used in any of the default xz presets. This includes delta
|
||||||
and BCJ coders, additional match finders and SHA256 checks.</flag>
|
and BCJ coders, additional match finders and SHA256 checks.</flag>
|
||||||
|
<flag name="pgo">Optimize the build using Profile Guided Optimization (PGO)</flag>
|
||||||
</use>
|
</use>
|
||||||
<upstream>
|
<upstream>
|
||||||
<remote-id type="cpe">cpe:/a:tukaani:xz</remote-id>
|
<remote-id type="cpe">cpe:/a:tukaani:xz</remote-id>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
EAPI=8
|
EAPI=8
|
||||||
|
|
||||||
inherit libtool multilib multilib-minimal preserve-libs usr-ldscript
|
inherit flag-o-matic libtool multilib multilib-minimal preserve-libs usr-ldscript
|
||||||
|
|
||||||
if [[ ${PV} == 9999 ]] ; then
|
if [[ ${PV} == 9999 ]] ; then
|
||||||
# Per tukaani.org, git.tukaani.org is a mirror of github and
|
# Per tukaani.org, git.tukaani.org is a mirror of github and
|
||||||
@ -47,7 +47,7 @@ HOMEPAGE="https://tukaani.org/xz/"
|
|||||||
# See top-level COPYING file as it outlines the various pieces and their licenses.
|
# See top-level COPYING file as it outlines the various pieces and their licenses.
|
||||||
LICENSE="public-domain LGPL-2.1+ GPL-2+"
|
LICENSE="public-domain LGPL-2.1+ GPL-2+"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="doc +extra-filters nls static-libs"
|
IUSE="doc +extra-filters pgo nls static-libs"
|
||||||
|
|
||||||
if [[ ${PV} != 9999 ]] ; then
|
if [[ ${PV} != 9999 ]] ; then
|
||||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-jiatan )"
|
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-jiatan )"
|
||||||
@ -103,6 +103,26 @@ multilib_src_configure() {
|
|||||||
ECONF_SOURCE="${S}" econf "${myconf[@]}"
|
ECONF_SOURCE="${S}" econf "${myconf[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
multilib_src_compile() {
|
||||||
|
# -fprofile-partial-training because upstream note the test suite isn't super comprehensive
|
||||||
|
# See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
|
||||||
|
local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
|
||||||
|
local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
|
||||||
|
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
|
||||||
|
|
||||||
|
if use pgo ; then
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
|
||||||
|
|
||||||
|
if tc-is-clang; then
|
||||||
|
llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
emake clean
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
multilib_src_install() {
|
multilib_src_install() {
|
||||||
default
|
default
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ HOMEPAGE="https://tukaani.org/xz/"
|
|||||||
# See top-level COPYING file as it outlines the various pieces and their licenses.
|
# See top-level COPYING file as it outlines the various pieces and their licenses.
|
||||||
LICENSE="public-domain LGPL-2.1+ GPL-2+"
|
LICENSE="public-domain LGPL-2.1+ GPL-2+"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="doc +extra-filters nls static-libs"
|
IUSE="doc +extra-filters pgo nls static-libs"
|
||||||
|
|
||||||
if [[ ${PV} != 9999 ]] ; then
|
if [[ ${PV} != 9999 ]] ; then
|
||||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-jiatan )"
|
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-jiatan )"
|
||||||
@ -100,13 +100,29 @@ multilib_src_configure() {
|
|||||||
myconf+=( --disable-path-for-script )
|
myconf+=( --disable-path-for-script )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ifunc is incompatible w/ asan
|
|
||||||
# https://github.com/tukaani-project/xz/issues/62#issuecomment-1719489932
|
|
||||||
is-flagq -fsanitize=address && myconf+=( --disable-ifunc )
|
|
||||||
|
|
||||||
ECONF_SOURCE="${S}" econf "${myconf[@]}"
|
ECONF_SOURCE="${S}" econf "${myconf[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
multilib_src_compile() {
|
||||||
|
# -fprofile-partial-training because upstream note the test suite isn't super comprehensive
|
||||||
|
# See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
|
||||||
|
local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
|
||||||
|
local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
|
||||||
|
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
|
||||||
|
|
||||||
|
if use pgo ; then
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
|
||||||
|
|
||||||
|
if tc-is-clang; then
|
||||||
|
llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
emake clean
|
||||||
|
emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
multilib_src_install() {
|
multilib_src_install() {
|
||||||
default
|
default
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user