Skip to content

Conversation

@etcwilde
Copy link
Member

Adding a preset for building the FreeBSD toolchain and runtime package. This is very similar to the Linux package build, but the main difference is the lack of WASM build. The WASM runtime build system uses GNU extensions in its makefiles that are not compatible with the make or gmake on FreeBSD and therefore cannot be built there.

Adding a preset for building the FreeBSD toolchain and runtime package.
This is very similar to the Linux package build, but the main difference
is the lack of WASM build. The WASM runtime build system uses GNU
extensions in its makefiles that are not compatible with the make or
gmake on FreeBSD and therefore cannot be built there.
@etcwilde etcwilde requested a review from shahmishal July 17, 2025 22:19
@etcwilde
Copy link
Member Author

@swift-ci please smoke test

@etcwilde
Copy link
Member Author

preset=freebsd_package
@swift-ci Please test with preset Linux Platform

@etcwilde etcwilde added the FreeBSD Platform: FreeBSD label Jul 17, 2025
@etcwilde etcwilde self-assigned this Jul 17, 2025
@etcwilde etcwilde moved this to In Progress in Swift on FreeBSD Jul 17, 2025
@etcwilde
Copy link
Member Author

The preset test failure is:

[2025-07-17T23:17:57.960Z] /usr/bin/ld: /tmp/lit-tmp-_jhxz0v8/Library-db3eab.o: relocation R_X86_64_PC32 against protected symbol `$s7Library17UnavailableStructVMa' can not be used when making a shared object
[2025-07-17T23:17:57.960Z] /usr/bin/ld: final link failed: bad value
[2025-07-17T23:17:57.960Z] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[2025-07-17T23:17:57.960Z] <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

This is because the bfd linker that the preset is defaulting to on Ubuntu 20.04 is too old to support the relocations that Swift emits. This preset is not intended to run on Linux (though it should work on newer versions of bfd or versions that default /usr/bin/ld to lld), but on FreeBSD, which uses lld as the default linker.

@etcwilde etcwilde merged commit b97df26 into swiftlang:main Jul 18, 2025
3 of 4 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Swift on FreeBSD Jul 18, 2025
@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Aug 15, 2025

The WASM runtime build system uses GNU extensions in its makefiles that are not compatible with the make or gmake on FreeBSD and therefore cannot be built there.

@etcwilde I suspect you're referring to WASI-libc and not Wasm runtimes? Since the only Wasm runtime we're currently using (WasmKit) is built with SwiftPM, not make. WASI-libc is indeed built with makefiles, but that shouldn't preclude enabling the Wasm backend in LLVM, Clang, and corollary Swift. Similarly, I expect that WasmKit can be also built assuming working SwiftPM (or CMake after #83755 is merged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FreeBSD Platform: FreeBSD

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants