Skip to content
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

[SR-13257] SwiftPM no longer works with libFuzzer #4522

Open
Lukasa opened this issue Jul 20, 2020 · 2 comments
Open

[SR-13257] SwiftPM no longer works with libFuzzer #4522

Lukasa opened this issue Jul 20, 2020 · 2 comments
Labels

Comments

@Lukasa
Copy link
Contributor

Lukasa commented Jul 20, 2020

Previous ID SR-13257
Radar rdar://problem/65819513
Original Reporter @Lukasa
Type Bug
Environment

Swift 5.2.4, Ubuntu 20.04.

Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

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 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.

@Lukasa
Copy link
Contributor Author

Lukasa commented Jul 20, 2020

@swift-ci create

@ankitspd
Copy link
Member

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).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants