From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A8A103858CDB; Fri, 31 Mar 2023 08:39:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8A103858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680251994; bh=9f5FLgHwgdhESljYYwGT503AMwLTwDNsxaJQNf9g+xY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VXlDgXbAjx2i7FnfKOr9+9zpcr1TeHtDgcGwH+yJFY4QZEiRXviMOzVlWNzdtPSxL KdSFIWNDuGvLpT/UTsvy/cg1VIxNQVtI7ipuA7iPgh+XpOTxDdkGI+t/+6BBd0tX/d /dOOghNGedEThyB5BRTeWzBnRxa4sN9p5Y4GlKqE= From: "tschwinge at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109128] [Offload][OpenMP][OpenACC] Static linking with unused offload function will lead to mismatch number of offload fn/symbols Date: Fri, 31 Mar 2023 08:39:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: openacc, openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tschwinge at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: burnus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109128 Thomas Schwinge changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |burnus at gcc dot g= nu.org Status|NEW |ASSIGNED --- Comment #6 from Thomas Schwinge --- I'm very likely missing some crucial "minor detail" here: (In reply to Tobias Burnus from comment #3) > My initial thought was to handle it via lto1. This works well if all > relevant files are compiled with "-flto" as then the callers of the offlo= ad > functions, the offload functions themselves are available, permitting to > generate __OFFLOAD_TABLE__ directly. I don't understand why '-flto', that is, why looking at *LTO data*. My idea had been that we'd have a mode for host-side 'lto1' where it reads the *offloading data*. (I'd, by the way think, that having a separate 'offload1' instead of piggy-backing offloading handling on 'lto1' might be clearer generally -- especially once we get to actual offloading-LTO?) > However, if -flto is not used or not used for all translation units (with > offload code), this approach will fail due to visibility problems. >=20 > Namely, the offload functions have local binding. This could be solved by > forcing global binding (with visibility hidden), but this approach will f= ail > if the assembler name is not unique. That is, my understanding was that the *offloading data* contains all the information that we need?=