I was trying out using LLVM to target the PS2, which uses a mostly normal MIPS CPU just with a weird FPU. I got a hello world working with Zig, and I don't believe Swift object files would be any different — except for the standard library which isn't bundled for the target, preventing compilation in the first place.
I believe I tried it and asked about it in the past but didn't get anywhere. How do I compile the standard library for my target? The toolchain includes a bunch of targets, so it clearly defines them somewhere, but I couldn't find where. Some scripts seemed to have comments related to supporting building the library with CMake but I don't believe it was implemented.
If you decide to add this port, I suggest you grep the stdlib/ directory for platforms like linux and Android and architectures like arm64 or x86_64 to see what platform-specific code there is already in the current source. That will give you an idea of the work required to add a new platform.
I don't think I've ever been able to get the build script to work.
CMake Warning (dev) at CMakeLists.txt:46 (enable_language):
project() should be called prior to this enable_language() call.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at CMakeLists.txt:47 (enable_language):
project() should be called prior to this enable_language() call.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:68 (enable_language):
project() should be called prior to this enable_language() call.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The ASM compiler identification is AppleClang
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CMake Error at CMakeLists.txt:91 (include):
include could not find requested file:
SwiftUtils
CMake Error at CMakeLists.txt:96 (include):
include could not find requested file:
SwiftCompilerCapability
CMake Warning (dev) at CMakeLists.txt:108 (enable_language):
project() should be called prior to this enable_language() call.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The Swift compiler identification is Apple 6.0.3
-- Check for working Swift compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
-- Check for working Swift compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc - works
CMake Error at CMakeLists.txt:329 (include):
include could not find requested file:
/Users/teampuzel/OpenSource/swift-project/swift/cmake/SwiftVersion.cmake
CMake Error at CMakeLists.txt:446 (is_build_type_optimized):
Unknown CMake command "is_build_type_optimized".
Not sure what it's doing and why it's even using the Xcode toolchain.
This also happens when just trying to build the entire toolchain normally. This build script is extremely fragile, I am on latest macOS and it still doesn't work with the most basic commands.