Skip to content

Commit 5beccb2

Browse files
committed
eclass/toolchain-funcs: sync with gx86
Signed-off-by: Fabian Groffen <[email protected]>
1 parent 27820f8 commit 5beccb2

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

eclass/toolchain-funcs.eclass

+17-15
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,7 @@ tc-ninja_magic_to_arch() {
665665
frv*) echo frv;;
666666
hexagon*) echo hexagon;;
667667
hppa*) _tc_echo_kernel_alias parisc hppa;;
668-
i?86*)
669-
# Starting with linux-2.6.24, the 'x86_64' and 'i386'
670-
# trees have been unified into 'x86'.
671-
# FreeBSD still uses i386
672-
if [[ ${type} == "kern" && ${host} == *freebsd* ]] ; then
673-
echo i386
674-
else
675-
echo x86
676-
fi
677-
;;
668+
i?86*) echo x86;;
678669
ia64*) echo ia64;;
679670
loongarch*) _tc_echo_kernel_alias loongarch loong;;
680671
m68*) echo m68k;;
@@ -1062,8 +1053,7 @@ gen_usr_ldscript() {
10621053
case ${CTARGET:-${CHOST}} in
10631054
*-darwin*) ;;
10641055
*-android*) return 0 ;;
1065-
*linux*|*-freebsd*|*-openbsd*|*-netbsd*)
1066-
use prefix && return 0 ;;
1056+
*linux*) use prefix && return 0 ;;
10671057
*) return 0 ;;
10681058
esac
10691059

@@ -1255,21 +1245,33 @@ tc-get-build-ptr-size() {
12551245
# @RETURN: Shell true if we are using LTO, shell false otherwise
12561246
tc-is-lto() {
12571247
local f="${T}/test-lto.o"
1248+
local ret=1
12581249

12591250
case $(tc-get-compiler-type) in
12601251
clang)
12611252
$(tc-getCC) ${CFLAGS} -c -o "${f}" -x c - <<<"" || die
12621253
# If LTO is used, clang will output bytecode and llvm-bcanalyzer
12631254
# will run successfully. Otherwise, it will output plain object
12641255
# file and llvm-bcanalyzer will exit with error.
1265-
llvm-bcanalyzer "${f}" &>/dev/null && return 0
1256+
llvm-bcanalyzer "${f}" &>/dev/null && ret=0
12661257
;;
12671258
gcc)
12681259
$(tc-getCC) ${CFLAGS} -c -o "${f}" -x c - <<<"" || die
1269-
[[ $($(tc-getREADELF) -S "${f}") == *.gnu.lto* ]] && return 0
1260+
[[ $($(tc-getREADELF) -S "${f}") == *.gnu.lto* ]] && ret=0
12701261
;;
12711262
esac
1272-
return 1
1263+
rm -f "${f}" || die
1264+
return "${ret}"
1265+
}
1266+
1267+
# @FUNCTION: tc-has-64bit-time_t
1268+
# @RETURN: Shell true if time_t is at least 64 bits long, false otherwise
1269+
tc-has-64bit-time_t() {
1270+
$(tc-getCC) ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null <<-EOF &>/dev/null
1271+
#include <sys/types.h>
1272+
int test[sizeof(time_t) >= 8 ? 1 : -1];
1273+
EOF
1274+
return $?
12731275
}
12741276

12751277
fi

0 commit comments

Comments
 (0)