Skip to content

Commit 8aeb9b2

Browse files
committed
Only bring over supporting change of generate_linux_toolchain_file() from fcc0389,
specifically the change that makes the following possible on linux: "* under Linux, do not cross compile LLVM when building for the host architecture -- that will ensure that the compiler-rt build will use the just built compiler and not the system one (which may not be new enough for this purpose);"
1 parent 4e53cb5 commit 8aeb9b2

File tree

1 file changed

+4
-3
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+4
-3
lines changed

utils/swift_build_support/swift_build_support/products/product.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def get_linux_target(self, platform, arch):
389389
sysroot_arch, vendor, abi = self.get_linux_target_components(arch)
390390
return '{}-{}-linux-{}'.format(sysroot_arch, vendor, abi)
391391

392-
def generate_linux_toolchain_file(self, platform, arch):
392+
def generate_linux_toolchain_file(self, platform, arch, crosscompiling=True):
393393
"""
394394
Generates a new CMake tolchain file that specifies Linux as a target
395395
platform.
@@ -402,8 +402,9 @@ def generate_linux_toolchain_file(self, platform, arch):
402402

403403
toolchain_args = {}
404404

405-
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
406-
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
405+
if crosscompiling:
406+
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
407+
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
407408

408409
# We only set the actual sysroot if we are actually cross
409410
# compiling. This is important since otherwise cmake seems to change the

0 commit comments

Comments
 (0)