public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: force PIC/PIE off for pr58245-1.C
@ 2023-11-08 15:57 Alexandre Oliva
  2023-11-08 21:26 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Oliva @ 2023-11-08 15:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth, Mike Stump


This test expects a single mention of stack_chk_fail, as part of a
call sequence, but when e.g. PIE is enabled by default, we output
.hidden stack_chk_fail_local, which makes for a count mismatch.

Disable PIC/PIE so as to not depend on the configurable default.

Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on i686- and
x86_64-.  Ok to install?


for  gcc/testsuite/ChangeLog

	* g++.dg/pr58245-1.C: Disable PIC/PIE.
---
 gcc/testsuite/g++.dg/pr58245-1.C |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/testsuite/g++.dg/pr58245-1.C b/gcc/testsuite/g++.dg/pr58245-1.C
index 1439bc62e710e..71d4736ddf610 100644
--- a/gcc/testsuite/g++.dg/pr58245-1.C
+++ b/gcc/testsuite/g++.dg/pr58245-1.C
@@ -8,3 +8,7 @@ bar (void)
 }
 
 /* { dg-final { scan-assembler-times "stack_chk_fail" 1 } } */
+
+/* When compiling for PI[EC], we issue a .hidden stack_chk_fail_local,
+   that causes the above to fail the expected match count.  */
+/* { dg-additional-options "-fno-PIC" } */

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: force PIC/PIE off for pr58245-1.C
  2023-11-08 15:57 [PATCH] testsuite: force PIC/PIE off for pr58245-1.C Alexandre Oliva
@ 2023-11-08 21:26 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-11-08 21:26 UTC (permalink / raw)
  To: Alexandre Oliva, gcc-patches; +Cc: Rainer Orth, Mike Stump



On 11/8/23 08:57, Alexandre Oliva wrote:
> 
> This test expects a single mention of stack_chk_fail, as part of a
> call sequence, but when e.g. PIE is enabled by default, we output
> .hidden stack_chk_fail_local, which makes for a count mismatch.
> 
> Disable PIC/PIE so as to not depend on the configurable default.
> 
> Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on i686- and
> x86_64-.  Ok to install?
> 
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* g++.dg/pr58245-1.C: Disable PIC/PIE.
OK
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-08 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08 15:57 [PATCH] testsuite: force PIC/PIE off for pr58245-1.C Alexandre Oliva
2023-11-08 21:26 ` Jeff Law

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).