704 lines
21 KiB
Diff
704 lines
21 KiB
Diff
From 64050ef082f7f3af78cc136c17c995d62cec14b5 Mon Sep 17 00:00:00 2001
|
|
From: swcompiler <lc@wxiat.com>
|
|
Date: Mon, 25 Nov 2024 16:25:58 +0800
|
|
Subject: [PATCH 01/16] Sw64 Port: add configure support for sw64
|
|
|
|
---
|
|
Makefile.in | 1 +
|
|
Makefile.tpl | 1 +
|
|
config.guess | 12 ++++
|
|
config.sub | 1 +
|
|
config/intdiv0.m4 | 2 +-
|
|
config/mt-sw_64ieee | 3 +
|
|
config/tcl.m4 | 6 ++
|
|
configure | 16 ++++-
|
|
configure.ac | 19 +++++-
|
|
contrib/config-list.mk | 1 +
|
|
gcc/config.gcc | 35 +++++++++++
|
|
gcc/config.host | 8 +++
|
|
gcc/config.in | 17 +++++
|
|
gcc/config/host-linux.cc | 2 +
|
|
gcc/configure | 131 ++++++++++++++++++++++++++++++++++++++-
|
|
gcc/configure.ac | 84 ++++++++++++++++++++++++-
|
|
gcc/doc/install.texi | 9 +++
|
|
17 files changed, 342 insertions(+), 6 deletions(-)
|
|
create mode 100644 config/mt-sw_64ieee
|
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
|
index 7785b3d9a..283c16c4e 100644
|
|
--- a/Makefile.in
|
|
+++ b/Makefile.in
|
|
@@ -707,6 +707,7 @@ all:
|
|
@target_makefile_frag@
|
|
@alphaieee_frag@
|
|
@ospace_frag@
|
|
+@sw_64ieee_frag@
|
|
@host_makefile_frag@
|
|
###
|
|
|
|
diff --git a/Makefile.tpl b/Makefile.tpl
|
|
index ef58fac2b..d629bca8b 100644
|
|
--- a/Makefile.tpl
|
|
+++ b/Makefile.tpl
|
|
@@ -630,6 +630,7 @@ all:
|
|
@target_makefile_frag@
|
|
@alphaieee_frag@
|
|
@ospace_frag@
|
|
+@sw_64ieee_frag@
|
|
@host_makefile_frag@
|
|
###
|
|
|
|
diff --git a/config.guess b/config.guess
|
|
index 1972fda8e..0275a0ef8 100755
|
|
--- a/config.guess
|
|
+++ b/config.guess
|
|
@@ -1101,6 +1101,18 @@ EOF
|
|
sparc:Linux:*:* | sparc64:Linux:*:*)
|
|
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
|
exit ;;
|
|
+ sw_64:Linux:*:*)
|
|
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
|
+ SW6) UNAME_MACHINE=sw_64sw6 ;;
|
|
+ SW6A) UNAME_MACHINE=sw_64sw6a ;;
|
|
+ SW6B) UNAME_MACHINE=sw_64sw6b ;;
|
|
+ SW8A) UNAME_MACHINE=sw_64sw8a ;;
|
|
+ SW) UNAME_MACHINE=sw_64 ;;
|
|
+ esac
|
|
+ objdump --private-headers /bin/sh | grep -q ld.so.1
|
|
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
|
|
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
+ exit ;;
|
|
tile*:Linux:*:*)
|
|
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
|
exit ;;
|
|
diff --git a/config.sub b/config.sub
|
|
index 38f3d037a..70ff2e6e4 100755
|
|
--- a/config.sub
|
|
+++ b/config.sub
|
|
@@ -1262,6 +1262,7 @@ case $cpu-$vendor in
|
|
| sparclite \
|
|
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
|
|
| spu \
|
|
+ | sw_64 | sw_64sw6a | sw_64sw6b | sw_64sw8a \
|
|
| tahoe \
|
|
| thumbv7* \
|
|
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
|
|
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
|
|
index 55dddcf1c..bfe1bdcdf 100644
|
|
--- a/config/intdiv0.m4
|
|
+++ b/config/intdiv0.m4
|
|
@@ -56,7 +56,7 @@ int main ()
|
|
[
|
|
# Guess based on the CPU.
|
|
case "$host_cpu" in
|
|
- alpha* | i[34567]86 | m68k | s390*)
|
|
+ alpha* | i[34567]86 | m68k | s390* | sw_64*)
|
|
gt_cv_int_divbyzero_sigfpe="guessing yes";;
|
|
*)
|
|
gt_cv_int_divbyzero_sigfpe="guessing no";;
|
|
diff --git a/config/mt-sw_64ieee b/config/mt-sw_64ieee
|
|
new file mode 100644
|
|
index 000000000..80c17cdc6
|
|
--- /dev/null
|
|
+++ b/config/mt-sw_64ieee
|
|
@@ -0,0 +1,3 @@
|
|
+CFLAGS_FOR_TARGET += -mieee
|
|
+CXXFLAGS_FOR_TARGET += -mieee
|
|
+GOCFLAGS_FOR_TARGET += -mieee
|
|
diff --git a/config/tcl.m4 b/config/tcl.m4
|
|
index 4542a4b23..c58bf5343 100644
|
|
--- a/config/tcl.m4
|
|
+++ b/config/tcl.m4
|
|
@@ -1368,6 +1368,9 @@ dnl AC_CHECK_TOOL(AR, ar)
|
|
if test "`uname -m`" = "alpha" ; then
|
|
CFLAGS="$CFLAGS -mieee"
|
|
fi
|
|
+ if test "`uname -m`" = "sw_64" ; then
|
|
+ CFLAGS="$CFLAGS -mieee"
|
|
+ fi
|
|
if test $do64bit = yes; then
|
|
AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
|
|
hold_cflags=$CFLAGS
|
|
@@ -1418,6 +1421,9 @@ dnl AC_CHECK_TOOL(AR, ar)
|
|
if test "`uname -m`" = "alpha" ; then
|
|
CFLAGS="$CFLAGS -mieee"
|
|
fi
|
|
+ if test "`uname -m`" = "sw_64" ; then
|
|
+ CFLAGS="$CFLAGS -mieee"
|
|
+ fi
|
|
;;
|
|
Lynx*)
|
|
SHLIB_CFLAGS="-fPIC"
|
|
diff --git a/configure b/configure
|
|
index aff62c464..1b7c11292 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -789,6 +789,7 @@ ac_subst_files='serialization_dependencies
|
|
host_makefile_frag
|
|
target_makefile_frag
|
|
alphaieee_frag
|
|
+sw_64ieee_frag
|
|
ospace_frag'
|
|
ac_user_opts='
|
|
enable_option_checking
|
|
@@ -4016,6 +4017,10 @@ case "${target}" in
|
|
use_gnu_ld=no
|
|
fi
|
|
;;
|
|
+ sw_64*-*-*)
|
|
+ # newlib is not 64 bit ready
|
|
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
|
|
+ ;;
|
|
tic6x-*-*)
|
|
noconfigdirs="$noconfigdirs sim"
|
|
;;
|
|
@@ -9584,6 +9589,15 @@ case $target in
|
|
;;
|
|
esac
|
|
|
|
+sw_64ieee_frag=/dev/null
|
|
+case $target in
|
|
+ sw_64*-*-*)
|
|
+ # This just makes sure to use the -mieee option to build target libs.
|
|
+ # This should probably be set individually by each library.
|
|
+ sw_64ieee_frag="config/mt-sw_64ieee"
|
|
+ ;;
|
|
+esac
|
|
+
|
|
# If --enable-target-optspace always use -Os instead of -O2 to build
|
|
# the target libraries, similarly if it is not specified, use -Os
|
|
# on selected platforms.
|
|
@@ -10299,7 +10313,7 @@ case "${target}" in
|
|
esac
|
|
|
|
# Makefile fragments.
|
|
-for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
|
|
+for frag in host_makefile_frag target_makefile_frag alphaieee_frag sw_64ieee_frag ospace_frag;
|
|
do
|
|
eval fragval=\$$frag
|
|
if test $fragval != /dev/null; then
|
|
diff --git a/configure.ac b/configure.ac
|
|
index f310d75ca..c4a65a49d 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -1271,6 +1271,10 @@ case "${target}" in
|
|
use_gnu_ld=no
|
|
fi
|
|
;;
|
|
+ sw_64*-*-*)
|
|
+ # newlib is not 64 bit ready
|
|
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
|
|
+ ;;
|
|
tic6x-*-*)
|
|
noconfigdirs="$noconfigdirs sim"
|
|
;;
|
|
@@ -1335,6 +1339,9 @@ case "${host}" in
|
|
rs6000-*-aix*)
|
|
host_makefile_frag="config/mh-ppc-aix"
|
|
;;
|
|
+ sw_64*-linux*)
|
|
+ host_makefile_frag="config/mh-sw_64-linux"
|
|
+ ;;
|
|
esac
|
|
fi
|
|
|
|
@@ -2765,6 +2772,15 @@ case $target in
|
|
;;
|
|
esac
|
|
|
|
+sw_64ieee_frag=/dev/null
|
|
+case $target in
|
|
+ sw_64*-*-*)
|
|
+ # This just makes sure to use the -mieee option to build target libs.
|
|
+ # This should probably be set individually by each library.
|
|
+ sw_64ieee_frag="config/mt-sw_64ieee"
|
|
+ ;;
|
|
+esac
|
|
+
|
|
# If --enable-target-optspace always use -Os instead of -O2 to build
|
|
# the target libraries, similarly if it is not specified, use -Os
|
|
# on selected platforms.
|
|
@@ -3475,7 +3491,7 @@ case "${target}" in
|
|
esac
|
|
|
|
# Makefile fragments.
|
|
-for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
|
|
+for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag sw_64ieee_frag;
|
|
do
|
|
eval fragval=\$$frag
|
|
if test $fragval != /dev/null; then
|
|
@@ -3486,6 +3502,7 @@ AC_SUBST_FILE(host_makefile_frag)
|
|
AC_SUBST_FILE(target_makefile_frag)
|
|
AC_SUBST_FILE(alphaieee_frag)
|
|
AC_SUBST_FILE(ospace_frag)
|
|
+AC_SUBST_FILE(sw_64ieee_frag)
|
|
|
|
# Miscellanea: directories, flags, etc.
|
|
AC_SUBST(RPATH_ENVVAR)
|
|
diff --git a/contrib/config-list.mk b/contrib/config-list.mk
|
|
index e04210556..730a49e64 100644
|
|
--- a/contrib/config-list.mk
|
|
+++ b/contrib/config-list.mk
|
|
@@ -96,6 +96,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
|
|
sparc64-sun-solaris2.11OPT-with-gnu-ldOPT-with-gnu-asOPT-enable-threads=posix \
|
|
sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux sparc64-freebsd6 \
|
|
sparc64-netbsd sparc64-openbsd \
|
|
+ sw_64-linux-gnu sw_64-netbsd sw_64-openbsd \
|
|
tilegx-linux-gnuOPT-enable-obsolete tilegxbe-linux-gnuOPT-enable-obsolete \
|
|
tilepro-linux-gnuOPT-enable-obsolete \
|
|
v850e1-elf v850e-elf v850-elf v850-rtems vax-linux-gnu \
|
|
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
|
index 23c5bee2b..d55645381 100644
|
|
--- a/gcc/config.gcc
|
|
+++ b/gcc/config.gcc
|
|
@@ -547,6 +547,10 @@ sh[123456789lbe]*-*-* | sh-*-*)
|
|
extra_options="${extra_options} fused-madd.opt"
|
|
extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
|
|
;;
|
|
+sw_64*-*-*)
|
|
+ cpu_type=sw_64
|
|
+ extra_options="${extra_options} g.opt"
|
|
+ ;;
|
|
v850*-*-*)
|
|
cpu_type=v850
|
|
;;
|
|
@@ -3471,6 +3475,11 @@ sparc64-*-openbsd*)
|
|
with_cpu=ultrasparc
|
|
tmake_file="${tmake_file} sparc/t-sparc"
|
|
;;
|
|
+sw_64*-*-linux*)
|
|
+ tm_file="elfos.h ${tm_file} sw_64/gnu-user.h sw_64/elf.h sw_64/linux.h sw_64/linux-elf.h glibc-stdint.h"
|
|
+ tmake_file="${tmake_file} sw_64/t-linux sw_64/t-sw_64"
|
|
+ extra_options="${extra_options} sw_64/elf.opt"
|
|
+ ;;
|
|
tic6x-*-elf)
|
|
tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
|
|
tm_file="${tm_file} tm-dwarf2.h newlib-stdint.h"
|
|
@@ -3999,6 +4008,15 @@ if test x$with_cpu = x ; then
|
|
;;
|
|
esac
|
|
;;
|
|
+ sw_64sw6a*-*-*)
|
|
+ with_cpu=sw6a
|
|
+ ;;
|
|
+ sw_64sw6b*-*-*)
|
|
+ with_cpu=sw6b
|
|
+ ;;
|
|
+ sw_64sw8a*-*-*)
|
|
+ with_cpu=sw8a
|
|
+ ;;
|
|
visium-*-*)
|
|
with_cpu=gr5
|
|
;;
|
|
@@ -5571,6 +5589,23 @@ case "${target}" in
|
|
esac
|
|
;;
|
|
|
|
+ sw_64*-*-*)
|
|
+ supported_defaults="cpu tune"
|
|
+ for which in cpu tune; do
|
|
+ eval "val=\$with_$which"
|
|
+ case "$val" in
|
|
+ "" \
|
|
+ | sw6 | sw6a | sw6b | sw8a \
|
|
+ | sw6c)
|
|
+ ;;
|
|
+ *)
|
|
+ echo "Unknown CPU used in --with-$which=$val" 1>&2
|
|
+ exit 1
|
|
+ ;;
|
|
+ esac
|
|
+ done
|
|
+ ;;
|
|
+
|
|
tic6x-*-*)
|
|
supported_defaults="arch"
|
|
|
|
diff --git a/gcc/config.host b/gcc/config.host
|
|
index bf7dcb4cc..081ce29c2 100644
|
|
--- a/gcc/config.host
|
|
+++ b/gcc/config.host
|
|
@@ -198,6 +198,14 @@ case ${host} in
|
|
;;
|
|
esac
|
|
;;
|
|
+ sw_64*-*-linux*)
|
|
+ case ${target} in
|
|
+ sw_64*-*-linux*)
|
|
+ host_extra_gcc_objs="driver-sw_64.o"
|
|
+ host_xmake_file="${host_xmake_file} sw_64/x-sw_64"
|
|
+ ;;
|
|
+ esac
|
|
+ ;;
|
|
esac
|
|
|
|
# Machine-specific settings.
|
|
diff --git a/gcc/config.in b/gcc/config.in
|
|
index 91328572b..caf0d6492 100644
|
|
--- a/gcc/config.in
|
|
+++ b/gcc/config.in
|
|
@@ -205,6 +205,11 @@
|
|
#undef ENABLE_LD_BUILDID
|
|
#endif
|
|
|
|
+/* Define if gcc should always pass --no-relax to linker for sw_64. */
|
|
+#ifndef USED_FOR_TARGET
|
|
+#undef ENABLE_LD_NORELAX
|
|
+#endif
|
|
+
|
|
|
|
/* Define to 1 to enable libquadmath support */
|
|
#ifndef USED_FOR_TARGET
|
|
@@ -422,6 +427,10 @@
|
|
#undef HAVE_AS_EXPLICIT_RELOCS
|
|
#endif
|
|
|
|
+/* Define if your assembler supports explicit relocations. */
|
|
+#ifndef USED_FOR_TARGET
|
|
+#undef SW_64_ENABLE_ASAN
|
|
+#endif
|
|
|
|
/* Define if your assembler supports FMAF, HPC, and VIS 3.0 instructions. */
|
|
#ifndef USED_FOR_TARGET
|
|
@@ -2726,3 +2735,11 @@
|
|
#undef vfork
|
|
#endif
|
|
|
|
+/* Define only sw64 target */
|
|
+#undef FLAG_SW64_ATOMIC
|
|
+#undef FLAG_SW64_90139
|
|
+#undef FLAG_SW64_PREFETCH
|
|
+#undef FLAG_SW64_PROTECT
|
|
+#undef FLAG_SW64_INC_DEC
|
|
+#undef FLAG_SW64_DELNOP
|
|
+#undef FLAG_SW64_FM
|
|
diff --git a/gcc/config/host-linux.cc b/gcc/config/host-linux.cc
|
|
index 817d3c087..a65468272 100644
|
|
--- a/gcc/config/host-linux.cc
|
|
+++ b/gcc/config/host-linux.cc
|
|
@@ -100,6 +100,8 @@
|
|
# define TRY_EMPTY_VM_SPACE 0x1000000000
|
|
#elif defined(__loongarch__) && defined(__LP64__)
|
|
# define TRY_EMPTY_VM_SPACE 0x8000000000
|
|
+#elif defined(__sw_64)
|
|
+#define TRY_EMPTY_VM_SPACE 0x10000000000
|
|
#else
|
|
# define TRY_EMPTY_VM_SPACE 0
|
|
#endif
|
|
diff --git a/gcc/configure b/gcc/configure
|
|
index ef0449edd..4a70b7c66 100755
|
|
--- a/gcc/configure
|
|
+++ b/gcc/configure
|
|
@@ -25775,6 +25775,29 @@ foo: .long 25
|
|
xor %l1, %tle_lox10(foo), %o5
|
|
ld [%g7 + %o5], %o1"
|
|
;;
|
|
+ sw_64*-*-*)
|
|
+ conftest_s='
|
|
+ .section ".tdata","awT",@progbits
|
|
+foo: .long 25
|
|
+ .text
|
|
+ ldl $27,__tls_get_addr($29) !literal!1
|
|
+ ldi $16,foo($29) !tlsgd!1
|
|
+ call $26,($27),__tls_get_addr !lituse_tlsgd!1
|
|
+ ldl $27,__tls_get_addr($29) !literal!2
|
|
+ ldi $16,foo($29) !tlsldm!2
|
|
+ call $26,($27),__tls_get_addr !lituse_tlsldm!2
|
|
+ ldl $1,foo($29) !gotdtprel
|
|
+ ldih $2,foo($29) !dtprelhi
|
|
+ ldi $3,foo($2) !dtprello
|
|
+ ldi $4,foo($29) !dtprel
|
|
+ ldl $1,foo($29) !gottprel
|
|
+ ldih $2,foo($29) !tprelhi
|
|
+ ldi $3,foo($2) !tprello
|
|
+ ldi $4,foo($29) !tprel'
|
|
+ tls_first_major=2
|
|
+ tls_first_minor=13
|
|
+ tls_as_opt=--fatal-warnings
|
|
+ ;;
|
|
tilepro*-*-*)
|
|
conftest_s='
|
|
.section ".tdata","awT",@progbits
|
|
@@ -26313,6 +26336,101 @@ fi
|
|
|
|
;;
|
|
|
|
+ sw_64*-*-linux* | sw_64*-*-*bsd*)
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for explicit relocation support" >&5
|
|
+$as_echo_n "checking assembler for explicit relocation support... " >&6; }
|
|
+if ${gcc_cv_as_sw_64_explicit_relocs+:} false; then :
|
|
+ $as_echo_n "(cached) " >&6
|
|
+else
|
|
+ gcc_cv_as_sw_64_explicit_relocs=no
|
|
+ if test x$gcc_cv_as != x; then
|
|
+ $as_echo ' .set nomacro
|
|
+ .text
|
|
+ ext0b $3, $2, $3 !lituse_bytoff!1
|
|
+ ldl $2, a($29) !literal!1
|
|
+ ldl $4, b($29) !literal!2
|
|
+ ldl_u $3, 0($2) !lituse_base!1
|
|
+ ldl $27, f($29) !literal!5
|
|
+ call $26, ($27), f !lituse_jsr!5
|
|
+ ldih $29, 0($26) !gpdisp!3
|
|
+ ldi $0, c($29) !gprel
|
|
+ ldih $1, d($29) !gprelhigh
|
|
+ ldi $1, d($1) !gprellow
|
|
+ ldi $29, 0($29) !gpdisp!3' > conftest.s
|
|
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
|
|
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
|
|
+ (eval $ac_try) 2>&5
|
|
+ ac_status=$?
|
|
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
+ test $ac_status = 0; }; }
|
|
+ then
|
|
+ gcc_cv_as_sw_64_explicit_relocs=yes
|
|
+ else
|
|
+ echo "configure: failed program was" >&5
|
|
+ cat conftest.s >&5
|
|
+ fi
|
|
+ rm -f conftest.o conftest.s
|
|
+ fi
|
|
+fi
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sw_64_explicit_relocs" >&5
|
|
+$as_echo "$gcc_cv_as_sw_64_explicit_relocs" >&6; }
|
|
+if test $gcc_cv_as_sw_64_explicit_relocs = yes; then
|
|
+
|
|
+$as_echo "#define HAVE_AS_EXPLICIT_RELOCS 1" >>confdefs.h
|
|
+
|
|
+fi
|
|
+
|
|
+
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for jsrdirect relocation support" >&5
|
|
+$as_echo_n "checking assembler for jsrdirect relocation support... " >&6; }
|
|
+if ${gcc_cv_as_sw_64_jsrdirect_relocs+:} false; then :
|
|
+ $as_echo_n "(cached) " >&6
|
|
+else
|
|
+ gcc_cv_as_sw_64_jsrdirect_relocs=no
|
|
+ if test $in_tree_gas = yes; then
|
|
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 90`
|
|
+ then gcc_cv_as_sw_64_jsrdirect_relocs=yes
|
|
+fi
|
|
+#trouble#
|
|
+ elif test x$gcc_cv_as != x; then
|
|
+ $as_echo ' .set nomacro
|
|
+ .text
|
|
+ ldl $27, a($29) !literal!1
|
|
+ call $26, ($27), a !lituse_jsrdirect!1' > conftest.s
|
|
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
|
|
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
|
|
+ (eval $ac_try) 2>&5
|
|
+ ac_status=$?
|
|
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
+ test $ac_status = 0; }; }
|
|
+ then
|
|
+ gcc_cv_as_sw_64_jsrdirect_relocs=yes
|
|
+ else
|
|
+ echo "configure: failed program was" >&5
|
|
+ cat conftest.s >&5
|
|
+ fi
|
|
+ rm -f conftest.o conftest.s
|
|
+ fi
|
|
+fi
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sw_64_jsrdirect_relocs" >&5
|
|
+$as_echo "$gcc_cv_as_sw_64_jsrdirect_relocs" >&6; }
|
|
+if test $gcc_cv_as_sw_64_jsrdirect_relocs = yes; then
|
|
+
|
|
+$as_echo "#define HAVE_AS_JSRDIRECT_RELOCS 1" >>confdefs.h
|
|
+
|
|
+fi
|
|
+cat >> confdefs.h <<_ACEOF
|
|
+#define FLAG_SW64_ATOMIC 1
|
|
+#define FLAG_SW64_90139 1
|
|
+#define FLAG_SW64_PREFETCH 1
|
|
+#define FLAG_SW64_PROTECT 1
|
|
+#define FLAG_SW64_INC_DEC 1
|
|
+#define FLAG_SW64_DELNOP 1
|
|
+#define FLAG_SW64_FM 1
|
|
+_ACEOF
|
|
+
|
|
+ ;;
|
|
+
|
|
avr-*-*)
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --mlink-relax option" >&5
|
|
$as_echo_n "checking assembler for --mlink-relax option... " >&6; }
|
|
@@ -29377,7 +29495,7 @@ esac
|
|
case "$cpu_type" in
|
|
aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
|
|
| m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
|
|
- | tilegx | tilepro | visium | xstormy16 | xtensa)
|
|
+ | sw_64 | tilegx | tilepro | visium | xstormy16 | xtensa)
|
|
insn="nop"
|
|
;;
|
|
ia64 | s390)
|
|
@@ -31151,6 +31269,17 @@ $as_echo "$as_me: WARNING: --build-id is not supported by your linker; --enable-
|
|
fi
|
|
fi
|
|
|
|
+# sw_64 add --enable-linker-no-relax to support linker -Wl,-no-relax
|
|
+# Check whether --enable-linker-no-relax was given.
|
|
+if test "${enable_linker_no_relax+set}" = set; then :
|
|
+ enableval=$enable_linker_no_relax;
|
|
+else
|
|
+ enable_linker_no_relax=no
|
|
+fi
|
|
+
|
|
+if test x"$enable_linker_no_relax" = xyes; then
|
|
+ $as_echo "#define ENABLE_LD_NORELAX 1" >>confdefs.h
|
|
+fi
|
|
# In binutils 2.21, GNU ld gained support for new emulations fully
|
|
# supporting the Solaris 2 ABI. Detect their presence in the linker used.
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker *_sol2 emulation support" >&5
|
|
diff --git a/gcc/configure.ac b/gcc/configure.ac
|
|
index 708ec3fd3..9683ab156 100644
|
|
--- a/gcc/configure.ac
|
|
+++ b/gcc/configure.ac
|
|
@@ -23,6 +23,7 @@
|
|
# Initialization and sanity checks
|
|
# --------------------------------
|
|
|
|
+AC_PREREQ(2.64)
|
|
AC_INIT
|
|
AC_CONFIG_SRCDIR(tree.cc)
|
|
AC_CONFIG_HEADER(auto-host.h:config.in)
|
|
@@ -4076,6 +4077,29 @@ foo: .long 25
|
|
xor %l1, %tle_lox10(foo), %o5
|
|
ld [%g7 + %o5], %o1"
|
|
;;
|
|
+ sw_64*-*-*)
|
|
+ conftest_s='
|
|
+ .section ".tdata","awT",@progbits
|
|
+foo: .long 25
|
|
+ .text
|
|
+ ldl $27,__tls_get_addr($29) !literal!1
|
|
+ ldi $16,foo($29) !tlsgd!1
|
|
+ call $26,($27),__tls_get_addr !lituse_tlsgd!1
|
|
+ ldl $27,__tls_get_addr($29) !literal!2
|
|
+ ldi $16,foo($29) !tlsldm!2
|
|
+ call $26,($27),__tls_get_addr !lituse_tlsldm!2
|
|
+ ldl $1,foo($29) !gotdtprel
|
|
+ ldih $2,foo($29) !dtprelhi
|
|
+ ldi $3,foo($2) !dtprello
|
|
+ ldi $4,foo($29) !dtprel
|
|
+ ldl $1,foo($29) !gottprel
|
|
+ ldih $2,foo($29) !tprelhi
|
|
+ ldi $3,foo($2) !tprello
|
|
+ ldi $4,foo($29) !tprel'
|
|
+ tls_first_major=2
|
|
+ tls_first_minor=13
|
|
+ tls_as_opt=--fatal-warnings
|
|
+ ;;
|
|
tilepro*-*-*)
|
|
conftest_s='
|
|
.section ".tdata","awT",@progbits
|
|
@@ -4677,6 +4701,36 @@ foo:
|
|
[Define if your assembler supports LEON instructions.])])
|
|
;;
|
|
|
|
+ sw_64*-*-linux* | sw_64*-*-*bsd*)
|
|
+ gcc_GAS_CHECK_FEATURE([explicit relocation support],
|
|
+ gcc_cv_as_sw_64_explicit_relocs, [2,12,0],,
|
|
+[ .set nomacro
|
|
+ .text
|
|
+ ext0b $3, $2, $3 !lituse_bytoff!1
|
|
+ ldl $2, a($29) !literal!1
|
|
+ ldl $4, b($29) !literal!2
|
|
+ ldl_u $3, 0($2) !lituse_base!1
|
|
+ ldl $27, f($29) !literal!5
|
|
+ call $26, ($27), f !lituse_jsr!5
|
|
+ ldih $29, 0($26) !gpdisp!3
|
|
+ ldi $0, c($29) !gprel
|
|
+ ldih $1, d($29) !gprelhigh
|
|
+ ldi $1, d($1) !gprellow
|
|
+ ldi $29, 0($29) !gpdisp!3],,
|
|
+ [AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
|
|
+ [Define if your assembler supports explicit relocations.])])
|
|
+ gcc_GAS_CHECK_FEATURE([jsrdirect relocation support],
|
|
+ gcc_cv_as_sw_64_jsrdirect_relocs,,
|
|
+[ .set nomacro
|
|
+ .text
|
|
+ ldl $27, a($29) !literal!1
|
|
+ call $26, ($27), a !lituse_jsrdirect!1],,
|
|
+ [AC_DEFINE(HAVE_AS_JSRDIRECT_RELOCS, 1,
|
|
+ [Define if your assembler supports the lituse_jsrdirect relocation.])])
|
|
+# [AC_DEFINE(SW_64_ENABLE_ASAN, 1,
|
|
+# [Define if your target fully enable asan supports.])])
|
|
+ ;;
|
|
+
|
|
changequote(,)dnl
|
|
i[34567]86-*-* | x86_64-*-*)
|
|
changequote([,])dnl
|
|
@@ -5505,7 +5559,7 @@ esac
|
|
# version to the per-target configury.
|
|
case "$cpu_type" in
|
|
aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
|
|
- | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
|
|
+ | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc | sw_64 \
|
|
| tilegx | tilepro | visium | xstormy16 | xtensa)
|
|
insn="nop"
|
|
;;
|
|
@@ -6758,6 +6812,31 @@ if test x"$enable_linker_build_id" = xyes; then
|
|
fi
|
|
fi
|
|
|
|
+# --no-relax
|
|
+AC_ARG_ENABLE(linker-no-relax,
|
|
+[AS_HELP_STRING([--enable-linker-no-relax],
|
|
+ [compiler will always pass --no-relax to linker])],
|
|
+[],
|
|
+enable_linker_no_relax=no)
|
|
+
|
|
+if test x"$enable_linker_build_id" = xyes; then
|
|
+ if test x"$gcc_cv_ld_buildid" = xyes; then
|
|
+ AC_DEFINE(ENABLE_LD_BUILDID, 1,
|
|
+ [Define if gcc should always pass --build-id to linker.])
|
|
+ else
|
|
+ AC_MSG_WARN(--build-id is not supported by your linker; --enable-linker-build-id ignored)
|
|
+ fi
|
|
+fi
|
|
+
|
|
+# --no-relax
|
|
+if test x"$enable_linker_no_relax" = xyes; then
|
|
+ AC_DEFINE(ENABLE_LD_NORELAX, 1,
|
|
+ [Define if gcc should always pass --no-relax to linker.])
|
|
+ else
|
|
+ AC_MSG_WARN(--no-relax is not supported by your linker; --enable-linker-no-relax ignored)
|
|
+ fi
|
|
+fi
|
|
+
|
|
# In binutils 2.21, GNU ld gained support for new emulations fully
|
|
# supporting the Solaris 2 ABI. Detect their presence in the linker used.
|
|
AC_CACHE_CHECK(linker *_sol2 emulation support,
|
|
@@ -6930,7 +7009,8 @@ case "$target" in
|
|
powerpc*-*-linux* | \
|
|
sparc*-*-linux* | \
|
|
s390*-*-linux* | \
|
|
- alpha*-*-linux*)
|
|
+ alpha*-*-linux*) | \
|
|
+ sw_64*-*-linux*)
|
|
AC_ARG_WITH(long-double-128,
|
|
[AS_HELP_STRING([--with-long-double-128],
|
|
[use 128-bit long double by default])],
|
|
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
|
|
index a650f60c7..40dc7ae75 100644
|
|
--- a/gcc/doc/install.texi
|
|
+++ b/gcc/doc/install.texi
|
|
@@ -5005,6 +5005,15 @@ on a Solaris 11 system:
|
|
@heading sparcv9-*-solaris2*
|
|
This is a synonym for @samp{sparc64-*-solaris2*}.
|
|
|
|
+@html
|
|
+<hr />
|
|
+@end html
|
|
+@anchor{sw_64-x-x}
|
|
+@heading sw_64*-*-*
|
|
+This section contains general configuration information for all
|
|
+SW64-based platforms using ELF@. In addition to reading this
|
|
+section, please read all other sections that match your target.
|
|
+
|
|
@html
|
|
<hr />
|
|
@end html
|
|
--
|
|
2.25.1
|
|
|