summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-06-11 23:09:25 -0400
committerMike Frysinger <vapier@gentoo.org>2016-06-11 23:57:19 -0400
commit027dcae26afbe794cd4eef929f8bdc27bb602880 (patch)
tree972a6b678726774d1aab0860a2dab0e5019187c9 /eclass
parent261bb9fd3ee929a2d3db8d7b00b64d4a2e28aea9 (diff)
downloadgentoo-027dcae26afbe794cd4eef929f8bdc27bb602880.tar.gz
gentoo-027dcae26afbe794cd4eef929f8bdc27bb602880.tar.xz
mysql-cmake/mysql-multilib eclasses: set STACK_DIRECTION to fix cross-compiles
Diffstat (limited to 'eclass')
-rw-r--r--eclass/mysql-cmake.eclass6
-rw-r--r--eclass/mysql-multilib-r1.eclass3
-rw-r--r--eclass/toolchain-funcs.eclass15
3 files changed, 23 insertions, 1 deletions
diff --git a/eclass/mysql-cmake.eclass b/eclass/mysql-cmake.eclass
index 0f0f5b448fd..f14c9a7cf67 100644
--- a/eclass/mysql-cmake.eclass
+++ b/eclass/mysql-cmake.eclass
@@ -16,7 +16,7 @@
# the src_prepare, src_configure, src_compile, and src_install
# phase hooks.
-inherit cmake-utils flag-o-matic multilib prefix eutils
+inherit cmake-utils flag-o-matic multilib prefix eutils toolchain-funcs
#
# HELPER FUNCTIONS:
@@ -243,6 +243,10 @@ configure_cmake_standard() {
if mysql_version_is_at_least "10.1.2" ; then
mycmakeargs+=( $(mysql-cmake_use_plugin cracklib CRACKLIB_PASSWORD_CHECK ) )
fi
+
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ mycmakeargs+=( -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1) )
else
mycmakeargs+=( $(cmake-utils_use_with extraengine FEDERATED_STORAGE_ENGINE) )
fi
diff --git a/eclass/mysql-multilib-r1.eclass b/eclass/mysql-multilib-r1.eclass
index 40ef8f54428..858b9b65d6c 100644
--- a/eclass/mysql-multilib-r1.eclass
+++ b/eclass/mysql-multilib-r1.eclass
@@ -401,6 +401,9 @@ multilib_src_configure() {
-DWITH_DEFAULT_FEATURE_SET=0
-DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
-DENABLE_STATIC_LIBS=$(usex static-libs)
+ # The build forces this to be defined when cross-compiling. We pass it
+ # all the time for simplicity and to make sure it is actually correct.
+ -DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
)
if use test ; then
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index cf95d04ad66..e794559bbcf 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -221,6 +221,21 @@ tc-is-static-only() {
[[ ${host} == *-mint* ]]
}
+# @FUNCTION: tc-stack-grows-down
+# @DESCRIPTION:
+# Return shell true if the stack grows down. This is the default behavior
+# for the vast majority of systems out there and usually projects shouldn't
+# care about such internal details.
+tc-stack-grows-down() {
+ # List the few that grow up.
+ case ${ARCH} in
+ hppa|metag) return 1 ;;
+ esac
+
+ # Assume all others grow down.
+ return 0
+}
+
# @FUNCTION: tc-export_build_env
# @USAGE: [compiler variables]
# @DESCRIPTION: