1 Star 0 Fork 33

renping000/gcc

forked from src-anolis-os/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-LoongArch-Fixup-configure-file-error.patch 4.59 KB
一键复制 编辑 原始数据 按行查看 历史
From 77dd77cc1400180914b26c19704dbe990cb36878 Mon Sep 17 00:00:00 2001
From: Xing Li <lixing@loongson.cn>
Date: Mon, 31 Oct 2022 20:12:09 +0800
Subject: [PATCH] LoongArch: Fixup configure file error
configure error lead to the default macros not correct during compile
initialize, such as dwarf2out_as_loc_support and dwarf2out_as_locview_support
Signed-off-by: Xing Li <lixing@loongson.cn>
---
gcc/configure | 67 +++++++++++++++++++++++++++++++++++++++++++++---
libgcc/configure | 5 +++-
2 files changed, 67 insertions(+), 5 deletions(-)
diff --git a/gcc/configure b/gcc/configure
index 56566e3f1..f0b5dbc00 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -5075,6 +5075,9 @@ case "${target}" in
# sets the default TLS model and affects inlining.
PICFLAG_FOR_TARGET=-fPIC
;;
+ loongarch*-*-*)
+ PICFLAG_FOR_TARGET=-fpic
+ ;;
mips-sgi-irix6*)
# PIC is the default.
;;
@@ -7525,6 +7528,9 @@ else
enable_fixed_point=yes
;;
+ loongarch*-*-*)
+ enable_fixed_point=yes
+ ;;
mips*-*-*)
enable_fixed_point=yes
;;
@@ -24085,6 +24091,18 @@ x:
tls_first_minor=16
tls_as_opt='-32 --fatal-warnings'
;;
+ loongarch*-*-*)
+ conftest_s='
+ .section .tdata,"awT",@progbits
+x: .word 2
+ .text
+ la.tls.gd $a0,x
+ bl __tls_get_addr'
+ tls_first_major=0
+ tls_first_minor=0
+ tls_as_opt='--fatal-warnings'
+ ;;
+
m68k-*-*)
conftest_s='
.section .tdata,"awT",@progbits
@@ -27644,6 +27662,47 @@ fi
as_fn_error "Requesting --with-nan= requires assembler support for -mnan=" "$LINENO" 5
fi
;;
+ loongarch*-*-*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .dtprelword support" >&5
+$as_echo_n "checking assembler for .dtprelword support... " >&6; }
+if test "${gcc_cv_as_loongarch_dtprelword+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_loongarch_dtprelword=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
+ then gcc_cv_as_loongarch_dtprelword=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo '.section .tdata,"awT",@progbits
+x:
+ .word 2
+ .text
+ .dtprelword x+0x8000' > 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_loongarch_dtprelword=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_loongarch_dtprelword" >&5
+$as_echo "$gcc_cv_as_loongarch_dtprelword" >&6; }
+if test $gcc_cv_as_loongarch_dtprelword = yes; then
+
+$as_echo "#define HAVE_AS_DTPRELWORD 1" >>confdefs.h
+
+fi
+
+ ;;
s390*-*-*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5
$as_echo_n "checking assembler for .gnu_attribute support... " >&6; }
@@ -27827,7 +27886,7 @@ esac
# Linux on IA64 might be able to use the Intel assembler.
case "$target" in
- mips*-*-* | *-*-hpux* )
+ mips*-*-* | loongarch*-*-* | *-*-hpux* )
if test x$gas_flag = xyes \
|| test x"$host" != x"$build" \
|| test ! -x "$gcc_cv_as" \
@@ -27847,9 +27906,9 @@ esac
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$cpu_type" in
- aarch64 | alpha | arc | arm | avr | bfin | cris | i386 | m32c | m68k \
- | microblaze | mips | nios2 | pa | riscv | rs6000 | score | sparc | spu \
- | tilegx | tilepro | visium | xstormy16 | xtensa)
+ aarch64 | alpha | arc | arm | avr | bfin | cris | i386 | loongarch | m32c \
+ | m68k | microblaze | mips | nios2 | pa | riscv | rs6000 | score | sparc \
+ | spu | tilegx | tilepro | visium | xstormy16 | xtensa)
insn="nop"
;;
ia64 | s390)
diff --git a/libgcc/configure b/libgcc/configure
index aac5e5fb6..170b470dd 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -2362,6 +2362,9 @@ case "${host}" in
# sets the default TLS model and affects inlining.
PICFLAG=-fPIC
;;
+ loongarch*-*-*)
+ PICFLAG=-fpic
+ ;;
mips-sgi-irix6*)
# PIC is the default.
;;
@@ -4938,7 +4941,7 @@ $as_echo "$libgcc_cv_cfi" >&6; }
# word size rather than the address size.
cat > conftest.c <<EOF
#if defined(__x86_64__) || (!defined(__i386__) && defined(__LP64__)) \
- || defined(__mips64)
+ || defined(__mips64) || defined(__loongarch64)
host_address=64
#else
host_address=32
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/renping000/gcc.git
git@gitee.com:renping000/gcc.git
renping000
gcc
gcc
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385