Closed Bug 1460801 Opened 6 years ago Closed 5 years ago

MinGW x64 build does not run on Windows 7 due to _create_locale entry point missing

Categories

(Firefox Build System :: General: Unsupported Platforms, defect, P5)

3 Branch
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

When attempting to launch a x64 MinGW build on Windows 7, a dialog is immediately presented that says

> The procedure entry point _create_locale could not be located in the dynamic link library msvcrt


Tor has hacked around this for years.
Some details are here: https://bugzilla.mozilla.org/show_bug.cgi?id=1330608#c108

:dmajor commented:

> Aha. I can see the _create_locale problem on Windows 7, but not Win8.1 or Win10 (I didn't test Win8).
> 
> We had a similar problem a few years ago when we switched to Visual Studio 2015, and its CRT used an import that wasn't available on XP SP2. We never actually called that API though, so I hacked around the problem by intercepting one of the loader routines and pointing the problematic import to some other API: https://dxr.mozilla.org/mozilla-esr38/source/toolkit/xre/WindowsCrtPatch.h#10-25
> 
> Do you know why _create_locale gets pulled in? Maybe it's not actually needed. If somehow we can be certain that it is never called in practice, then we could apply the same hack. As a test, I opened the import table of xul.dll in a hex editor, and renamed _create_locale and _free_locale to "abort", and it worked... or at least I got up to the same JIT assert as in the other thread.

Georg added:

> _create_locale is coming from ICU and it seems to me it is actually needed:
> 
> https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/i18n/digitlst.cpp#517
> 
> U_PLATFORM_USES_ONLY_WIN32_API is explicitely defined for mingw(-w64) as well (not just for MSVC):
> 
> See:
https://dxr.mozilla.org/mozilla-central/source/intl/icu/source/common/unicode/platform.h#208


I'm not sure what we want to do here.  We _could_ use Tor's spec file hack...  We could also ignore this problem since we don't run tests on Windows 7/8
Someone pointed out that this might be fixed with ucrt so if we tried to switch to that it might go away.
Version: Version 3 → 3 Branch
Priority: -- → P5

This was fixed with the switch to mingw-clang \o/

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.