package body MLib.Tgt.Specific is
- -- Non default subprogram. See comment in mlib-tgt.ads.
+ -- Non default subprogram. See comment in mlib-tgt.ads
procedure Build_Dynamic_Library
(Ofiles : Argument_List;
exception
when Constraint_Error =>
- Fail ("illegal version """, Lib_Version,
- """ (on VMS version must be a positive number)");
+ Fail ("illegal version """
+ & Lib_Version
+ & """ (on VMS version must be a positive number)");
return "";
end;
end if;
Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
if Gnatsym_Path = null then
- Fail (Gnatsym_Name, " not found in path");
+ Fail (Gnatsym_Name & " not found in path");
end if;
end if;
-- Create and write the auto-init assembly file
declare
- First_Line : constant String :=
- ASCII.HT & ".section LIB$INITIALIZE,GBL,NOWRT" &
- ASCII.LF;
- Second_Line : constant String :=
- ASCII.HT & ".long " & Init_Proc & ASCII.LF;
- -- First and second lines of the auto-init assembly file
+ use ASCII;
+
+ -- Output a dummy transfer address for debugging
+ -- followed by the LIB$INITIALIZE section.
+
+ Lines : constant String :=
+ HT & ".text" & LF &
+ HT & ".align 4" & LF &
+ HT & ".globl __main" & LF &
+ HT & ".ent __main" & LF &
+ "__main..en:" & LF &
+ HT & ".base $27" & LF &
+ HT & ".frame $29,0,$26,8" & LF &
+ HT & "ret $31,($26),1" & LF &
+ HT & ".link" & LF &
+ "__main:" & LF &
+ HT & ".pdesc __main..en,null" & LF &
+ HT & ".end __main" & LF & LF &
+ HT & ".section LIB$INITIALIZE,GBL,NOWRT" & LF &
+ HT & ".long " & Init_Proc & LF;
begin
Macro_File := Create_File (Macro_File_Name, Text);
if OK then
Len := Write
- (Macro_File, First_Line (First_Line'First)'Address,
- First_Line'Length);
- OK := Len = First_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Second_Line (Second_Line'First)'Address,
- Second_Line'Length);
- OK := Len = Second_Line'Length;
+ (Macro_File, Lines (Lines'First)'Address,
+ Lines'Length);
+ OK := Len = Lines'Length;
end if;
if OK then
end if;
if not OK then
- Fail ("creation of auto-init assembly file """,
- Macro_File_Name, """ failed");
+ Fail ("creation of auto-init assembly file """
+ & Macro_File_Name
+ & """ failed");
end if;
end;
mode (mode'First)'Address);
if Popen_Result = Null_Address then
- Fail ("assembly of auto-init assembly file """,
- Macro_File_Name, """ failed");
+ Fail ("assembly of auto-init assembly file """
+ & Macro_File_Name
+ & """ failed");
end if;
-- Wait for the end of execution of the macro-assembler
Pclose_Result := pclose (Popen_Result);
if Pclose_Result < 0 then
- Fail ("assembly of auto init assembly file """,
- Macro_File_Name, """ failed");
+ Fail ("assembly of auto init assembly file """
+ & Macro_File_Name
+ & """ failed");
end if;
-- Add the generated object file to the list of objects to be
Success => Success);
if not Success then
- Fail ("unable to create symbol file for library """,
- Lib_Filename, """");
+ Fail ("unable to create symbol file for library """
+ & Lib_Filename
+ & """");
end if;
Free (Arguments);