summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/build/cc/gcc.sh10
-rw-r--r--scripts/functions15
2 files changed, 25 insertions, 0 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index d4c1b43..8fd39b7 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -453,6 +453,16 @@ do_gcc_core_backend() {
extra_config+=("--disable-libstdcxx-pch")
fi
+ if [ "${CT_LIBC_GLIBC}" = "y" ]; then
+ # Report GLIBC's version to GCC, it affects the defaults on other options.
+ # Pass-2 should be able to get it from the headers, but for some options
+ # (such as --with-long-double-128) we need to get it right even in pass-1.
+ # GCC expects just two numbers separated by a dot.
+ local glibc_version=`CT_GetPkgVersion GLIBC | sed 's/\([1-9][0-9]*\.[1-9][0-9]*\).*/\1/'`
+
+ extra_config+=("--with-glibc-version=${glibc_version}")
+ fi
+
case "${CT_CC_GCC_LDBL_128}" in
y) extra_config+=("--with-long-double-128");;
m) ;;
diff --git a/scripts/functions b/scripts/functions
index cc7e131..26ff88a 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1713,6 +1713,7 @@ CT_PackageRun()
# Fetching the sources is run in the main process, so no need to
# use CT_EnvModify.
for v in devel_branch devel_revision basename version; do
+ eval "[ \"\${${v}}\" != \"\${CT_${use}_${v^^}}\" ] || continue"
eval "CT_${use}_${v^^}=\${${v}}"
eval "CT_DoLog DEBUG \"Override CT_${use}_${v^^}=\${CT_${use}_${v^^}}\""
done
@@ -2009,3 +2010,17 @@ CT_ExtractPatch()
shift
CT_PackageRun "${pkg}" CT_DoExtractPatch "$@"
}
+
+CT_DoGetPkgVersion()
+{
+ echo "${version}"
+}
+
+# Get the version of the package (main or fork)
+CT_GetPkgVersion()
+{
+ local pkg="${1}"
+ shift
+
+ CT_PackageRun "${pkg}" CT_DoGetPkgVersion
+}