On Tue, 3 Aug 2021, Jacek Caban wrote:
Hi Martin,
On 8/3/21 11:46 AM, Martin Storsjö wrote:
As the preloader is linked with -nodefaultlibs, we need to provide builtin helpers for division on arm (that normally are provided by libgcc or compiler-rt).
I wonder how hard it would be to avoid using divisions in preloader code instead. If that's not an option, maybe we could have a naive version of those helpers in C.
Ok, I'll give that a shot. Yeah that sounds like it would be less of a mess than adding these.
As a side note, we should probably have those helpers in winecrt0 for PE targets, but that wouldn't help preloader for which I think it would be nice to use a simpler solution, if possible.
Yep - currently it's possible to build in PE mode for ARM if you build with a mingw compiler that has compiler-rt builtins, but if building in MSVC mode, you run into the fact that these are missing. I did a shot at importing the missing ones from compiler-rt into winecrt0, but one needs a pretty significant number of them:
__rt_sdiv __rt_sdiv64 __rt_udiv __rt_udiv64 __dtoi64 __stoi64 __dtou64 __stou64 __i64tod __i64tos __u64tod __u64tos
Importing all of those from compiler-rt requires pulling in 27 new files from there - which is pretty unwieldy.
// Martin