summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2024-08-10 12:47:49 +0200
committerFabian Groffen <grobian@gentoo.org>2024-08-10 12:47:49 +0200
commit5beccb25160494deedb1112b34b2c51e5ac7bd21 (patch)
tree26f66d5c4f7d4f1a595edc1bb833b35831c7c34c
parenteclass/toolchain-funcs: return arch from tc-ninja_magic_to_arch (diff)
downloadprefix-5beccb25160494deedb1112b34b2c51e5ac7bd21.tar.gz
prefix-5beccb25160494deedb1112b34b2c51e5ac7bd21.tar.bz2
prefix-5beccb25160494deedb1112b34b2c51e5ac7bd21.zip
eclass/toolchain-funcs: sync with gx86
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--eclass/toolchain-funcs.eclass32
1 files changed, 17 insertions, 15 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 156e659aa3..a39b9c6111 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -665,16 +665,7 @@ tc-ninja_magic_to_arch() {
frv*) echo frv;;
hexagon*) echo hexagon;;
hppa*) _tc_echo_kernel_alias parisc hppa;;
- i?86*)
- # Starting with linux-2.6.24, the 'x86_64' and 'i386'
- # trees have been unified into 'x86'.
- # FreeBSD still uses i386
- if [[ ${type} == "kern" && ${host} == *freebsd* ]] ; then
- echo i386
- else
- echo x86
- fi
- ;;
+ i?86*) echo x86;;
ia64*) echo ia64;;
loongarch*) _tc_echo_kernel_alias loongarch loong;;
m68*) echo m68k;;
@@ -1062,8 +1053,7 @@ gen_usr_ldscript() {
case ${CTARGET:-${CHOST}} in
*-darwin*) ;;
*-android*) return 0 ;;
- *linux*|*-freebsd*|*-openbsd*|*-netbsd*)
- use prefix && return 0 ;;
+ *linux*) use prefix && return 0 ;;
*) return 0 ;;
esac
@@ -1255,6 +1245,7 @@ tc-get-build-ptr-size() {
# @RETURN: Shell true if we are using LTO, shell false otherwise
tc-is-lto() {
local f="${T}/test-lto.o"
+ local ret=1
case $(tc-get-compiler-type) in
clang)
@@ -1262,14 +1253,25 @@ tc-is-lto() {
# If LTO is used, clang will output bytecode and llvm-bcanalyzer
# will run successfully. Otherwise, it will output plain object
# file and llvm-bcanalyzer will exit with error.
- llvm-bcanalyzer "${f}" &>/dev/null && return 0
+ llvm-bcanalyzer "${f}" &>/dev/null && ret=0
;;
gcc)
$(tc-getCC) ${CFLAGS} -c -o "${f}" -x c - <<<"" || die
- [[ $($(tc-getREADELF) -S "${f}") == *.gnu.lto* ]] && return 0
+ [[ $($(tc-getREADELF) -S "${f}") == *.gnu.lto* ]] && ret=0
;;
esac
- return 1
+ rm -f "${f}" || die
+ return "${ret}"
+}
+
+# @FUNCTION: tc-has-64bit-time_t
+# @RETURN: Shell true if time_t is at least 64 bits long, false otherwise
+tc-has-64bit-time_t() {
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null <<-EOF &>/dev/null
+ #include <sys/types.h>
+ int test[sizeof(time_t) >= 8 ? 1 : -1];
+ EOF
+ return $?
}
fi