Only bring over supporting change of generate_linux_toolchain_file() from fcc03898c,

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);"
This commit is contained in:
Finagolfin
2025-08-02 19:42:34 +05:30
parent 7f09af24cf
commit 9c7ae5025f

View File

@@ -389,7 +389,7 @@ class Product(object):
sysroot_arch, vendor, abi = self.get_linux_target_components(arch)
return '{}-{}-linux-{}'.format(sysroot_arch, vendor, abi)
def generate_linux_toolchain_file(self, platform, arch):
def generate_linux_toolchain_file(self, platform, arch, crosscompiling=True):
"""
Generates a new CMake tolchain file that specifies Linux as a target
platform.
@@ -402,8 +402,9 @@ class Product(object):
toolchain_args = {}
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
if crosscompiling:
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
# We only set the actual sysroot if we are actually cross
# compiling. This is important since otherwise cmake seems to change the