diff options
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 11 | ||||
-rw-r--r-- | src/ghdldrv/ghdllocal.adb | 5 | ||||
-rw-r--r-- | src/ghdldrv/ghdllocal.ads | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index a15736222..3cd7c1f74 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -603,8 +603,8 @@ package body Ghdldrv is Arg : String; Res : out Option_Res) is - Str : String_Access; Opt : constant String (1 .. Option'Length) := Option; + Str : String_Access; begin Res := Option_Bad; if Opt = "-v" and then Flag_Verbose = False then @@ -687,7 +687,14 @@ package body Ghdldrv is -- compiler_args. null; else - Add_Argument (Compiler_Args, new String'(Opt)); + if Backend = Backend_Gcc then + -- Prefix options for gcc so that lang.opt does need to be + -- updated when a new option is added. + Str := new String'("--ghdl" & Opt); + else + Str := new String'(Opt); + end if; + Add_Argument (Compiler_Args, Str); end if; Res := Option_Ok; elsif Opt'Length > 18 diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index 030cf118e..5841f1b4f 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -56,10 +56,9 @@ package body Ghdllocal is Compile_Init; end Init; - function Decode_Driver_Option (Option : String) return Boolean + function Decode_Driver_Option (Opt : String) return Boolean is - subtype Opt_String is String (1 .. Option'Length); - Opt : Opt_String renames Option; + pragma Assert (Opt'First = 1); begin if Opt = "-v" and then Flag_Verbose = False then Flag_Verbose := True; diff --git a/src/ghdldrv/ghdllocal.ads b/src/ghdldrv/ghdllocal.ads index ff66c4d59..3189c58cc 100644 --- a/src/ghdldrv/ghdllocal.ads +++ b/src/ghdldrv/ghdllocal.ads @@ -25,7 +25,7 @@ package Ghdllocal is -- Handle: -- --std=xx, --work=xx, -Pxxx, --workdir=x, --ieee=x, -Px, and -v - function Decode_Driver_Option (Option : String) return Boolean; + function Decode_Driver_Option (Opt : String) return Boolean; type Command_Lib is abstract new Command_Type with null record; |