Hi!

On 2021-07-30T12:05:56+0200, I wrote:
> On 2021-07-30T12:02:00+0200, Jakub Jelinek via Gcc-patches 
> <gcc-patches@gcc.gnu.org> wrote:
>> On Fri, Jul 30, 2021 at 11:54:00AM +0200, Ulrich Drepper wrote:
>>> On Fri, Jul 30, 2021 at 10:50 AM Jakub Jelinek <ja...@redhat.com> wrote:
>>>
>>> > I think for now it would be better to guard the omp_display_env_*
>>> > in fortran.c with #ifndef LIBGOMP_OFFLOADED_ONLY
>>>
>>> OK, easy enough.  This compiles for me.
>>
>> Ok (with ChangeLog entry), thanks.
>
> Heh, I had just come up with the same patch, and pushed
> "[libgomp] Restore offloading 'libgomp/fortran.c'" to master branch in
> commit 28665ddc7efa48f9b39615e313a2c4a7a66cdb24, see attached.

I'm sorry if I stepped on anyone's toes: Tobias told me that you were
still discussing on IRC the proper way of fixing this, while I went ahead
and pushed what I considered "obvious enough", meaning that it fixes the
regression, whilst not breaking anything else.  (Adding more
functionality can of course be done, incrementally.)


Grüße
 Thomas


> From 28665ddc7efa48f9b39615e313a2c4a7a66cdb24 Mon Sep 17 00:00:00 2001
> From: Thomas Schwinge <tho...@codesourcery.com>
> Date: Fri, 30 Jul 2021 11:48:54 +0200
> Subject: [PATCH] [libgomp] Restore offloading 'libgomp/fortran.c'
>
> GCN:
>
>     ld: error: undefined symbol: gomp_ialias_omp_display_env
>     >>> referenced by fortran.c:744 ([...]/source-gcc/libgomp/fortran.c:744)
>     >>>               fortran.o:(omp_display_env_) in archive 
> [...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libgomp/.libs/libgomp.a
>     >>> referenced by fortran.c:744 ([...]/source-gcc/libgomp/fortran.c:744)
>     >>>               fortran.o:(omp_display_env_) in archive 
> [...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libgomp/.libs/libgomp.a
>     >>> referenced by fortran.c:750 ([...]/source-gcc/libgomp/fortran.c:750)
>     >>>               fortran.o:(omp_display_env_8_) in archive 
> [...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libgomp/.libs/libgomp.a
>     >>> referenced by fortran.c:750 ([...]/source-gcc/libgomp/fortran.c:750)
>     >>>               fortran.o:(omp_display_env_8_) in archive 
> [...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/libgomp/.libs/libgomp.a
>     collect2: error: ld returned 1 exit status
>     mkoffload: fatal error: 
> build-gcc/gcc/x86_64-pc-linux-gnu-accel-amdgcn-amdhsa-gcc returned 1 exit 
> status
>
> nvptx:
>
>     unresolved symbol omp_display_env
>     collect2: error: ld returned 1 exit status
>     mkoffload: fatal error: 
> [...]/build-gcc/./gcc/x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1 
> exit status
>
> Fix-up for commit 7123ae2455b5a1a2f19f13fa82c377cfda157f23
> "Implement OpenMP 5.1 section 3.15: omp_display_env".
>
>       libgomp/
>       * fortran.c (omp_display_env_, omp_display_env_8_): Only
>       '#ifndef LIBGOMP_OFFLOADED_ONLY'.
>
> Co-Authored-By: Ulrich Drepper <drep...@redhat.com>
> ---
>  libgomp/fortran.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libgomp/fortran.c b/libgomp/fortran.c
> index 76285d4376b..e042702ac91 100644
> --- a/libgomp/fortran.c
> +++ b/libgomp/fortran.c
> @@ -738,6 +738,8 @@ omp_get_default_allocator_ ()
>    return (intptr_t) omp_get_default_allocator ();
>  }
>
> +#ifndef LIBGOMP_OFFLOADED_ONLY
> +
>  void
>  omp_display_env_ (const int32_t *verbose)
>  {
> @@ -749,3 +751,5 @@ omp_display_env_8_ (const int64_t *verbose)
>  {
>    omp_display_env (!!*verbose);
>  }
> +
> +#endif /* LIBGOMP_OFFLOADED_ONLY */
> --
> 2.30.2
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to