Skip to content

Commit f7cfa9b

Browse files
asarhaddonTurboGit
authored andcommitted
Move LDFLAGS in linker command line before -l library options.
Options like --as-needed only affect following libraries, so --as-needed currently has no effect in Library_Options. Leading_Options exists exactly for this.
1 parent 7b68b41 commit f7cfa9b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

templates_parser.gpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ library project Templates_Parser is
3232

3333
case TP_Shared.Library_Type is
3434
when "relocatable" =>
35-
for Library_Options use TP_Shared.Ldflags;
35+
-- Put options like --as-needed before options like -l.
36+
for Leading_Library_Options use TP_Shared.Ldflags;
3637
when others =>
3738
null;
3839
end case;

tp_shared.gpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ abstract project TP_Shared is
8989
------------
9090

9191
package Linker is
92-
for Default_Switches ("Ada") use Ldflags;
92+
-- Put options like --as-needed before options like -l.
93+
for Leading_Switches ("Ada") use Ldflags;
9394
end Linker;
9495

9596
---------

0 commit comments

Comments
 (0)