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
Somewhere in the last few releases of Swift, SwiftPM can no longer build the kind of executable that Swift's libfuzzer integration needs.
Previously to build a fuzzer with SwiftPM one would create a Package.swift that defined an executable product and target for the fuzzer. This executable target would not contain a main.swift file, as libFuzzer wants to provide its own main symbol. Instead, it would contain a different file that contained the symbol LLVMFuzzOneInput.
To build this with SwiftPM, you'd pass -Xswiftc -sanitize=fuzzer -Xswiftc -parse-as-library. SwiftPM would trust you, try to build the executable, and find that the linker was happy due to libfuzzer providing the main symbol.
This no longer works: SwiftPM aborts early, by spotting that there is no main.swift file in the executable target. We should address this to re-enable libfuzzer support in SwiftPM.
The text was updated successfully, but these errors were encountered:
Interesting that this ever worked. You’re effectively on your own when you use -X* escape hatch so this can’t be considered a bug. I’d instead turn this bug into adding real support for libFuzzer in SwiftPM (or maybe we already have one).
Environment
Swift 5.2.4, Ubuntu 20.04.
Additional Detail from JIRA
md5: 1628e01c9e53e190c7b97a3890151108
Issue Description:
Somewhere in the last few releases of Swift, SwiftPM can no longer build the kind of executable that Swift's libfuzzer integration needs.
Previously to build a fuzzer with SwiftPM one would create a Package.swift that defined an executable product and target for the fuzzer. This executable target would not contain a
main.swift
file, as libFuzzer wants to provide its own main symbol. Instead, it would contain a different file that contained the symbolLLVMFuzzOneInput
.To build this with SwiftPM, you'd pass
-Xswiftc -sanitize=fuzzer -Xswiftc -parse-as-library
. SwiftPM would trust you, try to build the executable, and find that the linker was happy due to libfuzzer providing the main symbol.This no longer works: SwiftPM aborts early, by spotting that there is no
main.swift
file in the executable target. We should address this to re-enable libfuzzer support in SwiftPM.The text was updated successfully, but these errors were encountered: