summaryrefslogtreecommitdiff
path: root/eclass/toolchain-funcs.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /eclass/toolchain-funcs.eclass
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass38
1 files changed, 34 insertions, 4 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 77fb304940b2..17c075895d55 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 2002-2021 Gentoo Authors
+# Copyright 2002-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-funcs.eclass
@@ -453,6 +453,9 @@ econf_build() {
tc-ld-is-gold() {
local out
+ # Ensure ld output is in English.
+ local -x LC_ALL=C
+
# First check the linker directly.
out=$($(tc-getLD "$@") --version 2>&1)
if [[ ${out} == *"GNU gold"* ]] ; then
@@ -483,6 +486,9 @@ tc-ld-is-gold() {
tc-ld-is-lld() {
local out
+ # Ensure ld output is in English.
+ local -x LC_ALL=C
+
# First check the linker directly.
out=$($(tc-getLD "$@") --version 2>&1)
if [[ ${out} == *"LLD"* ]] ; then
@@ -569,11 +575,12 @@ tc-ld-force-bfd() {
fi
}
-# @FUNCTION: tc-has-openmp
+# @FUNCTION: _tc-has-openmp
+# @INTERNAL
# @USAGE: [toolchain prefix]
# @DESCRIPTION:
# See if the toolchain supports OpenMP.
-tc-has-openmp() {
+_tc-has-openmp() {
local base="${T}/test-tc-openmp"
cat <<-EOF > "${base}.c"
#include <omp.h>
@@ -593,6 +600,16 @@ tc-has-openmp() {
return ${ret}
}
+# @FUNCTION: tc-has-openmp
+# @DEPRECATED: tc-check-openmp
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# See if the toolchain supports OpenMP. This function is deprecated and will be
+# removed on 2023-01-01.
+tc-has-openmp() {
+ _tc-has-openmp "$@"
+}
+
# @FUNCTION: tc-check-openmp
# @DESCRIPTION:
# Test for OpenMP support with the current compiler and error out with
@@ -600,8 +617,21 @@ tc-has-openmp() {
# OpenMP support that has been requested by the ebuild. Using this function
# to test for OpenMP support should be preferred over tc-has-openmp and
# printing a custom message, as it presents a uniform interface to the user.
+#
+# You should test for any necessary OpenMP support in pkg_pretend in order to
+# warn the user of required toolchain changes. You must still check for OpenMP
+# support at build-time, e.g.
+# @CODE
+# pkg_pretend() {
+# [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+# }
+#
+# pkg_setup() {
+# [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+# }
+# @CODE
tc-check-openmp() {
- if ! tc-has-openmp; then
+ if ! _tc-has-openmp; then
eerror "Your current compiler does not support OpenMP!"
if tc-is-gcc; then