public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Andrew Stubbs <ams@codesourcery.com>,
	Julian Brown <julian@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: [PING^2] libgomp testsuite: Don't amend 'LD_LIBRARY_PATH' for system-provided HSA Runtime library (was: [PATCH 1/4] Remove build dependence on HSA run-time)
Date: Thu, 5 May 2022 21:20:51 +0200	[thread overview]
Message-ID: <8735hnvl9o.fsf@dirichlet.schwinge.homeip.net> (raw)
In-Reply-To: <87h76de2ua.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]

Hi!

Ping^2.


Grüße
 Thomas


On 2022-04-28T15:48:13+0200, I wrote:
> Hi!
>
> Ping.
>
> On 2022-04-06T11:20:47+0200, I wrote:
>> On 2021-01-14T15:50:23+0100, I wrote:
>>> I'm raising here an issue with HSA libgomp plugin code changes from a
>>> while ago.  While HSA is now no longer relevant for GCC master branch,
>>> the same code has also been copied into the GCN libgomp plugin.
>>
>> Here is another small clean-up patch (to enable further clean-up):
>>
>>> This is commit b8d89b03db5f212919e4571671ebb4f5f8b1e19d (r242749) "Remove
>>> build dependence on HSA run-time":
>>>
>>> On 2016-11-22T14:27:44+0100, Martin Jambor <mjambor@suse.cz> wrote:
>>>> --- a/libgomp/plugin/configfrag.ac
>>>> +++ b/libgomp/plugin/configfrag.ac
>>>
>>>> @@ -195,8 +183,8 @@ if test x"$enable_offload_targets" != x; then
>>>>             tgt_name=hsa
>>>>             PLUGIN_HSA=$tgt
>>>>             PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
>>>> -           PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS"
>>>> -           PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt"
>>>> +           PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
>>>> +           PLUGIN_HSA_LIBS="-ldl"
>>>
>>> So this switched from directly linking against 'libhsa-runtime64.so' to a
>>> 'libdl'-based runtime linking variant.
>>
>> (Not intending to change anything regarding that.)
>>
>>> For avoidance of doubt, [an earlier] change doesn't affect (build-tree) testsuite
>>> usage, where we have:
>>>
>>>     libgomp/testsuite/libgomp-test-support.exp.in:set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
>>>
>>>     libgomp/testsuite/lib/libgomp.exp:          append always_ld_library_path ":$hsa_runtime_lib"
>>
>> But, as I argue in the attached "libgomp testsuite: Don't amend
>> 'LD_LIBRARY_PATH' for system-provided HSA Runtime library", we should
>> actually clean this up as well.  OK to push that?
>>
>>
>> Grüße
>>  Thomas


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libgomp-testsuite-Don-t-amend-LD_LIBRARY_PATH-for-sy.patch --]
[-- Type: text/x-diff, Size: 2573 bytes --]

From 364d01339883f5276ef09d68a5d9a2e0010ab641 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 6 Apr 2022 10:39:56 +0200
Subject: [PATCH] libgomp testsuite: Don't amend 'LD_LIBRARY_PATH' for
 system-provided HSA Runtime library

This is only active if GCC is 'configure'd with '--with-hsa-runtime=[...]' or
'--with-hsa-runtime-lib=[...]' -- which nobody really is doing, as far as I can
tell.

'libgomp/testsuite/lib/libgomp.exp:libgomp_init' states:

    # For build-tree testing, also consider the library paths used for builing.
    # For installed testing, we assume all that to be provided in the sysroot.
    if { $blddir != "" } {
        [...]
        global hsa_runtime_lib
        if { $hsa_runtime_lib != "" } {
            append always_ld_library_path ":$hsa_runtime_lib"
        }
    }

However, the libgomp GCN plugin is unconditionally built against the
GCC-shipped 'include/hsa*.h' header files, and at run time does
'dlopen("libhsa-runtime64.so.1")', so there is no system-provided HSA Runtime
library "used for builing".  It thus doesn't make sense to amend
'LD_LIBRARY_PATH' for system-provided HSA Runtime library.

	libgomp/
	* testsuite/lib/libgomp.exp (libgomp_init): Don't
	'append always_ld_library_path ":$hsa_runtime_lib"'.
	* testsuite/libgomp-test-support.exp.in (hsa_runtime_lib): Don't set.
---
 libgomp/testsuite/lib/libgomp.exp             | 4 ----
 libgomp/testsuite/libgomp-test-support.exp.in | 1 -
 2 files changed, 5 deletions(-)

diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 8c5ecfff0ac..0aaa58f19c5 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -202,10 +202,6 @@ proc libgomp_init { args } {
 	    lappend ALWAYS_CFLAGS "additional_flags=-L$cuda_driver_lib"
 	    append always_ld_library_path ":$cuda_driver_lib"
 	}
-	global hsa_runtime_lib
-	if { $hsa_runtime_lib != "" } {
-	    append always_ld_library_path ":$hsa_runtime_lib"
-	}
     }
 
     # We use atomic operations in the testcases to validate results.
diff --git a/libgomp/testsuite/libgomp-test-support.exp.in b/libgomp/testsuite/libgomp-test-support.exp.in
index 98fb442b537..3c88d1d5a62 100644
--- a/libgomp/testsuite/libgomp-test-support.exp.in
+++ b/libgomp/testsuite/libgomp-test-support.exp.in
@@ -1,6 +1,5 @@
 set cuda_driver_include "@CUDA_DRIVER_INCLUDE@"
 set cuda_driver_lib "@CUDA_DRIVER_LIB@"
-set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
 
 set offload_plugins "@offload_plugins@"
 set offload_targets "@offload_targets@"
-- 
2.35.1


  reply	other threads:[~2022-05-05 19:20 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-13 23:20 [PATCH 0/4] Merge from HSA branch to trunk Martin Jambor
2016-11-13 23:20 ` [PATCH 3/4] OpenMP lowering changes from the hsa branch Martin Jambor
2016-11-18 10:39   ` Jakub Jelinek
2016-03-16 14:13     ` [omp] Create openmp -fopt-info optimization group Martin Jambor
2017-02-21  8:09       ` [gomp4] add -finform-parallelism Cesar Philippidis
2017-02-22  8:28         ` Thomas Schwinge
2017-02-23 15:06           ` Cesar Philippidis
2016-11-22 13:43     ` [PATCH 3/4] OpenMP lowering changes from the hsa branch Martin Jambor
2017-02-22  7:58       ` Rename the "openmp" group of optimizations to "omp" (was: [PATCH 3/4] OpenMP lowering changes from the hsa branch) Thomas Schwinge
2017-02-22  8:17         ` Miscellaneous optimization group fixes (was: Rename the "openmp" group of optimizations to "omp") Thomas Schwinge
2017-02-22  9:53           ` Martin Jambor
2017-02-28  8:52             ` Rename the "openmp" group of optimizations to "omp" (was: Miscellaneous optimization group fixes) Thomas Schwinge
2017-02-28  9:04             ` Miscellaneous optimization group fixes Thomas Schwinge
2016-11-13 23:20 ` [PATCH 2/4] HSA specific built-ins Martin Jambor
2016-11-18 10:27   ` Jakub Jelinek
2016-11-22 13:30     ` Martin Jambor
2016-11-13 23:20 ` [PATCH 1/4] Remove build dependence on HSA run-time Martin Jambor
2016-11-18 10:23   ` Jakub Jelinek
2016-11-22 13:27     ` Martin Jambor
2016-11-22 14:13       ` Jakub Jelinek
2021-01-14 14:50       ` Thomas Schwinge
2021-01-19 11:37         ` Martin Jambor
2021-01-19 12:49           ` Martin Liška
2021-03-25 13:40           ` Thomas Schwinge
2022-04-06  9:20         ` libgomp testsuite: Don't amend 'LD_LIBRARY_PATH' for system-provided HSA Runtime library (was: [PATCH 1/4] Remove build dependence on HSA run-time) Thomas Schwinge
2022-04-06  9:24           ` Jakub Jelinek
2022-04-06  9:54             ` libgomp testsuite: Don't amend 'LD_LIBRARY_PATH' for system-provided HSA Runtime library Thomas Schwinge
2022-04-28 13:48           ` [PING] libgomp testsuite: Don't amend 'LD_LIBRARY_PATH' for system-provided HSA Runtime library (was: [PATCH 1/4] Remove build dependence on HSA run-time) Thomas Schwinge
2022-05-05 19:20             ` Thomas Schwinge [this message]
2022-04-06 10:02         ` libgomp GCN plugin: Clean up unused references to " Thomas Schwinge
2022-04-28 13:50           ` [PING] " Thomas Schwinge
2022-04-28 14:18           ` Andrew Stubbs
2022-05-11 12:38           ` libgomp GCN plugin: Clean up always-empty 'PLUGIN_GCN_CPPFLAGS', 'PLUGIN_GCN_LDFLAGS' (was: libgomp GCN plugin: Clean up unused references to system-provided HSA Runtime library) Thomas Schwinge
2022-05-11 12:40           ` libgomp: Remove unused '--with-hsa-runtime', '--with-hsa-runtime-include', '--with-hsa-runtime-lib' " Thomas Schwinge
2016-11-13 23:20 ` [PATCH 4/4] Back-end and IPA bits of hsa branch merge Martin Jambor
     [not found]   ` <yxfpftb48jra.fsf@hertz.schwinge.homeip.net>
2020-06-17 21:57     ` [HSA] Avoid ICE when "HSA does not implement indirect calls" (was: [PATCH 4/4] Back-end and IPA bits of hsa branch merge) Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735hnvl9o.fsf@dirichlet.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).