[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Conflicting architectures in Swift build



Dear Mentors,

I am working to package the Swift programming language (swiftlang) and
am having some trouble with the Swift build process and how it is
detecting the architecture of my computer and am uncertain of the best
way to proceed.

Building Swift involves building other bundled tools such as llvm and
ninja. Some of these other builds appear to use config.guess and come
up with x86_64-pc-linux-gnu for the host achitecture, but the main
Swift build uses its own architecture selection mechanism in its cmake
files:

if("${prefix}" STREQUAL "LINUX")
    if(arch MATCHES "(armv6|armv7)")
        set(SWIFT_SDK_LINUX_ARCH_${arch}_TRIPLE "${arch}-unknown-linux-
gnueabihf")
    elseif(arch MATCHES
"(aarch64|i686|powerpc64|powerpc64le|s390x|x86_64)")
        set(SWIFT_SDK_LINUX_ARCH_${arch}_TRIPLE "${arch}-unknown-linux-
gnu")
    else()
        message(FATAL_ERROR "unknown arch for ${prefix}: ${arch}")
endif()


This is causing parts of the Swift build to select x86_64-unknown-
linux-gnu instead of x86_64-pc-linux-gnu. The net result being that
during validation of the build swiftc cannot find the modules it needs
as they now have different names than what it expects (x86_64-unknown-
linux-gnu.swiftmodule instead of x86_64-pc-linux-gnu.swiftmodule).

How should I resolve this? I could patch the cmake file to cause it to
better align with config.guess and submit a patch to upstream. Is there
a better way?

Thanks
-Steve


Reply to: