Skip to content

Require gold on linux and freebsd by default. #1533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion configure
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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