From: John David Anglin Date: Thu, 18 Jan 2024 22:46:19 +0000 (+0000) Subject: hppa: Always enable PIE on 64-bit target X-Git-Tag: basepoints/gcc-15~1879 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c7c65c4c359f8bfa1ebcb7b1c409af314064da2;p=thirdparty%2Fgcc.git hppa: Always enable PIE on 64-bit target 2024-01-18 John David Anglin gcc/ChangeLog: PR tree-optimization/69807 * config/pa/pa.cc (pa_option_override): Set flag_pie on TARGET_64BIT. gcc/testsuite/ChangeLog: * gcc.dg/pic-2.c: Skip on hppa*64*-*-*. --- diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 48a370cdc200..c58b0a0d75e1 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -557,6 +557,10 @@ pa_option_override (void) if (flag_pic == 1 || TARGET_64BIT) flag_pic = 2; + /* 64-bit target is always PIE. */ + if (TARGET_64BIT) + flag_pie = 2; + /* Disable -freorder-blocks-and-partition as we don't support hot and cold partitioning. */ if (flag_reorder_blocks_and_partition) diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c index 24260538cc0a..074684604bc0 100644 --- a/gcc/testsuite/gcc.dg/pic-2.c +++ b/gcc/testsuite/gcc.dg/pic-2.c @@ -3,6 +3,7 @@ /* { dg-options "-fPIC" } */ /* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */ /* { dg-skip-if "__PIE__ is always defined for GCN" { amdgcn*-*-* } } */ +/* { dg-skip-if "__PIE__ is always defined for hppa64" { hppa*64*-*-* } } */ #if defined(__CYGWIN__) || defined(__WIN32__) # if __PIC__ != 1