You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using the following command to build a Swift package for fuzzing before:
swift build -c debug -Xswiftc -sanitize=fuzzer,address -Xswiftc -parse-as-library
After updating to Xcode 15 this no longer works with the following error:
Building for debugging...
error: link command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture arm64:
"_Fuzz_main", referenced from:
_main in command-line-aliases-file
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[6/8] Linking Fuzz
I've tried 5.10-DEVELOPMENT-SNAPSHOT-2023-12-21-a and 6.0-DEVELOPMENT-SNAPSHOT-2024-08-08-a Swift builds.
If I switch to Xcode 14, which is a bit of a pain, since it's no longer supported on macOS 14, then everything works just fine again:
> swift build -c debug -Xswiftc -sanitize=fuzzer,address -Xswiftc -parse-as-library
Building for debugging...
ld: warning: undefined base symbol '_Fuzz_main' for alias '_main'
/Users/name/Documents/Fuzzing/.build/arm64-apple-macosx/debug/Fuzz: replacing existing signature
[6/6] Applying Fuzz
Build complete! (12.94s)
Any chance of this getting some more attention? https://www.swift.org/support/security.html sites the oss-fuzz testing for multiple fixes, so it seems like fuzz support is somewhat importing to Swift.
So looking at the verbose output from the swift build command, it looks like this linker error is down to the build process attempting to alias main. See the following (final) compile command:
Uh oh!
There was an error while loading. Please reload this page.
Description
I was using the following command to build a Swift package for fuzzing before:
After updating to Xcode 15 this no longer works with the following error:
I've tried
5.10-DEVELOPMENT-SNAPSHOT-2023-12-21-a
and6.0-DEVELOPMENT-SNAPSHOT-2024-08-08-a
Swift builds.If I switch to Xcode 14, which is a bit of a pain, since it's no longer supported on macOS 14, then everything works just fine again:
Reproduction
Download the latest Swift snapshot from https://www.swift.org/download/#snapshots Version 5 or 6, doesn't matter.
Create an empty SPM project with the following
Package.swift
:and
main.swift
:Whole package: FuzzingSample.zip
Select the required Swift version using swiftenv, like:
swiftenv local 5.10-DEVELOPMENT-SNAPSHOT-2023-12-21-a
Run:
Expected behavior
An ability to fuzz Swift code using libFuzzer.
Environment
Apple Swift version 5.10-dev (LLVM e8e5be8d5b39f46, Swift 935dc3eae905669)
Target: arm64-apple-macosx14.0
Xcode 15.4 (15F31d)
macOS 14.5 (23F79)
Additional information
No response
The text was updated successfully, but these errors were encountered: