[PATCH] msvcrt: Provide pow2 implementation in static library for msvcrt versions that don't provide it.

Alexandre Julliard julliard at winehq.org
Wed Nov 13 12:52:47 CST 2019


Jacek Caban <jacek at codeweavers.com> writes:

> On 11/13/19 9:40 AM, Alexandre Julliard wrote:
>> Jacek Caban <jacek at codeweavers.com> writes:
>>
>>> Signed-off-by: Jacek Caban <jacek at codeweavers.com>
>>> ---
>>>
>>> This is needed because compiler may optimize pow(2,x) to exp2(x) and
>>> clang does that in out msvcp code. This also needs -fno-builtin
>>> because otherwise clang will optimize our forwarding implementation
>>> back to exp2.
>> If -fno-builtin works to prevent this, then why doesn't it already
>> prevent it from happening in msvcp?
>
>
> It would, but we don't use -fno-builtin to build msvcp using cross
> compiler. We use it only when mingw is not available.

Ah, right.

> BTW, before I wrote this patch, I used CROSSCFLAGS=-fno-builtin-exp2
> as a workaround (-fno-builtin-pow should do the trick as well), but I
> don't think we should go in that direction.

Maybe not, but having to add -fno-builtin in all the msvcrt makefiles
doesn't seem that much better.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list