Currently, RUSTFLAGS="-Z export-executable-symbols" will call Linker::no_gc_sections, which is implemented to set /OPT:NOREF,NOICF for MsvcLinker. Hence, we override it in the build script.
For future changes, we modify PE processing script to not panic when there are no exported symbols. Currently, this change is a no-op since we unconditionally export a few symbols, like __chkstk and _fltused.
RUSTFLAGS="-Z export-executable-symbols"
will callLinker::no_gc_sections
, which is implemented to set/OPT:NOREF,NOICF
forMsvcLinker
. Hence, we override it in the build script.__chkstk
and_fltused
.