public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg
@ 2022-05-04 16:16 Tobias Burnus
  2022-05-04 16:34 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Burnus @ 2022-05-04 16:16 UTC (permalink / raw)
  To: gcc-patches, Andrew Stubbs, Jakub Jelinek

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

See also https://gcc.gnu.org/gcc-12/changes.html#languages and
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-foffload

-foffload= was never officially documented, albeit most users will
have encountered it. Since GCC 12 it is - but the -foffload=-<flag>
part is officially only handled by -foffload-options=, even if it
works as legacy feature with -foffload= as well.

OK for GCC 13?

Tobias

PS: Note that -foffload=amdgcn-amdhsa=-march=gfx908 and
-foffload-options=amdgcn-amdhsa=-march=gfx908 are not identical.
The former (legacy feature) will disable all other supported targets,
such as nvptx, while the latter keeps the default set - and just passes
that additional flag to the amdgcn target compiler.
-----------------
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

[-- Attachment #2: fix-foffload.diff --]
[-- Type: text/x-patch, Size: 837 bytes --]

libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg

While -foffload=-<flag> works (never documented legacy feature),
the documented way is to use -foffload-options=.

libgomp/ChangeLog:

        * plugin/plugin-gcn.c (isa_matches_agent): Suggest -foffload-options.

diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index f305d726874..2b32f5352c8 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -2352,7 +2352,7 @@ isa_matches_agent (struct agent_info *agent, Elf64_Ehdr *image)
 
       snprintf (msg, sizeof msg,
 		"GCN code object ISA '%s' does not match GPU ISA '%s'.\n"
-		"Try to recompile with '-foffload=-march=%s'.\n",
+		"Try to recompile with '-foffload-options=-march=%s'.\n",
 		isa_s, agent_isa_s, agent_isa_gcc_s);
 
       hsa_error (msg, HSA_STATUS_ERROR);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg
  2022-05-04 16:16 libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg Tobias Burnus
@ 2022-05-04 16:34 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2022-05-04 16:34 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-patches, Andrew Stubbs

On Wed, May 04, 2022 at 06:16:14PM +0200, Tobias Burnus wrote:
> See also https://gcc.gnu.org/gcc-12/changes.html#languages and
> https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-foffload
> 
> -foffload= was never officially documented, albeit most users will
> have encountered it. Since GCC 12 it is - but the -foffload=-<flag>
> part is officially only handled by -foffload-options=, even if it
> works as legacy feature with -foffload= as well.
> 
> OK for GCC 13?
> 
> Tobias
> 
> PS: Note that -foffload=amdgcn-amdhsa=-march=gfx908 and
> -foffload-options=amdgcn-amdhsa=-march=gfx908 are not identical.
> The former (legacy feature) will disable all other supported targets,
> such as nvptx, while the latter keeps the default set - and just passes
> that additional flag to the amdgcn target compiler.
> -----------------
> 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

> libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg
> 
> While -foffload=-<flag> works (never documented legacy feature),
> the documented way is to use -foffload-options=.
> 
> libgomp/ChangeLog:
> 
>         * plugin/plugin-gcn.c (isa_matches_agent): Suggest -foffload-options.

LGTM.

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-04 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 16:16 libgomp/plugin/plugin-gcn.c: Use -foffload-options= in err msg Tobias Burnus
2022-05-04 16:34 ` Jakub Jelinek

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