--- a/gpr/gpr.gpr	2017-05-27 20:59:07.061135892 +0200
+++ b/gpr/gpr.gpr	2017-05-27 20:59:38.022638398 +0200
@@ -67,6 +67,7 @@
             for Switches ("gpr*.ad?") use
               Compiler'Default_Switches ("Ada") & ("-g1");
       end case;
+      for Driver ("C") use External ("CC", "gcc");
    end Compiler;
 
 end GPR;
--- a/gpr/src/gpr-names.ads	2017-11-19 13:09:18.947527738 +0100
+++ b/gpr/src/gpr-names.ads	2017-11-19 13:10:08.125654595 +0100
@@ -27,6 +27,8 @@
    Name_Buffer : String (1 .. 1_000_000);
    Name_Len    : Natural := 0;
 
+   Last_Id     : Name_Id := Name_Id'First;
+
    procedure Get_Name_String (Id : Name_Id);
    procedure Get_Name_String (Id : Unit_Name_Type);
    procedure Get_Name_String (Id : File_Name_Type);
--- a/gpr/src/gpr-names.adb	2017-11-19 13:10:27.674316703 +0100
+++ b/gpr/src/gpr-names.adb	2017-11-19 13:14:38.360963627 +0100
@@ -354,6 +354,8 @@
 
       Name_Chars.Append (ASCII.NUL);
 
+      Last_Id := Name_Entries.Last;
+
       return Name_Entries.Last;
    end Name_Enter;
 
@@ -427,6 +429,8 @@
 
       Name_Chars.Append (ASCII.NUL);
 
+      Last_Id := Name_Entries.Last;
+
       return Name_Entries.Last;
    end Name_Find;
 
--- a/gpr/src/gpr-snames.adb	2017-11-19 13:12:41.592995718 +0100
+++ b/gpr/src/gpr-snames.adb	2017-11-19 13:16:31.980979696 +0100
@@ -53,6 +53,10 @@
          return;
       end if;
 
+      if Last_Id = Name_Id'First then
+         Add_Name ("");
+      end if;
+
       Add_Name ("a");
       Add_Name ("b");
       Add_Name ("c");
--- a/src/gprlib.adb	2017-12-18 12:20:02.937317216 +0100
+++ b/src/gprlib.adb	2017-12-18 12:21:36.519604590 +0100
@@ -263,7 +263,9 @@
 
    Driver_Name                   : Name_Id := No_Name;
 
-   Gnatbind_Name                 : String_Access := new String'("gnatbind");
+   Gnatbind_Name                 : String_Access := new String'("@GNATBIND@");
+
+   Gnatbind_Path_Option          : constant String := "--gnatbind_path=";
 
    Compiler_Name                 : String_Access := new String'("gcc");
 
@@ -1944,13 +1946,13 @@
                           and then Line (Last - 2 .. Last) = "gcc"
                         then
                            Gnatbind_Name :=
-                             new String'(Line (1 .. Last - 3) & "gnatbind");
+                             new String'(Line (1 .. Last - 3) & "@GNATBIND@");
 
                         elsif Last > 7
                           and then Line (Last - 6 .. Last) = "gcc.exe"
                         then
                            Gnatbind_Name :=
-                             new String'(Line (1 .. Last - 7) & "gnatbind");
+                             new String'(Line (1 .. Last - 7) & "@GNATBIND@");
                         end if;
                      end if;
 
@@ -2100,7 +2102,13 @@
                Mapping_File_Name := new String'(Line (1 .. Last));
 
             when Binding_Options =>
-               Binding_Options_Table.Append (Line (1 .. Last));
+               if Last > Gnatbind_Path_Option'Length
+                  and then Line (1 .. Gnatbind_Path_Option'Length) =
+                     Gnatbind_Path_Option then
+                     null;
+               else
+                  Binding_Options_Table.Append (Line (1 .. Last));
+               end if;
 
             when Copy_Source_Dir =>
                Copy_Source_Directory := new String'(Line (1 .. Last));
--- a/share/gprconfig/compilers.xml	2018-10-17 14:36:15.100480516 +0200
+++ b/share/gprconfig/compilers.xml	2018-10-17 15:38:57.333256634 +0200
@@ -20,15 +20,15 @@
   <!--    GCC 3.x & 4.x (not for GNAT Pro)-->
   <compiler_description>
     <name>GCC</name>
-    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-generic-linux-gnu-|.*-pc-mingw32.*|.*-xcoff-.*|arm-linux-androideabi-|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|aarch64-linux-gnu-)?gcc</executable>
+    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-generic-linux-gnu-|.*-pc-mingw32.*|.*-xcoff-.*|arm-linux-androideabi-|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|aarch64-linux-gnu-)?gcc-@VER@</executable>
     <version>
-      <external>${PREFIX}gcc -v</external>
+      <external>${PREFIX}gcc-@VER@ -v</external>
       <nogrep regexp="for GNAT Pro"></nogrep>
       <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
     </version>
     <languages>C</languages>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gcc-@VER@ -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
@@ -170,14 +170,14 @@
    -->
   <compiler_description>
     <name>GNAT</name>
-    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-generic-linux-gnu-|.*-pc-mingw32.*|.*-xcoff-.*|arm-linux-androideabi-|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|aarch64-linux-gnu-|.*-qnx.*)?gnatls</executable>
+    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-generic-linux-gnu-|.*-pc-mingw32.*|.*-xcoff-.*|arm-linux-androideabi-|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|aarch64-linux-gnu-|.*-qnx.*)?gnatls-@VER@</executable>
     <version>
-      <external>${PREFIX}gnatls -v --version</external>
+      <external>${PREFIX}gnatls-@VER@ -v --version</external>
       <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
     </version>
     <languages>Ada</languages>
     <variable name="gcc_version">
-      <external>${PREFIX}gcc -v</external>
+      <external>${PREFIX}gcc-@VER@ -v</external>
       <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
     </variable>
     <runtimes default="default,kernel,native">
@@ -187,71 +187,11 @@
        <directory group="1" >\.\./$TARGET/lib/gnat/(.*)/adalib/</directory>
     </runtimes>
     <target>
-      <external>${PREFIX}gcc -dumpmachine</external>
+      <external>${PREFIX}gcc-@VER@ -dumpmachine</external>
       <grep regexp="[^\r\n]+"></grep>
     </target>
   </compiler_description>
 
-  <!--  CodePeer -->
-
-  <compiler_description>
-    <name>GNAT_CODEPEER</name>
-    <executable prefix="1">(.*codepeer-)gnatls</executable>
-    <version>
-      <external>${PREFIX}gnatls -v</external>
-      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
-    </version>
-    <languages>Ada</languages>
-    <variable name="gcc_version">
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
-    </variable>
-    <runtimes default="default,native">
-       <directory group="default" >\.\./lib/gcc/.*/$gcc_version/adalib/</directory>
-       <directory group="1" >\.\./lib/gnat/(.*)/adalib/</directory>
-       <directory group="1" >\.\./lib/gcc/.*/$gcc_version/rts-(.*)/adalib/</directory>
-    </runtimes>
-    <target>codepeer</target>
-  </compiler_description>
-
-  <!--  C Target -->
-
-  <compiler_description>
-    <name>GNAT_C</name>
-    <executable prefix="1">(c-)gnatls</executable>
-    <version>
-      <external>${PREFIX}gnatls -v</external>
-      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
-    </version>
-    <languages>Ada</languages>
-    <variable name="gcc_version">
-      <external>${PREFIX}gcc -v</external>
-      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
-    </variable>
-    <runtimes default="default">
-       <directory group="default" >\.\./libexec/gnat_ccg/lib/gcc/.*/$gcc_version/adalib/</directory>
-       <directory group="1" >\.\./lib/gnat/(.*)/adalib/</directory>
-    </runtimes>
-    <target>c</target>
-  </compiler_description>
-
-  <!--  GNAT_DOTNET -->
-
-  <compiler_description>
-    <name>GNAT_DOTNET</name>
-    <executable prefix="1">(.*dotnet-)gnatls</executable>
-    <version>
-      <external>${PREFIX}gnatls -v</external>
-      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
-    </version>
-    <languages>Ada</languages>
-    <runtimes default="default,kernel">
-       <directory group="default" >\.\./lib/dotgnat/adalib/</directory>
-       <directory group="1" >\.\./lib/dotgnat/rts-(.*)/adalib/</directory>
-    </runtimes>
-    <target>dotnet</target>
-  </compiler_description>
-
   <!--    G77  -->
   <compiler_description>
     <name>G77</name>
@@ -295,21 +295,6 @@
     </target>
   </compiler_description>
 
-  <!-- LLVM Compiler -->
-  <compiler_description>
-    <name>LLVM</name>
-    <executable>clang</executable>
-    <version>
-      <external>clang -v</external>
-      <grep regexp=".*(LLVM|clang) version ([0-9.]*)" group="2"></grep>
-    </version>
-    <languages>C</languages>
-    <target>
-      <external>clang -dumpmachine</external>
-      <grep regexp="[^\r\n]+"></grep>
-    </target>
-  </compiler_description>
-
   <!--  Windres compiler -->
   <compiler_description>
     <name>WINDRES</name>
--- a/share/gprconfig/gnat.xml	2018-10-17 18:38:35.547094541 +0200
+++ b/share/gprconfig/gnat.xml	2018-10-17 18:40:16.281379341 +0200
@@ -60,7 +60,7 @@
    &filter_gnat;
    <config>
    package Compiler is
-      for Driver                   ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc";
+      for Driver                   ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc-@VER@";
       for Language_Kind            ("Ada") use "unit_based";
       for Dependency_Kind          ("Ada") use "ALI_File";
       for Leading_Required_Switches        ("Ada") use
@@ -77,6 +77,9 @@
       for Objects_Path_File     ("Ada") use "ADA_PRJ_OBJECTS_FILE";
       for Driver         ("Ada") use
           "${GPRCONFIG_PREFIX}libexec/gprbuild/gprbind";
+      for Switches ("Ada") use ("--gnatbind_path=gnatbind-@VER@");
+      for Required_Switches ("Ada") use
+        Binder'Required_Switches ("Ada") &amp; ("--RTS=${RUNTIME_DIR(ada)}");
    end Binder;
 
    for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
--- a/share/gprconfig/c.xml	2018-10-17 21:31:44.442501471 +0200
+++ b/share/gprconfig/c.xml	2018-10-17 21:33:06.562088044 +0200
@@ -14,7 +14,7 @@
      </compilers>
      <config>
    package Compiler is
-      for Driver              ("C") use "${PATH(c)}${PREFIX(c)}gcc";
+      for Driver              ("C") use "${PATH(c)}${PREFIX(c)}gcc-@VER@";
    end Compiler;
      </config>
    </configuration>
--- a/share/gprconfig/linker.xml	2018-10-17 21:36:15.856883517 +0200
+++ b/share/gprconfig/linker.xml	2018-10-17 21:35:15.985896804 +0200
@@ -1025,7 +1025,7 @@
     </targets>
     <config>
    for Library_Partial_Linker use
-         ("${PATH(ada)}${PREFIX(ada)}gcc", "-nostdlib", "-Wl,-r", "-o");
+         ("${PATH(ada)}${PREFIX(ada)}gcc-@VER@", "-nostdlib", "-Wl,-r", "-no-pie", "-o");
     </config>
   </configuration>
 
@@ -1044,7 +1044,7 @@
     </targets>
     <config>
    for Library_Partial_Linker use
-         ("${PATH(c)}${PREFIX(c)}gcc", "-nostdlib", "-Wl,-r", "-o");
+         ("${PATH(c)}${PREFIX(c)}gcc-@VER@", "-nostdlib", "-Wl,-r", "-no-pie", "-o");
     </config>
   </configuration>
 
