# DP: - in project files, use the exact Library_Version provided, if any, as
# DP:   the soname of libraries; do not strip minor version numbers
# DP:   (PR ada/40025).

Index: b/src/gcc/ada/mlib-tgt-specific-linux.adb
===================================================================
--- a/src/gcc/ada/mlib-tgt-specific-linux.adb
+++ b/src/gcc/ada/mlib-tgt-specific-linux.adb
@@ -50,6 +50,8 @@
 
    function Is_Archive_Ext (Ext : String) return Boolean;
 
+   function Library_Major_Minor_Id_Supported return Boolean;
+
    ---------------------------
    -- Build_Dynamic_Library --
    ---------------------------
@@ -142,7 +144,18 @@
       return Ext = ".a" or else Ext = ".so";
    end Is_Archive_Ext;
 
+   --------------------------------------
+   -- Library_Major_Minor_Id_Supported --
+   --------------------------------------
+
+   function Library_Major_Minor_Id_Supported return Boolean is
+   begin
+      return False;
+   end Library_Major_Minor_Id_Supported;
+
 begin
    Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
    Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+   Library_Major_Minor_Id_Supported_Ptr :=
+                                Library_Major_Minor_Id_Supported'Access;
 end MLib.Tgt.Specific;
Index: b/src/gcc/ada/mlib.adb
===================================================================
--- a/src/gcc/ada/mlib.adb
+++ b/src/gcc/ada/mlib.adb
@@ -31,6 +31,7 @@
 with Opt;
 with Output; use Output;
 
+with Mlib.Tgt;
 with MLib.Utl; use MLib.Utl;
 
 with Prj.Com;
@@ -384,7 +385,7 @@
    -- Major_Id_Name --
    -------------------
 
-   function Major_Id_Name
+   function Major_Id_Name_If_Supported
      (Lib_Filename : String;
       Lib_Version  : String)
       return String
@@ -438,6 +439,19 @@
       else
          return "";
       end if;
+   end Major_Id_Name_If_Supported;
+
+   function Major_Id_Name
+     (Lib_Filename : String;
+      Lib_Version  : String)
+      return String
+   is
+   begin
+      if Mlib.Tgt.Library_Major_Minor_Id_Supported then
+         return Major_Id_Name_If_Supported (Lib_Filename, Lib_Version);
+      else
+         return "";
+      end if;
    end Major_Id_Name;
 
 --  Package elaboration
