public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Modula-2: Support '-isysroot [...]'
@ 2023-12-05  9:36 Thomas Schwinge
  2023-12-05 23:12 ` Gaius Mulley
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Schwinge @ 2023-12-05  9:36 UTC (permalink / raw)
  To: gcc-patches, Gaius Mulley

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

Hi!

OK to push the attached "Modula-2: Support '-isysroot [...]'"?

This greatly improves test results for the cross configurations I've
tested, but I don't know if any real handling needs to be implemented, or
this should be done differently altogether?


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

[-- Attachment #2: 0001-Modula-2-Support-isysroot.patch --]
[-- Type: text/x-diff, Size: 1545 bytes --]

From 0bd30fd25138497df5320e5f63fd04e1b5756cc5 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 5 Dec 2023 09:54:54 +0100
Subject: [PATCH] Modula-2: Support '-isysroot [...]'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In GCC cross configurations (tested '--target=amdgcn-amdhsa' and
'--target=nvptx-none') with a sysroot configured, the 'gm2' driver invocations
are passed '--sysroot=[...]', which is translated into '-isysroot [...]' for
the 'cc1gm2' compiler invocation.  The latter, however gets complained about:

    cc1gm2: warning: command-line option ‘-isysroot [...]’ is valid for C/C++/D/Fortran/ObjC/ObjC++ but not for Modula-2

..., and therefore a ton of FAILs.

Reproducer (also for non-cross, native configurations):

    $ build-gcc/gcc/gm2 -Bbuild-gcc/gcc -v --sysroot=/tmp -x modula-2 /dev/null
    [...]
     build-gcc/gcc/cc1gm2 [...] -isysroot [...]/tmp [...]
    cc1gm2: warning: command-line option ‘-isysroot /tmp’ is valid for C/C++/D/Fortran/ObjC/ObjC++ but not for Modula-2
    [...]

	gcc/m2/
	* lang.opt (-isysroot): New.
---
 gcc/m2/lang.opt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
index 24f3c6594b9..a60c03e69d4 100644
--- a/gcc/m2/lang.opt
+++ b/gcc/m2/lang.opt
@@ -405,6 +405,10 @@ iquote
 Modula-2
 ; Documented in c.opt
 
+isysroot
+Modula-2
+; Documented in c.opt
+
 isystem
 Modula-2
 ; Documented in c.opt
-- 
2.34.1


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

* Re: Modula-2: Support '-isysroot [...]'
  2023-12-05  9:36 Modula-2: Support '-isysroot [...]' Thomas Schwinge
@ 2023-12-05 23:12 ` Gaius Mulley
  0 siblings, 0 replies; 2+ messages in thread
From: Gaius Mulley @ 2023-12-05 23:12 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches

Thomas Schwinge <thomas@codesourcery.com> writes:

> Hi!
>
> OK to push the attached "Modula-2: Support '-isysroot [...]'"?
>
> This greatly improves test results for the cross configurations I've
> tested, but I don't know if any real handling needs to be implemented, or
> this should be done differently altogether?
>
>
> 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 0bd30fd25138497df5320e5f63fd04e1b5756cc5 Mon Sep 17 00:00:00 2001
> From: Thomas Schwinge <thomas@codesourcery.com>
> Date: Tue, 5 Dec 2023 09:54:54 +0100
> Subject: [PATCH] Modula-2: Support '-isysroot [...]'
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> In GCC cross configurations (tested '--target=amdgcn-amdhsa' and
> '--target=nvptx-none') with a sysroot configured, the 'gm2' driver invocations
> are passed '--sysroot=[...]', which is translated into '-isysroot [...]' for
> the 'cc1gm2' compiler invocation.  The latter, however gets complained about:
>
>     cc1gm2: warning: command-line option ‘-isysroot [...]’ is valid for C/C++/D/Fortran/ObjC/ObjC++ but not for Modula-2
>
> ..., and therefore a ton of FAILs.
>
> Reproducer (also for non-cross, native configurations):
>
>     $ build-gcc/gcc/gm2 -Bbuild-gcc/gcc -v --sysroot=/tmp -x modula-2 /dev/null
>     [...]
>      build-gcc/gcc/cc1gm2 [...] -isysroot [...]/tmp [...]
>     cc1gm2: warning: command-line option ‘-isysroot /tmp’ is valid for C/C++/D/Fortran/ObjC/ObjC++ but not for Modula-2
>     [...]
>
> 	gcc/m2/
> 	* lang.opt (-isysroot): New.
> ---
>  gcc/m2/lang.opt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
> index 24f3c6594b9..a60c03e69d4 100644
> --- a/gcc/m2/lang.opt
> +++ b/gcc/m2/lang.opt
> @@ -405,6 +405,10 @@ iquote
>  Modula-2
>  ; Documented in c.opt
>  
> +isysroot
> +Modula-2
> +; Documented in c.opt
> +
>  isystem
>  Modula-2
>  ; Documented in c.opt

Hi Thomas,

yes indeed and many thanks for the fix!  gm2-lang.cc anticipates
OPT_isysroot (albeit it does nothing with it yet)

regards,
Gaius

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

end of thread, other threads:[~2023-12-05 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05  9:36 Modula-2: Support '-isysroot [...]' Thomas Schwinge
2023-12-05 23:12 ` Gaius Mulley

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