Partially remove some of the changes from #102138 as EXPORT_SYMBOLS_FOR_PLUGINS doesn't work on all the configurations.