Skip to content

FreeBSD: Fix more compiler tests #83319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

etcwilde
Copy link
Member

Fixes:

  • cdecl_official_run.swift -- Clang on Linux defaults to the PIC relocation model, while on FreeBSD it defaults to static. Swift defaults to PIC everywhere. Passing -fPIC to clang to ensure that the built C object is compatible with the Swift object and avoid failing during the link.
  • cfuncs_parse.swift -- powl is a 128-bit long double on arm64 FreeBSD, which Swift does not have support for. Same issue as on Linux and Android. Once we have support, this part of the test should be re-enabled.

Disables:

  • distributed_actor_remoteCall_accessibleFunctions_crossModule.swift
  • distributed_actor_remoteCall_accessibleFucntions_crossModule_irgen.swift
    rpaths aren't set up correctly on these two tests and fail on Linux and FreeBSD in the same way. They should be re-enabled together.
  • profiling_marker_thunks.swift -- Looks like it only works on Apple platforms, disabling on FreeBSD like it is on all of the other platforms.
  • CollectionTransformers.swift -- Imports Darwin directly, which is only available on Apple platforms. There is a note that is several years old saying we should port it to all of the other platforms, but that is beyond the scope of bringing up the FreeBSD bot.
  • asan.swift -- This is the only one that is odd. I'm preemptively disabling it so that we don't cause a mess of CI. Created AArch64 FreeBSD: test/Sanitizers/asan/asan.swift hang #83318 to track fixing it.

etcwilde added 4 commits July 23, 2025 15:04
Like on 64-bit Android and arm64 Linux, arm64 FreeBSD uses 128 bit
long doubles, which is not supported by Swift resulting in powl to fail
to import and failing the test.

swiftlang#51573
ASAN hangs on aarch64 FreeBSD. Disabling until we have a chance to dig
through it.
Swift defaults to PIC everywhere. The Swift toolchain clang emits PIC
relocatable objects by default without passing `-fPIC` on Linux, so the
emitted Client.o is relocatable. This is not the case on FreeBSD, where
clang uses the static relocation model by default resulting in a link
failure due to mixing relocations with non-relocatable objects.

```
ld.lld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
```

Passing `-fPIC` where needed.
Disabling a few tests. The distributed tests are failing for the same
reason they fail on Linux, the rpaths and library search paths are
mucked up. Fixing that shouldn't be too hard, but should be enabled on
both platforms at once.

CollectiveTransformers doesn't work because it imports Darwin directly.
There is a note that is several years old saying that we should port the
test to the other platforms, but that is beyond the scope of this PR at
the moment.
@etcwilde etcwilde requested a review from xymus July 25, 2025 00:56
@etcwilde
Copy link
Member Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants