From: YunQiang Su <yunqiang.su@cipunited.com>
To: jiaxun.yang@flygoat.com, macro@orcam.me.uk
Cc: binutils@sourceware.org, syq@debian.org,
YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH 1/3] MIPS: Fix test failure with FPXX GCC
Date: Mon, 8 Mar 2021 04:30:14 +0000 [thread overview]
Message-ID: <20210308043016.11511-1-yunqiang.su@cipunited.com> (raw)
GCC can be configured as FPXX default, which requires MIPS II.
This make `as' (default to MIPS I) fails to run some test.
To fix this, we pass -mfp32 option to GCC.
ChangeLog:
2021-03-08 YunQiang Su <yunqiang.su@cipunited.com>
* ld/testsuite/ld-elf/elf.exp: Set "-mfp32" CFLAGS for mips32
* ld/testsuite/ld-elf/shared.exp: Likewise
* ld/testsuite/ld-elf/tls.exp: Likewise
* ld/testsuite/ld-elfvers/vers.exp: Likewise
---
ld/testsuite/ld-elf/elf.exp | 8 ++++++++
ld/testsuite/ld-elf/shared.exp | 5 +++++
ld/testsuite/ld-elf/tls.exp | 12 ++++++++++++
ld/testsuite/ld-elfvers/vers.exp | 7 +++++++
4 files changed, 32 insertions(+)
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index e98bffc0c5..37d49faa3c 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -421,6 +421,13 @@ run_cc_link_tests [list \
] \
]
+set old_cflags $CFLAGS
+if { [istarget "mips-*-*"]
+ || [istarget "mipsel-*-*"] } {
+ # the default target of as is MIPS I, which has no ldc1/sdc1
+ # the gcc may be set as fpxx/fp64 default, which require mips2+
+ append CFLAGS " -mfp32"
+}
run_ld_link_tests [list \
[list \
"Build pr26391-5.o" \
@@ -446,6 +453,7 @@ run_ld_link_tests [list \
"-ffunction-sections" \
] \
]
+set CFLAGS $old_cflags
run_ld_link_exec_tests [list \
[list \
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 6bf49785a5..ef67e3b8e2 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -941,6 +941,10 @@ run_cc_link_tests [list \
] \
]
+set old_CFLAGS $CFLAGS
+if { [istarget "mips-*-*"] || [istarget "mipsel-*-*"] } {
+ append CFLAGS " -mfp32"
+}
run_ld_link_tests [list \
[list \
"pr22269-1 (static pie undefined weak)" \
@@ -953,6 +957,7 @@ run_ld_link_tests [list \
"-fPIE -O2 $NOSANITIZE_CFLAGS" \
] \
]
+set CFLAGS $old_CFLAGS
set run_tests [list \
[list "Run normal with libfoo.so" \
diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp
index 1351a274cc..dfa3f50ecb 100644
--- a/ld/testsuite/ld-elf/tls.exp
+++ b/ld/testsuite/ld-elf/tls.exp
@@ -39,6 +39,15 @@ if [istarget "sparc*-*-*"] {
append AFLAGS_PIC " -K PIC -Av9"
}
+set old_CFLAGS $CFLAGS
+set old_ASFLAGS $ASFLAGS
+if [istarget "mips*-*"] {
+ # FIXME: gcc's bug, it always generate `rdhwr'
+ # even for target that has no such instrcution
+ append CFLAGS " -mfp32 -mips32r2 -mabi=32"
+ append ASFLAGS " -mips32r2"
+}
+
run_ld_link_tests [list \
[list \
"Build pr22263-1" \
@@ -51,3 +60,6 @@ run_ld_link_tests [list \
"-fPIE -O2 $NOSANITIZE_CFLAGS" \
] \
]
+
+set CFLAGS $old_CFLAGS
+set ASFLAGS $old_ASFLAGS
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 8a1383fe84..63127a46d2 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -777,6 +777,11 @@ if { [istarget x86_64-*-linux*] \
set pic "no"
}
+set old_CFLAGS $CFLAGS
+if { [istarget "mips-*-*"] || [istarget "mipsel-*-*"] } {
+ append CFLAGS " -mfp32"
+}
+
#
# Basic test - build a library with versioned symbols.
#
@@ -1006,3 +1011,5 @@ build_vers_lib_pic "vers31" vers31.c vers31 "" vers31.map vers31.ver vers31.dsym
# Test #32 -- linker --defsym
build_vers_lib_pic "vers32a" vers32a.c vers32a "" vers32.map vers32a.ver vers32a.dsym ""
build_vers_lib_pic_flags "vers32b" vers32b.c vers32b "vers32a.so" vers32.map vers32b.ver vers32b.dsym "" "--defsym foo=0"
+
+set CFLAGS $old_CFLAGS
--
2.20.1
next reply other threads:[~2021-03-08 4:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 4:30 YunQiang Su [this message]
2021-03-08 4:30 ` [PATCH 2/3] MIPS: default output r6 object if configured to r6 YunQiang Su
2023-02-23 11:11 ` [PATCH] MIPS: support specify isa level when configure YunQiang Su
2023-03-30 16:53 ` Richard Sandiford
2023-04-03 11:06 ` [PATCH v2] MIPS: the default output fellows triple and with-arch YunQiang Su
2023-04-03 12:40 ` Richard Sandiford
2023-04-10 7:01 ` YunQiang Su
2023-04-14 7:20 ` [PATCH v3] MIPS: the default output fellows triple YunQiang Su
2023-04-18 13:07 ` Richard Sandiford
2023-04-18 14:00 ` [PATCH v4 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI YunQiang Su
2023-04-18 14:00 ` [PATCH v4 2/2] MIPS: default output r6 obj if the triple is r6 YunQiang Su
2023-04-19 19:03 ` Richard Sandiford
2023-04-20 13:31 ` [PATCH v5 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI YunQiang Su
2023-04-20 13:31 ` [PATCH v5 2/2] MIPS: default output r6 obj if the triple is r6 YunQiang Su
2023-04-19 19:00 ` [PATCH v4 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI Richard Sandiford
2023-07-21 10:00 ` Maciej W. Rozycki
2023-07-21 10:14 ` YunQiang Su
2023-07-21 11:54 ` Maciej W. Rozycki
2023-07-21 12:30 ` YunQiang Su
2023-07-21 14:30 ` Maciej W. Rozycki
2023-07-21 15:01 ` YunQiang Su
2023-07-22 7:18 ` Xi Ruoyao
2023-07-25 13:30 ` Nick Clifton
2023-07-25 14:00 ` YunQiang Su
2023-07-25 16:03 ` Maciej W. Rozycki
2023-07-31 10:05 ` Maciej W. Rozycki
2023-07-31 10:32 ` YunQiang Su
2023-08-01 22:52 ` Maciej W. Rozycki
2023-07-25 17:47 ` Andreas K. Huettel
2023-07-28 5:42 ` YunQiang Su
2023-07-25 17:41 ` Andreas K. Huettel
2021-03-08 4:30 ` [PATCH 3/3] MIPS: Fix testcase for MIPSr6 YunQiang Su
2021-03-19 5:47 ` 回复: [PATCH 1/3] MIPS: Fix test failure with FPXX GCC yunqiang.su
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210308043016.11511-1-yunqiang.su@cipunited.com \
--to=yunqiang.su@cipunited.com \
--cc=binutils@sourceware.org \
--cc=jiaxun.yang@flygoat.com \
--cc=macro@orcam.me.uk \
--cc=syq@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).