@@ -665,16 +665,7 @@ tc-ninja_magic_to_arch() {
665
665
frv* ) echo frv;;
666
666
hexagon* ) echo hexagon;;
667
667
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;;
678
669
ia64* ) echo ia64;;
679
670
loongarch* ) _tc_echo_kernel_alias loongarch loong;;
680
671
m68* ) echo m68k;;
@@ -1062,8 +1053,7 @@ gen_usr_ldscript() {
1062
1053
case ${CTARGET:- ${CHOST} } in
1063
1054
* -darwin* ) ;;
1064
1055
* -android* ) return 0 ;;
1065
- * linux* |* -freebsd* |* -openbsd* |* -netbsd* )
1066
- use prefix && return 0 ;;
1056
+ * linux* ) use prefix && return 0 ;;
1067
1057
* ) return 0 ;;
1068
1058
esac
1069
1059
@@ -1255,21 +1245,33 @@ tc-get-build-ptr-size() {
1255
1245
# @RETURN: Shell true if we are using LTO, shell false otherwise
1256
1246
tc-is-lto () {
1257
1247
local f=" ${T} /test-lto.o"
1248
+ local ret=1
1258
1249
1259
1250
case $( tc-get-compiler-type) in
1260
1251
clang)
1261
1252
$( tc-getCC) ${CFLAGS} -c -o " ${f} " -x c - <<< " " || die
1262
1253
# If LTO is used, clang will output bytecode and llvm-bcanalyzer
1263
1254
# will run successfully. Otherwise, it will output plain object
1264
1255
# file and llvm-bcanalyzer will exit with error.
1265
- llvm-bcanalyzer " ${f} " & > /dev/null && return 0
1256
+ llvm-bcanalyzer " ${f} " & > /dev/null && ret= 0
1266
1257
;;
1267
1258
gcc)
1268
1259
$( 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
1270
1261
;;
1271
1262
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 $?
1273
1275
}
1274
1276
1275
1277
fi
0 commit comments