Dropping this here for future searchers:
I'm seeing this with the platformio framework-arduinoststm32-maple framework as well.
The problem appears to be multiple definitions of premain() and main(). I suspect one should be marked with the "weak" attribute to allow the other to override as needed. Though the question is which one?
(NOTE: I'm not sure if the Arduino compiler/linker know/care about "weak")
I'm new to the platformio so am having trouble sorting out what is coming from where in order to know who to ask about this. I'm suspecting its the stm32duino folks.
Take a look at this forum comment where I've shown the syntax for the "weak" attribute if interested in going this route.