Support -fatal-warnings (without underscore) to be compatible with ld.gold
Originator: | keithbsmiley | ||
Number: | rdar://46151736 | Date Originated: | 17-Nov-2018 01:36 PM |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | ld64-409.12 |
Classification: | UI/Usability | Reproducible: | Always |
Summary: Currently if you have a cross-platform Swift PM project, you may want to pass `-Xlinker -fatal_warnings` for release builds (along with `-Xswiftc -warnings-as-errors`). To support this on both macOS and Linux, you have to do this conditionally in some script, so that you can pass -fatal_warnings to ld64, and -fatal-warnings to ld.gold. It would be great if ld64 supported a compatible flag to not have to add a platform conditional. Steps to Reproduce: 1. On Linux and macOS in a SwiftPM project run `swift build -Xlinker -fatal-warnings` Expected Results: It works on both platforms Actual Results: It passes on Linux, and fails on macOS Version: ld64-409.12 Notes: Attached is a possible patch (with tests!) to support this based on the Xcode 10.0.0 source dump from opensource.apple.com.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Here's the patch I attached: