Sure, but if the point of this patch series is to share code with ntdll, then "delegate what we can to ntdll and leave everything else in msvcrt" seems like it'd avoid any duplication.
No, there are some helpers/coefficients that will need to be duplicated (I didn't check if it's true, maybe all of them will end only in one place). Anyway, this will basically split musl math library into 2 places which may cause some code duplication.
But then we can't share the function implementation anyway, can we?
We can export errno / some other helper from musl. We don't want to do it from ntdll. Especially taking into account that errno is not shared between different msvcrt versions. It may also need to be stored in thread data.
Also, all of the functions this patch series touches don't seem to have any error handling. Maybe that's just oversight, though?
No, in case of this functions it's probably correct (e.g. sin() is exported from ntdll and uses math_error/errno).
Are those bugs specific to forwards? E.g. could -import be used instead? Or explicitly importing in the code, which might allow more flexibility in error handling as well.
The bugs were specific to forwards. We didn't have -import at that point but I guess it might work.
I like having musl in separate, easily updatable place. I hope we will not loose this ability by adding to many changes.