Skip to content

Commit f13ab5a

Browse files
authored
Fix LD_EXPORT_GLOBAL_SYMBOLS when using swiftc as the linker driver (#400)
1 parent 4e3b77e commit f13ab5a

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

Sources/SWBGenericUnixPlatform/Specs/UnixLd.xcspec

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@
145145
DefaultValue = YES;
146146
Condition = "NO";
147147
},
148+
{
149+
Name = "SWIFTC_LD_EXPORT_GLOBAL_SYMBOLS";
150+
Type = Boolean;
151+
DefaultValue = "$(LD_EXPORT_GLOBAL_SYMBOLS)";
152+
Condition = "$(LINKER_DRIVER) == swiftc";
153+
CommandLineArgs = {
154+
YES = (
155+
"-Xlinker", "--export-dynamic"
156+
);
157+
NO = ();
158+
};
159+
},
148160
{
149161
Name = "__INPUT_FILE_LIST_PATH__";
150162
Type = Path;

Sources/SWBUniversalPlatform/Specs/Ld.xcspec

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,24 @@
501501
Name = "LD_EXPORT_GLOBAL_SYMBOLS";
502502
Type = Boolean;
503503
DefaultValue = NO;
504+
},
505+
{
506+
Name = "SWIFTC_LD_EXPORT_GLOBAL_SYMBOLS";
507+
Type = Boolean;
508+
DefaultValue = "$(LD_EXPORT_GLOBAL_SYMBOLS)";
509+
Condition = "$(LINKER_DRIVER) == swiftc";
510+
CommandLineArgs = {
511+
YES = (
512+
"-Xlinker", "-export_dynamic"
513+
);
514+
NO = ();
515+
};
516+
},
517+
{
518+
Name = "CLANG_LD_EXPORT_GLOBAL_SYMBOLS";
519+
Type = Boolean;
520+
DefaultValue = "$(LD_EXPORT_GLOBAL_SYMBOLS)";
521+
Condition = "$(LINKER_DRIVER) == clang";
504522
CommandLineArgs = {
505523
YES = (
506524
"-rdynamic",

Sources/SWBWindowsPlatform/Specs/WindowsLd.xcspec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@
160160
DefaultValue = YES;
161161
Condition = "NO";
162162
},
163+
{
164+
Name = "SWIFTC_LD_EXPORT_GLOBAL_SYMBOLS";
165+
Type = Boolean;
166+
Condition = NO;
167+
CommandLineArgs = ();
168+
},
163169
{
164170
Name = "__INPUT_FILE_LIST_PATH__";
165171
Type = Path;

0 commit comments

Comments
 (0)