commit:     5beccb25160494deedb1112b34b2c51e5ac7bd21
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 10 10:47:49 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Aug 10 10:47:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5beccb25

eclass/toolchain-funcs: sync with gx86

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 eclass/toolchain-funcs.eclass | 32 +++++++++++++++++---------------
 1 file 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

Reply via email to