diff mbox series

libgomp: Compile tests with -march=i486 if needed

Message ID 20210606130316.4596-1-hjl.tools@gmail.com
State New
Headers show
Series libgomp: Compile tests with -march=i486 if needed | expand

Commit Message

H.J. Lu June 6, 2021, 1:03 p.m. UTC
Don't add -march=i486 if atomic compare-and-swap is supported on 'int'.
This fixes libgomp tests with "-march=x86-64 -m32 -fcf-protection".

	* testsuite/lib/libgomp.exp (libgomp_init): Don't add -march=i486
	if atomic compare-and-swap is supported on 'int'.
---
 libgomp/testsuite/lib/libgomp.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jeff Law June 9, 2021, 3:36 p.m. UTC | #1
On 6/6/2021 7:03 AM, H.J. Lu via Gcc-patches wrote:
> Don't add -march=i486 if atomic compare-and-swap is supported on 'int'.
> This fixes libgomp tests with "-march=x86-64 -m32 -fcf-protection".
>
> 	* testsuite/lib/libgomp.exp (libgomp_init): Don't add -march=i486
> 	if atomic compare-and-swap is supported on 'int'.
OK
jeff
diff mbox series

Patch

diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 0f4eb6fd4ff..fc5015de42f 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -210,7 +210,8 @@  proc libgomp_init { args } {
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
-	 && [check_effective_target_ia32] } {
+	 && [check_effective_target_ia32]
+	 && ![check_effective_target_cas_char] } {
 	lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
     }