Skip to content

Commit

Permalink
Require gold on linux and freebsd by default.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gottesmm committed Apr 25, 2018
1 parent a02eec7 commit e6e35e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configure
Expand Up @@ -71,6 +71,8 @@ def reconfigure(config, path):
config.toolchain = Path(info['toolchain'])
if 'linker' in info and info['linker'] is not None:
config.linker = info['linker']
elif config.target is not None:
config.linker = config.target.linker
if 'build_directory' in info and info['build_directory'] is not None:
config.build_directory = Path(info['build_directory'])
if 'intermediate_directory' in info and info['intermediate_directory'] is not None:
Expand Down Expand Up @@ -181,7 +183,10 @@ def main():
config.swift_sdk = "/usr"
config.toolchain = Path.path(args.toolchain)
config.pkg_config = args.pkg_config
config.linker = args.linker
if args.linker is not None:
config.linker = args.linker
else:
config.linker = config.target.linker
config.bootstrap_directory = Path.path(args.bootstrap)
config.verbose = args.verbose
if config.toolchain is not None:
Expand Down
3 changes: 3 additions & 0 deletions lib/target.py
Expand Up @@ -331,14 +331,17 @@ class Target:
dynamic_library_suffix = ".dylib"
static_library_prefix = "lib"
static_library_suffix = ".a"
linker = None

def __init__(self, triple):
if "linux" in triple:
self.sdk = OSType.Linux
self.dynamic_library_suffix = ".so"
self.linker = "gold"
elif "freebsd" in triple:
self.sdk = OSType.FreeBSD
self.dynamic_library_suffix = ".so"
self.linker = "gold"
elif "windows" in triple or "win32" in triple:
self.sdk = OSType.Win32
self.dynamic_library_suffix = ".dll"
Expand Down

0 comments on commit e6e35e1

Please sign in to comment.