The swift build --help has the following option
--enable-dead-strip/--disable-dead-strip
Disable/enable dead code stripping by the linker. (default: --enable-dead-strip)
SwiftBuild currently supports the dead strip option. We need to ensure SwiftPM is setting the value correctly, and that automated tests exists.