Skip to content

Commit 931da81

Browse files
committed
Require gold on linux and freebsd by default.
This commit just changes the default to require gold. The user can still override from the command line if they choose to. The reason why I am making this change is to match Swift's behavior here. There really isn't any good reason to have separate linkers compiling separate parts of the same build. rdar://39456714
1 parent a539033 commit 931da81

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

configure

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def reconfigure(config, path):
7171
config.toolchain = Path(info['toolchain'])
7272
if 'linker' in info and info['linker'] is not None:
7373
config.linker = info['linker']
74+
elif config.target is not None:
75+
config.linker = config.target.linker
7476
if 'build_directory' in info and info['build_directory'] is not None:
7577
config.build_directory = Path(info['build_directory'])
7678
if 'intermediate_directory' in info and info['intermediate_directory'] is not None:
@@ -181,7 +183,10 @@ def main():
181183
config.swift_sdk = "/usr"
182184
config.toolchain = Path.path(args.toolchain)
183185
config.pkg_config = args.pkg_config
184-
config.linker = args.linker
186+
if args.linker is not None:
187+
config.linker = args.linker
188+
else:
189+
config.linker = config.target.linker
185190
config.bootstrap_directory = Path.path(args.bootstrap)
186191
config.verbose = args.verbose
187192
if config.toolchain is not None:

lib/target.py

+3
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,17 @@ class Target:
331331
dynamic_library_suffix = ".dylib"
332332
static_library_prefix = "lib"
333333
static_library_suffix = ".a"
334+
linker = None
334335

335336
def __init__(self, triple):
336337
if "linux" in triple:
337338
self.sdk = OSType.Linux
338339
self.dynamic_library_suffix = ".so"
340+
self.linker = "gold"
339341
elif "freebsd" in triple:
340342
self.sdk = OSType.FreeBSD
341343
self.dynamic_library_suffix = ".so"
344+
self.linker = "gold"
342345
elif "windows" in triple or "win32" in triple:
343346
self.sdk = OSType.Win32
344347
self.dynamic_library_suffix = ".dll"

0 commit comments

Comments
 (0)