Skip to content
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

Require gold on linux and freebsd by default. #1535

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/script.py
Expand Up @@ -142,6 +142,9 @@ def generate_products(self):
if Configuration.current.bootstrap_directory is not None:
ld_flags += """ -L${TARGET_BOOTSTRAP_DIR}/usr/lib"""

if Configuration.current.build_mode == Configuration.Debug:
ld_flags += """ -rpath ${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """

if Configuration.current.linker is not None:
ld_flags += " -fuse-ld=" + Configuration.current.linker

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