Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 160427 Details for
Bug 143226
ada bindings to Qt
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch for gprbuild (incremental linking of shared libraries)
incremental-shared-library-linking-1.patch (text/plain), 10.88 KB, created by
Vadim Godunko
on 2008-07-15 10:38:07 UTC
(
hide
)
Description:
patch for gprbuild (incremental linking of shared libraries)
Filename:
MIME Type:
Creator:
Vadim Godunko
Created:
2008-07-15 10:38:07 UTC
Size:
10.88 KB
patch
obsolete
>diff -ur /home/vadik/tmp/gprbuild-1.2.0w-src/share/gprconfig/linker.xml ./share/gprconfig/linker.xml >--- /home/vadik/tmp/gprbuild-1.2.0w-src/share/gprconfig/linker.xml 2008-04-02 21:03:16.000000000 +0400 >+++ ./share/gprconfig/linker.xml 2008-07-13 17:10:14.742556471 +0400 >@@ -245,6 +245,7 @@ > for Library_Version_Switches use ("-Wl,-soname,"); > for Shared_Library_Suffix use ".dll"; > for Library_Auto_Init_Supported use "true"; >+ for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o"); > </config> > </configuration> > >diff -ur /home/vadik/tmp/gprbuild-1.2.0w-src/src/buildgpr.adb ./src/buildgpr.adb >--- /home/vadik/tmp/gprbuild-1.2.0w-src/src/buildgpr.adb 2008-05-22 08:31:41.000000000 +0400 >+++ ./src/buildgpr.adb 2008-07-14 11:29:29.121246498 +0400 >@@ -4044,6 +4044,26 @@ > (Library_Projs.Table (J)).Library_Name)); > end loop; > end if; >+ >+ if Data.Config.Lib_Partial_Linker /= No_Name_List then >+ Put_Line (Exchange_File, Library_Label (Partial_Linker)); >+ >+ declare >+ List : Name_List_Index := >+ Data.Config.Lib_Partial_Linker; >+ Nam_Nod : Name_Node; >+ >+ begin >+ while List /= No_Name_List loop >+ Nam_Nod := Project_Tree.Name_Lists.Table (List); >+ Put_Line (Get_Name_String (Nam_Nod.Name)); >+ Put_Line >+ (Exchange_File, >+ Get_Name_String (Nam_Nod.Name)); >+ List := Nam_Nod.Next; >+ end loop; >+ end; >+ end if; > end if; > > Put_Line (Exchange_File, Library_Label (Dependency_Files)); >diff -ur /home/vadik/tmp/gprbuild-1.2.0w-src/src/gprlib-build_shared_lib-nosymbols.adb ./src/gprlib-build_shared_lib-nosymbols.adb >--- /home/vadik/tmp/gprbuild-1.2.0w-src/src/gprlib-build_shared_lib-nosymbols.adb 2008-05-22 08:31:44.000000000 +0400 >+++ ./src/gprlib-build_shared_lib-nosymbols.adb 2008-07-14 11:25:12.610705994 +0400 >@@ -61,6 +61,16 @@ > ----------- > > procedure Build (Output_File : String) is >+ >+ procedure Try_Link; >+ -- Trying to link shared library. If the resulting command line is too >+ -- long then returns True in Too_Loog and don't actually link shared >+ -- library. If Increment is not a zero then also include corresponding >+ -- increment object file. >+ >+ procedure Do_Increment; >+ -- Makes incremental object file. >+ > Success : Boolean; > > Out_Opt : constant String_Access := new String'("-o"); >@@ -68,88 +78,222 @@ > > Driver : String_Access; > >- begin >- -- Get the executable to use, either the specified Driver, or "gcc" >+ First_Object : Natural := Ofiles'First; >+ Increment : Natural := 0; >+ Too_Long : Boolean; >+ >+ ------------------ >+ -- Do_Increment -- >+ ------------------ >+ >+ procedure Do_Increment is >+ Old_Image : constant String := Integer'Image (Increment); >+ New_Image : constant String := Integer'Image (Increment + 1); >+ Size : Natural := Partial_Linker_Path'Length + 1; >+ New_Object : String_Access; >+ Old_Object : String_Access; > >- if Driver_Name = No_Name then >- Driver := Locate_Exec_On_Path (Gcc_Name); >+ begin >+ Increment := Increment + 1; > >- if Driver = null then >- Osint.Fail (Gcc_Name, " not found in path"); >+ if Increment > 1 then >+ Old_Object := >+ new String' >+ (Output_File >+ & Old_Image (Old_Image'First + 1 .. Old_Image'Last) >+ & Object_Suffix); > end if; > >- else >- Driver := Locate_Exec_On_Path (Get_Name_String (Driver_Name)); >- >- if Driver = null then >- Osint.Fail (Get_Name_String (Driver_Name), " not found in path"); >+ if Increment /= 0 then >+ New_Object := >+ new String' >+ (Output_File >+ & New_Image (New_Image'First + 1 .. New_Image'Last) >+ & Object_Suffix); > end if; >- end if; > >- Last_Arg := 0; >+ Last_Arg := 0; > >- -- The minimum arguments >+ for J in 1 .. Last_PL_Option loop >+ Add_Arg (PL_Options (J)); >+ Size := Size + PL_Options (J)'Length + 1; >+ end loop; > >- for J in 1 .. Shared_Lib_Minimum_Options.Last loop >- Add_Arg (Shared_Lib_Minimum_Options.Table (J)); >- end loop; >+ Add_Arg (New_Object); >+ Size := Size + New_Object'Length + 1; > >- -- -o <library file name> >+ if Old_Object /= null then >+ Add_Arg (Old_Object); >+ Size := Size + Old_Object'Length + 1; >+ end if; > >- Add_Arg (Out_Opt); >- Add_Arg (Out_V); >+ for J in First_Object .. Ofiles'Last loop >+ Size := Size + Ofiles (J)'Length + 1; >+ exit when Size > Maximum_Size; > >- -- The object files >+ Add_Arg (Ofiles (J)); >+ First_Object := First_Object + 1; >+ end loop; > >- for J in Ofiles'Range loop >- Add_Arg (Ofiles (J)); >- end loop; >+ -- Display command if not in quiet mode > >- -- The options >+ if not Opt.Quiet_Output then >+ Write_Str (Partial_Linker_Path.all); > >- for J in Options'Range loop >- if Options (J) /= null and then Options (J).all /= "" then >- Add_Arg (Options (J)); >+ for J in 1 .. Last_Arg loop >+ Write_Char (' '); >+ Write_Str (Arguments (J).all); >+ end loop; >+ >+ Write_Eol; > end if; >- end loop; > >- -- Other options >+ -- Finally spawn the library builder driver > >- for J in 1 .. Library_Version_Options.Last loop >- if Library_Version_Options.Table (J).all /= "" then >- Add_Arg (Library_Version_Options.Table (J)); >+ Spawn (Partial_Linker_Path.all, Arguments (1 .. Last_Arg), Success); >+ >+ if not Success then >+ Osint.Fail (Partial_Linker.all, " execution error"); > end if; >- end loop; >+ end Do_Increment; > >- for J in 1 .. Library_Options_Table.Last loop >- Add_Arg (Library_Options_Table.Table (J)); >- end loop; >+ -------------- >+ -- Try_Link -- >+ -------------- >+ >+ procedure Try_Link is >+ Image : constant String := Integer'Image (Increment); >+ Size : Natural := Driver'Length + 1; >+ Increment_Object : String_Access; >+ >+ begin >+ if Increment /= 0 then >+ Increment_Object := >+ new String' >+ (Output_File >+ & Image (Image'First + 1 .. Image'Last) >+ & Object_Suffix); >+ end if; > >- -- Display command if not in quiet mode >+ Last_Arg := 0; > >- if not Opt.Quiet_Output then >- Write_Str (Driver.all); >+ -- The minimum arguments > >- for J in 1 .. Last_Arg loop >- Write_Char (' '); >- Write_Str (Arguments (J).all); >+ for J in 1 .. Shared_Lib_Minimum_Options.Last loop >+ Add_Arg (Shared_Lib_Minimum_Options.Table (J)); >+ Size := Size + Shared_Lib_Minimum_Options.Table (J)'Length + 1; > end loop; > >- Write_Eol; >- end if; >+ -- -o <library file name> > >- -- Finally spawn the library builder driver >+ Add_Arg (Out_Opt); >+ Size := Size + Out_Opt'Length + 1; >+ Add_Arg (Out_V); >+ Size := Size + Out_V'Length + 1; >+ >+ -- The object files >+ >+ if Increment_Object /= null then >+ Add_Arg (Increment_Object); >+ Size := Size + Increment_Object'Length; >+ end if; >+ >+ for J in First_Object .. Ofiles'Last loop >+ Add_Arg (Ofiles (J)); >+ Size := Size + Ofiles (J)'Length + 1; >+ end loop; > >- Spawn (Driver.all, Arguments (1 .. Last_Arg), Success); >+ -- The options > >- if not Success then >- if Driver_Name = No_Name then >- Osint.Fail (Gcc_Name, " execution error"); >+ for J in Options'Range loop >+ if Options (J) /= null and then Options (J).all /= "" then >+ Add_Arg (Options (J)); >+ Size := Size + Options (J)'Length + 1; >+ end if; >+ end loop; >+ >+ -- Other options >+ >+ for J in 1 .. Library_Version_Options.Last loop >+ if Library_Version_Options.Table (J).all /= "" then >+ Add_Arg (Library_Version_Options.Table (J)); >+ Size := Size + Library_Version_Options.Table (J)'Length + 1; >+ end if; >+ end loop; >+ >+ for J in 1 .. Library_Options_Table.Last loop >+ Add_Arg (Library_Options_Table.Table (J)); >+ Size := Size + Library_Options_Table.Table (J)'Length + 1; >+ end loop; >+ >+ if Size > Maximum_Size then >+ Too_Long := True; > > else >- Osint.Fail (Get_Name_String (Driver_Name), " execution error"); >+ Too_Long := False; >+ >+ -- Display command if not in quiet mode >+ >+ if not Opt.Quiet_Output then >+ Write_Str (Driver.all); >+ >+ for J in 1 .. Last_Arg loop >+ Write_Char (' '); >+ Write_Str (Arguments (J).all); >+ end loop; >+ >+ Write_Eol; >+ end if; >+ >+ -- Finally spawn the library builder driver >+ >+ Spawn (Driver.all, Arguments (1 .. Last_Arg), Success); >+ >+ if not Success then >+ if Driver_Name = No_Name then >+ Osint.Fail (Gcc_Name, " execution error"); >+ >+ else >+ Osint.Fail >+ (Get_Name_String (Driver_Name), " execution error"); >+ end if; >+ end if; >+ end if; >+ end Try_Link; >+ >+ begin >+ -- Get the executable to use, either the specified Driver, or "gcc" >+ >+ if Driver_Name = No_Name then >+ Driver := Locate_Exec_On_Path (Gcc_Name); >+ >+ if Driver = null then >+ Osint.Fail (Gcc_Name, " not found in path"); >+ end if; >+ >+ else >+ Driver := Locate_Exec_On_Path (Get_Name_String (Driver_Name)); >+ >+ if Driver = null then >+ Osint.Fail (Get_Name_String (Driver_Name), " not found in path"); >+ end if; >+ end if; >+ >+ if Partial_Linker /= null then >+ Partial_Linker_Path := Locate_Exec_On_Path (Partial_Linker.all); >+ >+ if Partial_Linker_Path = null then >+ Osint.Fail ("unable to locate ", Partial_Linker.all); > end if; > end if; >+ >+ loop >+ Try_Link; >+ >+ exit when not Too_Long; >+ >+ Do_Increment; >+ end loop; > end Build; > > -- Start of processing for Build_Shared_Lib
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 143226
:
129865
|
129867
|
129940
|
138287
|
158361
|
158373
| 160427 |
160429