From patchwork Thu Apr 28 13:48:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1623676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kpxmf3tg5z9s0B for ; Thu, 28 Apr 2022 23:49:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99A463856250 for ; Thu, 28 Apr 2022 13:49:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id ABFD13857346 for ; Thu, 28 Apr 2022 13:48:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABFD13857346 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.91,295,1647331200"; d="scan'208,223";a="75097346" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 28 Apr 2022 05:48:20 -0800 IronPort-SDR: bDTzgwG05MpVpp7UboisCapbhH8CSk2sVjK549iO8b6BT1HghS/n8s1JKZdnk4gjaD3PcWXNsi 2DMaQBwFbmqZSI5nbnD1aGAAonZiZtkLozv0O1Oil3/2vchr3LfqOAY3BZ0hb/3ZlsI3XeVXkN T6JS6MMJewifcnxLmpExTkbamEVYGy2dsHQMVbDgikiQuGgdoF39BXQvsnGzN/AbpYv5XpVi7p Kdgkqi5H6MmG2HSOOf6E2Zo99eYzWD//mnqQYIaOWN6OfussKPdfZ4EoDzOuo2VCYZSqRaxc6L E/I= From: Thomas Schwinge To: Andrew Stubbs , Julian Brown , Subject: [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) In-Reply-To: <875ynma7ps.fsf@euler.schwinge.homeip.net> References: <20161118102310.GP3541@tucnak.redhat.com> <20161122132744.lrxg63wvfa3qfvhf@virgil.suse.cz> <87o8hrindc.fsf@euler.schwinge.homeip.net> <875ynma7ps.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 28 Apr 2022 15:48:13 +0200 Message-ID: <87h76de2ua.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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 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 From 364d01339883f5276ef09d68a5d9a2e0010ab641 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge 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