Compiled with:
- i386: gcc-14.2.1_p20241116, MinGW-w64 12.0.0
- amd64: gcc-14.2.1_p20241221, MinGW-w64 12.0.0
I tried updating it before, but every time I rebuilt gettext, it would
cause all of rom-properties to crash on startup. It turns out the
problem was -Wl,--pic-executable; removing this fixed it.
This *might* prevent ASLR .reloc sections from being generated in the
gettext executables. These are only used at compile time, so it's not
that big of an issue.
Removed most of the patches, since they are no longer necessary.
The remaining patches:
- 001-gettext-runtime-disable-iconv.patch
- 122-Use-LF-as-newline-in-envsubst.patch
Both patches have been updated for gettext-0.24.
TODO: Build for arm, arm64, and arm64ec.
Compiled using gcc-13.2.0 and MinGW-w64 11.0.0.
Removed the *.dll.debug files, since I'm not planning on debugging
gettext, and no one seems to care about them anyway.
NOTE: The libgnuintl-8.dll files are more than double the size of
the previous version. This might be due to using a newly-built
Gentoo crossdev MinGW-w64 toolchain on my laptop instead of the
old MinGW-w64 toolchain on Ubuntu 22.04, or it might be because
gettext-0.22 has more wchar_t functionality on Windows now.
TODO: Build for Windows on ARM using LLVM MinGW-w64.
Also enabled the following flags:
- large address aware
- high entropy VA (64-bit only)
- dynamic base
- nxcompat
For some reason, these weren't enabled when I built them before, which
broke when running ROM Properties from a network share on Windows 10
due to the "Prohibit Dynamic Code" policy. (Probably nxcompat.)
Also, strip the binaries in bin.i386/.
I tested a release build and it saved a total of 10,752 bytes.
On the other hand, it had a rather huge maintenance overhead, since I had
to ensure that all extlibs had __cdecl set up in the headers properly,
and this had to be redone on every update.
The i386 build of LZ4 on AppVeyor was failing in tests because of missing
stdcall symbols. I decided not to bother adding stdcall support to LZ4
and simply revert stdcall entirely.
Main changes:
- gettext now has wbindtextdomain() on Windows, so we can remove our
custom Unicode patch.
- The 64-bit version seems to always build DllMain from the relocatable
package, even though we're disabling that...
New patches:
122-Use-LF-as-newline-in-envsubst.patch
- From: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
- Use LF as newlines instead of CRLF.
1002-dcigettext-c-include-wchar-h.patch:
- #include <wchar.h> for _wgetcwd().
1003-gettextsrc-exports-missing-formatstring-ruby.patch:
- Fix a missing export for formatstring_ruby, which fixes an undefined
__imp_* symbol error.
1004-gettext-runtime-disable-iconv.patch:
- Disable iconv support in gettext runtime so we don't need to bundle
iconv.dll in the final package.
- Was applied previously, but I forgot to include it as a patch.
Compiled on Ubuntu 20.04 using MinGW-w64 with gcc-9.3.0-7ubuntu1+22~exp1ubuntu4.
Some changes:
- The libraries are significantly smaller than before. Not sure what
really changed...
- The .def files no longer have ordinals.
This now has the correct 32-bit DLL and supporting libraries.
The __imp_libintl_version symbol is present again.
This fixes a 32-bit Windows build regression from
commit bc41a4e845.
([gettext.win32] Recompiled gettext-0.20.1.)
Compiled on Ubuntu 19.10 using MinGW-w64 with gcc-9.2.1-9ubuntu1+22~exp1ubuntu2.
The previous build was compiled on Ubuntu 19.04 using MinGW-w64
with gcc-8.3.0.
Some changes:
- The i386 .def file no longer has __imp_libintl_version.
- The .debug files are no longer compressed. I'm not sure how many
Windows tools support compressed debug files.
This should have been added before, but apparently it wasn't added to
the repository due to the .gitignore rule, and I forgot to specify the
--force option. Oh well.
Compiled on Ubuntu 19.04 using MinGW-w64 with gcc-8.3.0.
Some patches were dropped:
- 05-always-use-libintl-vsnprintf.mingw.patch: Doesn't apply cleanly
and isn't needed.
- 09-asm-underscore-mingw.patch: Merged upstream.
All other patches were applied, though some manual adjustments were
needed for a few patches, including the ctype/unistd include patch,
06-dont-include-ctype-after-gnulibs-wctype.mingw.patch.
libintl.h: Disabled libgnuintl wrappers for printf() functions.
We don't need to use the GNU versions for anything, and it causes problems
if libgnuintl-8.dll is unavailable, since we can't use printf() to print
an error message in that case.
- Redefine snprintf() as _snprintf() on older versions of MSVC.
See c99-compat.msvcrt.h.
DelayLoadHelper.cmake: Delay-load libgnuintl-8.dll.
DelayLoadHelper.h: Added a 1-argument macro.
[win32] DllMain.cpp, DllGetClassObject() Fail if libgnuintl-8.dll can't
be loaded.
[rpcli] rpcli.cpp: Print an error message if libgnuintl-8.dll can't be
loaded.
- TODO: Print the program information.
[win32] ConfigDialog.cpp: Show an error message if libgnuintl-8.dll
can't be loaded.
- TODO: Move this to rp-config.c? Doing that will result in no error
message if rundll32.exe is used, though...
This should be the last thing needed for issue #122:
[win32] Build and link in GNU gettext or equivalent
loadmsgcat.c: Convert the filename from UTF-8 to UTF-16, then use
_wopen() to open the file.
[libi18n] i18n.c: Convert the filename to UTF-8 instead of ANSI.
gettext now works on Windows if non-ANSI characters are present in
rom-properties' path.
The gettext libraries and executables were built on Ubuntu 18.04 using
MinGW-w64 with gcc-7.3.0.
iconv support has been disabled for the runtime, but it's still needed
for some of the build executables. For that, we're using win-iconv, which
is an iconv wrapper that uses the Windows API. [1]
In addition, several patches from the official MinGW package repository
were applied to gettext-0.19.8.1 in order to get it to build correctly
for Windows. [2]
TODO:
- Test packaging to ensure the correct DLL is packaged.
- Test bindtextdomain() to determine if it supports Unicode. If it
doesn't, then another patch will be needed.
[1] https://github.com/win-iconv/win-iconv
[2] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext