From ed4fab8445801941feb37f04d501589b963b5cea Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Thu, 24 Oct 2024 21:49:01 +0200 Subject: [PATCH] build-script: Build core foundation tests without debug info to workaround a linker crash On amazon-linux2 the gold linker (version 1.14) crashes when linking debug info. rdar://138562663 --- .../swift_build_support/products/foundationtests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/swift_build_support/swift_build_support/products/foundationtests.py b/utils/swift_build_support/swift_build_support/products/foundationtests.py index 1b68a09243733..292572625990e 100644 --- a/utils/swift_build_support/swift_build_support/products/foundationtests.py +++ b/utils/swift_build_support/swift_build_support/products/foundationtests.py @@ -78,6 +78,13 @@ def test(self, host_target): ] if self.args.verbose_build: cmd.append('--verbose') + + # On amazon-linux2 the gold linker (version 1.14) crashes when linking + # debug info. Workaround this issue by building without debug info. + # rdar://137760869 + if host_target.startswith('linux'): + cmd += ['-Xswiftc', '-gnone'] + shell.call(cmd, env={ 'SWIFTCI_USE_LOCAL_DEPS': '1', 'DISPATCH_INCLUDE_PATH': include_path