[PATCH v2] pr107421.f90: Require PIE and pass -fPIE for non-x86 targets
H.J. Lu
hjl.tools@gmail.com
Wed Sep 10 18:21:13 GMT 2025
On Mon, Sep 8, 2025 at 7:47 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> -mno-direct-extern-access is used to disable direct access to external
> symbol from executable with and without PIE for x86. Require PIE and
> pass -fPIE to disable direct access to external symbol for other targets.
>
> PR fortran/107421
> PR testsuite/121848
> * gfortran.dg/gomp/pr107421.f90: Require PIE and pass -fPIE for
> non-x86 targets.
>
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
> ---
> gcc/testsuite/gfortran.dg/gomp/pr107421.f90 | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/gcc/testsuite/gfortran.dg/gomp/pr107421.f90 b/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
> index db98dced8ce..a524db5f2af 100644
> --- a/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
> +++ b/gcc/testsuite/gfortran.dg/gomp/pr107421.f90
> @@ -1,4 +1,8 @@
> +! { dg-require-effective-target pie }
> ! { dg-additional-options "-fdump-ipa-whole-program" }
> +! Add -fPIE or -mno-direct-extern-access to disable direct access to
> +! external symbol from executable.
> +! { dg-additional-options "-fPIE" { target { ! { i?86-*-* x86_64-*-* } } } }
> ! { dg-additional-options "-mno-direct-extern-access" { target { i?86-*-* x86_64-*-* } } }
>
> integer :: i
> --
> 2.51.0
>
I am checking it in.
--
H.J.
More information about the Fortran
mailing list