From patchwork Thu Apr 28 13:50: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: 1623678 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 4KpxpZ1Hwyz9s0B for ; Thu, 28 Apr 2022 23:50:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 25D4B385626A for ; Thu, 28 Apr 2022 13:50:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id E56BD3857346 for ; Thu, 28 Apr 2022 13:50:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E56BD3857346 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="74876441" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 28 Apr 2022 05:50:19 -0800 IronPort-SDR: QYloqFXmxTzKCE4RihurcYANmzXrsyC4Y3RyZ7tObINuYEvj233aHYF66Ozc7oqt/KhkAuB0yq uXSx0wzEamA9Nmr0Ail2rZ1SlI2hAwlhlfkGqhei8bwvqJF5wlvYbxFmet2Pz9x9qR0j5Pa5UR raqwyaGLD2H/sHlOCI/SiEjgg+L/ZG0YH78u+/5BNAkSHROQFTmtHH2raVgCClwncK7W3/tKyv KEvqkpN4rYdIikOmV8OLneYRSXANq8tsAQQ33x+wn28phqUs/kf9PRgI6dZn9GJzS102ARps/q C38= From: Thomas Schwinge To: , Andrew Stubbs , "Julian Brown" Subject: [PING] libgomp GCN plugin: Clean up unused references to system-provided HSA Runtime library (was: [PATCH 1/4] Remove build dependence on HSA run-time) In-Reply-To: <878rsittr3.fsf@dem-tschwing-1.ger.mentorg.com> References: <20161118102310.GP3541@tucnak.redhat.com> <20161122132744.lrxg63wvfa3qfvhf@virgil.suse.cz> <87o8hrindc.fsf@euler.schwinge.homeip.net> <878rsittr3.fsf@dem-tschwing-1.ger.mentorg.com> 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:50:13 +0200 Message-ID: <87ee1he2qy.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) 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-06T12:02:08+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.) > > Given the 'PLUGIN_HSA_LIBS' change cited above, OK to push the attached > "libgomp GCN plugin: Clean up unused references to system-provided HSA > Runtime library"? 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 5e28a267a34282e4d6001e5f89a3b7bd7a0f20c7 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 6 Apr 2022 11:31:45 +0200 Subject: [PATCH] libgomp GCN plugin: Clean up unused references to system-provided HSA Runtime library This is only active if GCC is 'configure'd with '--with-hsa-runtime=[...]' or '--with-hsa-runtime-include=[...]', '--with-hsa-runtime-lib=[...]' -- which nobody really is doing, as far as I can tell. Originally changed for the libgomp HSA plugin in commit b8d89b03db5f212919e4571671ebb4f5f8b1e19d (r242749) "Remove build dependence on HSA run-time", and later propagated into the GCN plugin, these are no longer built against system-provided HSA Runtime library. Instead, unconditionally built against the GCC-shipped 'include/hsa*.h' header files, and at run time does 'dlopen("libhsa-runtime64.so.1")'. It thus doesn't make sense to consider references to system-provided HSA Runtime library during libgomp GCN plugin build. libgomp/ * plugin/configfrag.ac (HSA_RUNTIME_CPPFLAGS) (HSA_RUNTIME_LDFLAGS): Remove. * configure: Regenerate. --- libgomp/configure | 10 ---------- libgomp/plugin/configfrag.ac | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/libgomp/configure b/libgomp/configure index a73a6d44003..8bb67c650a6 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -15244,8 +15244,6 @@ HSA_RUNTIME_INCLUDE= HSA_RUNTIME_LIB= -HSA_RUNTIME_CPPFLAGS= -HSA_RUNTIME_LDFLAGS= # Check whether --with-hsa-runtime was given. @@ -15275,12 +15273,6 @@ fi if test "x$with_hsa_runtime_lib" != x; then HSA_RUNTIME_LIB=$with_hsa_runtime_lib fi -if test "x$HSA_RUNTIME_INCLUDE" != x; then - HSA_RUNTIME_CPPFLAGS=-I$HSA_RUNTIME_INCLUDE -fi -if test "x$HSA_RUNTIME_LIB" != x; then - HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB -fi PLUGIN_GCN=0 PLUGIN_GCN_CPPFLAGS= @@ -15390,8 +15382,6 @@ rm -f core conftest.err conftest.$ac_objext \ *) tgt_plugin=gcn PLUGIN_GCN=$tgt - PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS - PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS" PLUGIN_GCN_LIBS="-ldl" PLUGIN_GCN=1 ;; diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac index da573bd8387..56461b89117 100644 --- a/libgomp/plugin/configfrag.ac +++ b/libgomp/plugin/configfrag.ac @@ -97,8 +97,6 @@ HSA_RUNTIME_INCLUDE= HSA_RUNTIME_LIB= AC_SUBST(HSA_RUNTIME_INCLUDE) AC_SUBST(HSA_RUNTIME_LIB) -HSA_RUNTIME_CPPFLAGS= -HSA_RUNTIME_LDFLAGS= AC_ARG_WITH(hsa-runtime, [AS_HELP_STRING([--with-hsa-runtime=PATH], @@ -121,12 +119,6 @@ fi if test "x$with_hsa_runtime_lib" != x; then HSA_RUNTIME_LIB=$with_hsa_runtime_lib fi -if test "x$HSA_RUNTIME_INCLUDE" != x; then - HSA_RUNTIME_CPPFLAGS=-I$HSA_RUNTIME_INCLUDE -fi -if test "x$HSA_RUNTIME_LIB" != x; then - HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB -fi PLUGIN_GCN=0 PLUGIN_GCN_CPPFLAGS= @@ -225,8 +217,6 @@ if test x"$enable_offload_targets" != x; then *) tgt_plugin=gcn PLUGIN_GCN=$tgt - PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS - PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS" PLUGIN_GCN_LIBS="-ldl" PLUGIN_GCN=1 ;; -- 2.25.1