@@ -1552,41 +1552,14 @@ package body Gnatcheck.Compiler is
15521552 -- ------------------------------
15531553
15541554 function Should_Use_Codepeer_Target return Boolean is
1555+ Regular_Gnatls : String_Access := Locate_Exec_On_Path (" gnatls" );
15551556 begin
1556- -- If an explicit toolchain has been provided to the tool (through the
1557- -- CLI, the project file of the config file), we need to never fallback
1558- -- to the codepeer target.
1559- if Gnatcheck_Prj.Tree.Is_Defined
1560- and then Gnatcheck_Prj.Tree.Has_Explicit_Target
1561- then
1562- return
1563- Ada.Strings.Unbounded." =" (Target, " codepeer" )
1564- or else Ada.Strings.Unbounded." =" (Target, " gnatsas" );
1565- end if ;
1566-
15671557 -- If we could find a regular gnatls, it means there is a native
15681558 -- toolchain, that takes precedence over a potential codepeer toolchain.
1569- declare
1570- Regular_Gnatls : String_Access := Locate_Exec_On_Path (" gnatls" );
1571- begin
1572- if Regular_Gnatls /= null then
1573- Free (Regular_Gnatls);
1574- return False;
1575- else
1576- declare
1577- Regular_Gprbuild : String_Access :=
1578- Locate_Exec_On_Path (" gprbuild" );
1579- begin
1580- -- If we could find a regular "gprbuild", it means there is a
1581- -- cross toolchain available, thus we don't want to fallback on
1582- -- the codepeer target
1583- if Regular_Gprbuild /= null then
1584- Free (Regular_Gprbuild);
1585- return False;
1586- end if ;
1587- end ;
1588- end if ;
1589- end ;
1559+ if Regular_Gnatls /= null then
1560+ Free (Regular_Gnatls);
1561+ return False;
1562+ end if ;
15901563
15911564 -- If we couldn't, look for a codepeer toolchain.
15921565 declare
@@ -1715,7 +1688,7 @@ package body Gnatcheck.Compiler is
17151688 Args (Num_Args) := new String'(" --target=" & To_String (Target));
17161689 elsif Should_Use_Codepeer_Target then
17171690 Num_Args := @ + 1 ;
1718- Args (Num_Args) := new String'(" --target=gnatsas " );
1691+ Args (Num_Args) := new String'(" --target=codepeer " );
17191692 end if ;
17201693 else
17211694 -- Target and runtime will be taken from config project anyway
@@ -1860,12 +1833,9 @@ package body Gnatcheck.Compiler is
18601833 Args (8 ) := new String'(" --restricted-to-languages=ada" );
18611834 Num_Args := 8 ;
18621835
1863- Num_Args := @ + 1 ;
18641836 if Should_Use_Codepeer_Target then
1865- Args (Num_Args) := new String'(" --target=gnatsas" );
1866- else
1867- Args (Num_Args) :=
1868- new String'(" --target=" & Ada.Strings.Unbounded.To_String (Target));
1837+ Num_Args := @ + 1 ;
1838+ Args (Num_Args) := new String'(" --target=codepeer" );
18691839 end if ;
18701840
18711841 if Arg.Jobs.Get > 1 then
0 commit comments