1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
# DP: use gcc-7 instead of gcc as the command name.
--- a/src/gcc/ada/gnatlink.adb
+++ b/src/gcc/ada/gnatlink.adb
@@ -136,7 +136,8 @@
-- This table collects the arguments to be passed to compile the binder
-- generated file.
- Gcc : String_Access := Program_Name ("gcc", "gnatlink");
+ Gcc : String_Access
+ := Program_Name ("gcc-" & Gnatvsn.Library_Version, "gnatlink");
Read_Mode : constant String := "r" & ASCII.NUL;
@@ -1412,7 +1413,8 @@
end if;
Write_Line (" --GCC=comp Use comp as the compiler");
- Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc'");
+ Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc-"
+ & Gnatvsn.Library_Version & "'");
Write_Eol;
Write_Line (" [non-Ada-objects] list of non Ada object files");
Write_Line (" [linker-options] other options for the linker");
--- a/src/gcc/ada/make.adb
+++ b/src/gcc/ada/make.adb
@@ -667,9 +667,12 @@
-- Compiler, Binder & Linker Data and Subprograms --
----------------------------------------------------
- Gcc : String_Access := Program_Name ("gcc", "gnatmake");
- Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
- Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
+ Gcc : String_Access := Program_Name
+ ("gcc-" & Gnatvsn.Library_Version, "gnatmake");
+ Gnatbind : String_Access := Program_Name
+ ("gnatbind-" & Gnatvsn.Library_Version, "gnatmake");
+ Gnatlink : String_Access := Program_Name
+ ("gnatlink-" & Gnatvsn.Library_Version, "gnatmake");
-- Default compiler, binder, linker programs
Globalizer : constant String := "codepeer_globalizer";
--- a/src/gcc/ada/gnatchop.adb
+++ b/src/gcc/ada/gnatchop.adb
@@ -36,6 +36,7 @@
with GNAT.Heap_Sort_G;
with GNAT.Table;
+with Gnatvsn;
with Switch; use Switch;
with Types;
@@ -44,7 +45,7 @@
Config_File_Name : constant String_Access := new String'("gnat.adc");
-- The name of the file holding the GNAT configuration pragmas
- Gcc : String_Access := new String'("gcc");
+ Gcc : String_Access := new String'("gcc-" & Gnatvsn.Library_Version);
-- May be modified by switch --GCC=
Gcc_Set : Boolean := False;
--- a/src/gcc/ada/mdll-utl.adb
+++ b/src/gcc/ada/mdll-utl.adb
@@ -29,6 +29,7 @@
with Ada.Exceptions;
with GNAT.Directory_Operations;
+with Gnatvsn;
with Osint;
package body MDLL.Utl is
@@ -39,7 +40,7 @@
Dlltool_Name : constant String := "dlltool";
Dlltool_Exec : OS_Lib.String_Access;
- Gcc_Name : constant String := "gcc";
+ Gcc_Name : constant String := "gcc-" & Gnatvsn.Library_Version;
Gcc_Exec : OS_Lib.String_Access;
Gnatbind_Name : constant String := "gnatbind";
@@ -212,7 +213,7 @@
end;
end if;
- Print_Command ("gcc", Arguments (1 .. A));
+ Print_Command (Gcc_Name, Arguments (1 .. A));
OS_Lib.Spawn (Gcc_Exec.all, Arguments (1 .. A), Success);
--- a/src/gcc/ada/mlib-utl.adb
+++ b/src/gcc/ada/mlib-utl.adb
@@ -23,6 +23,7 @@
-- --
------------------------------------------------------------------------------
+with Gnatvsn;
with MLib.Fil; use MLib.Fil;
with MLib.Tgt; use MLib.Tgt;
with Opt;
@@ -446,7 +447,8 @@
if Driver_Name = No_Name then
if Gcc_Exec = null then
if Gcc_Name = null then
- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
+ Gcc_Name := Osint.Program_Name
+ ("gcc-" & Gnatvsn.Library_Version, "gnatmake");
end if;
Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
--- a/src/gcc/ada/prj-makr.adb
+++ b/src/gcc/ada/prj-makr.adb
@@ -24,6 +24,7 @@
------------------------------------------------------------------------------
with Csets;
+with Gnatvsn;
with Makeutl; use Makeutl;
with Opt;
with Output;
@@ -115,7 +116,7 @@
procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
- Gcc : constant String := "gcc";
+ Gcc : constant String := "gcc-" & Gnatvsn.Library_Version;
Gcc_Path : String_Access := null;
Non_Empty_Node : constant Project_Node_Id := 1;
|