Skip to content

Commit eb7b5b5

Browse files
authored
Merge pull request #1535 from gottesmm/swift-4.1-branch_rdar39456714
Require gold on linux and freebsd by default.
2 parents cd9ec0d + e6e35e1 commit eb7b5b5

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

configure

Lines changed: 6 additions & 1 deletion
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/script.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ def generate_products(self):
142142
if Configuration.current.bootstrap_directory is not None:
143143
ld_flags += """ -L${TARGET_BOOTSTRAP_DIR}/usr/lib"""
144144

145+
if Configuration.current.build_mode == Configuration.Debug:
146+
ld_flags += """ -rpath ${SDKROOT}/lib/swift/""" + Configuration.current.target.swift_sdk_name + """ """
147+
145148
if Configuration.current.linker is not None:
146149
ld_flags += " -fuse-ld=" + Configuration.current.linker
147150

lib/target.py

Lines changed: 3 additions & 0 deletions
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)