Skip to content

Commit 3631802

Browse files
committed
pick up logic to use ld.gold when available from experimental/foundation
1 parent c1afdcb commit 3631802

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ AC_ARG_WITH([swift-toolchain],
108108
AM_CONDITIONAL(HAVE_SWIFT, $have_swift)
109109
AC_SUBST([SWIFTC])
110110

111+
#
112+
# Enable use of gold linker when building the Swift overlay
113+
# to avoid a symbol relocation issue.
114+
# Ultimately the request to use gold should be passed in as an arg
115+
#
116+
AC_CHECK_PROG(use_gold_linker, ld.gold, true, false)
117+
AM_CONDITIONAL(USE_GOLD_LINKER, $use_gold_linker)
118+
111119
#
112120
# Enable __thread based TSD on platforms where it is efficient
113121
# Allow override based on command line argument to configure

src/Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ libdispatch_la_LDFLAGS+=-Wl,-compatibility_version,1 \
8383
-Wl,-alias_list,$(top_srcdir)/xcodeconfig/libdispatch.aliases
8484
endif
8585

86+
if USE_GOLD_LINKER
87+
libdispatch_la_LDFLAGS+=-Xcompiler -fuse-ld=gold
88+
endif
89+
8690
if USE_OBJC
8791
libdispatch_la_SOURCES+=block.cpp data.m object.m
8892
libdispatch_la_OBJCFLAGS=$(AM_OBJCFLAGS) -Wno-switch -fobjc-gc
@@ -159,12 +163,10 @@ $(abs_builddir)/swift/Dispatch.swiftmodule: $(SWIFT_ABS_SRC_FILES)
159163
$(SWIFTC_FLAGS) -module-cache-path $(top_builddir) -module-link-name dispatch \
160164
-o $@ -emit-module-doc-path $(@:%.swiftmodule=%.swiftdoc)
161165

162-
if HAVE_SWIFT
163166
swiftmoddir=${prefix}/lib/swift/linux/${build_cpu}
164167
swiftmod_HEADERS=\
165168
$(abs_builddir)/swift/Dispatch.swiftmodule \
166169
$(abs_builddir)/swift/Dispatch.swiftdoc
167-
endif
168170

169171
endif
170172

0 commit comments

Comments
 (0)