diff options
authorMichael Haubenwallner <>2019-09-04 12:27:33 +0200
committerSam James <>2023-05-26 07:05:52 +0100
commite1cbd953eca6c86724213363a8acc3a83c2d6b68 (patch)
tree60cd395638602dfce14f9ab9f272200721eeddf8 /prefix-stack-setup
parentapp-portage/prefix-toolkit (prefix-stack-setup): revbump (diff)
app-portage/prefix-toolkit: revbumpprefix-toolkit-5
startprefix: * On Cygwin (assumed when /proc/registry/ is available), also preserve SYSTEMDRIVE, COMSPEC and TEMP env vars, for native Windows programs. prefix-stack-setup: * Give the child prefix a private PORTAGE_TMPDIR, to not lock PORTAGE_TMPDIR in base prefix when merging in multiple childs. * Define clean CFLAGS/CXXFLAGS for the child prefix, it may use a different compiler. Instead, preserve the base prefix' CFLAGS/CXXFLAGS via package.env only for packages using the base prefix compiler. Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Michael Haubenwallner <> (cherry picked from commit 54b026b7d865a5936b16d099da8fabc372d5bd10)
Diffstat (limited to 'prefix-stack-setup')
1 files changed, 10 insertions, 4 deletions
diff --git a/prefix-stack-setup b/prefix-stack-setup
index 2b0d56e..428fa53 100644
--- a/prefix-stack-setup
+++ b/prefix-stack-setup
@@ -98,6 +98,7 @@ eend_exit() {
ebegin "creating directory structure"
set -e
+ mkdir -p "${CHILD_EPREFIX}"/var/tmp/portage
mkdir -p "${CHILD_EPREFIX}"/etc/portage/profile/use.mask
mkdir -p "${CHILD_EPREFIX}"/etc/portage/profile/use.force
mkdir -p "${CHILD_EPREFIX}"/etc/portage/env
@@ -113,11 +114,11 @@ ebegin "creating make.conf"
set -e
echo "#"
- echo "# The following values where taken from the parent prefix's"
- echo "# environment. Feel free to adopt them as you like."
+ echo "# These are sane default compiler flags, feel free to adopt them as you like."
+ echo "# Extending the flags is done to respect flags probably set by some profile."
echo "#"
- echo "CFLAGS=\"$(portageq envvar CFLAGS)\""
- echo "CXXFLAGS=\"$(portageq envvar CXXFLAGS)\""
+ echo "CFLAGS=\"\${CFLAGS} -O2 -pipe\""
+ echo "CXXFLAGS=\"${CXXFLAGS} -O2 -pipe\""
echo "MAKEOPTS=\"$(portageq envvar MAKEOPTS)\""
niceness=$(portageq envvar PORTAGE_NICENESS || true)
[[ -n ${niceness} ]] &&
@@ -131,6 +132,7 @@ ebegin "creating make.conf"
+ echo "PORTAGE_TMPDIR=\"\${EPREFIX}/var/tmp/portage\""
# Since EAPI 7 there is BDEPEND, which is DEPEND in EAPI up to 6.
# We do not want to pull DEPEND from EAPI <= 6, but RDEPEND only.
echo "EMERGE_DEFAULT_OPTS=\"--root-deps=rdeps\""
@@ -152,6 +154,10 @@ ebegin "creating env/host-cc.conf"
cat > "${CHILD_EPREFIX}"/etc/portage/env/host-cc.conf <<-EOM
+ # Inherited compiler flags from parent prefix,
+ # as the child prefix may have a different compiler.
+ CFLAGS="$(portageq envvar CFLAGS)"
+ CXXFLAGS="$(portageq envvar CXXFLAGS)"
eend_exit $?