Compiled with:
- i386: gcc-15.1.0, MinGW-w64 12.0.0
- amd64: gcc-15.1.0, MinGW-w64 12.0.0
The file sizes have grown a bit. In particular, xgettext.exe grew from
1,529,344 bytes to 8,492,544 bytes. This might be related to various
gnulib updates, since libgnuintl-8.dll has a bunch of new exports
compared to 0.24.
This is what was causing the libpng crash in png_longjmp() on
Windows 10 in MSVC 2022 release builds.
See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
Reported by @Masamune3210.
CMake 4.0 drops compatibility with versions older than 3.5, and warns
that compatibility with < 3.10 will be dropped in a "future version".
CMake 3.30 previously warned about dropping support for older than
3.5, which was changed in 3.31 to older than 3.10.
FIXME: The minigzip and minizip binaries are automatically built,
even though we use SET_EXTLIB_PROPERTIES(), which should exclude
them from ALL builds...
zlib is already checked earlier. On my system, since I have zlib-ng
installed system-wide, this check picks it up, and causes libromdata.so.6
to be linked to libz-ng.so.2.
Disabling the check removes that linkage.
NOTE: The Ubuntu packages for 2.5 and 2.5.1 are *not* linked to zlib-ng,
since Ubuntu doesn't have zlib-ng included by default.
Also, update _MODIFIED_MINIZIP.txt for 4.0.10. (Forgot to do this when
updating from 4.0.9 to 4.0.10.)
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.
This reduces the size of pugixml.dll to within range of what
tinyxml-10.dll was in previous versions.
Size comparisons: (amd64 release build, with LTO, MSVC 2022 17.6.5)
tinyxml-10.dll in rom-properties 2.4.1: 105,472
pugixml.dll:
- With all enabled: 222,208
- Disable XPATH: 142,336
- + disable STL: 121,856
- + disable exceptions: 121,856
NOTE: Disabling exceptions doesn't seem to change the code size at all,
even if STL is left enabled.
PNG_LIB_NAME was removed from CMakeLists.txt in v1.6.40, which was added
in rom-properties 2.2. No one seems to have noticed its absence, though...
Affects: v2.2 - v2.4.1
- Don't install CMake or pkgconfig files, or header files.
- Add DO_SPLIT_DEBUG() and SET_WINDOWS_SUBSYSTEM().
- Make sure the PDB file gets installed.
- Install to the correct path.
This fixes PugiXML's location in the Win32 zip file.
Ported from upstream.
extlib\rapidjson\include\rapidjson\internal\biginteger.h(22,9): error C2220: the following warning is treated as an error (compiling source file src\librpbase\TextOut_json.cpp)
extlib\rapidjson\include\rapidjson\internal\biginteger.h(22,9): warning C4163: 'UnsignedMultiply128': not available as an intrinsic function (compiling source file src\librpbase\TextOut_json.cpp)
extlib\rapidjson\include\rapidjson\internal\diyfp.h(27,9): warning C4163: 'UnsignedMultiply128': not available as an intrinsic function (compiling source file src\librpbase\TextOut_json.cpp)
This is also set by extlib/CMakeLists.txt.
CMake Warning (dev) at extlib/zlib-ng/CMakeLists.txt:145 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
For compatibility with older versions of CMake, option is clearing the
normal variable 'INSTALL_UTILS'.
This warning is for project developers. Use -Wno-dev to suppress it.
We're setting these using SET() in extlib/CMakeLists.txt, so having them
as actual options causes CMake to print a bunch of warnings like this:
CMake Warning (dev) at extlib/zlib-ng/CMakeLists.txt:133 (option):
Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
For compatibility with older versions of CMake, option is clearing the
normal variable 'WITH_SSE2'.
This warning is for project developers. Use -Wno-dev to suppress it.
[extlib] CMakeLists.txt: SET(WITH_VPCLMULQDQ ON)
Ideally, we'd make it use size_t for all size parameters, but this is
old code, and doing that would require going through a lot of stuff,
so just cast it to int for now.
FIXME: unice68 is expecting fread() and fwrite() to return -1 on error,
but these functions return size_t, which is unsigned...
Initialize some variables, and use memcpy() instead of strncpy().
Remove the -Wno-error options. This broke on Debian 8 ppc (gcc-4.9.2),
which doesn't support -Wstringop-overflow or -Wstringop-truncation.
extlib/minizip-ng/compat/unzip.c: In function ‘unzGetFilePos’:
extlib/minizip-ng/compat/unzip.c:563:38: error: ‘file_pos64.pos_in_zip_directory’ may be used uninitialized [-Werror=maybe-uninitialized]
563 | file_pos->pos_in_zip_directory = (uint32_t)file_pos64.pos_in_zip_directory;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extlib/minizip-ng/compat/unzip.c:556:20: note: ‘file_pos64.pos_in_zip_directory’ was declared here
556 | unz64_file_pos file_pos64;
| ^~~~~~~~~~
extlib/minizip-ng/compat/unzip.c:564:29: error: ‘file_pos64.num_of_file’ may be used uninitialized [-Werror=maybe-uninitialized]
564 | file_pos->num_of_file = (uint32_t)file_pos64.num_of_file;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extlib/minizip-ng/compat/unzip.c:556:20: note: ‘file_pos64.num_of_file’ was declared here
556 | unz64_file_pos file_pos64;
| ^~~~~~~~~~
cc1: all warnings being treated as errors
extlib/minizip-ng/mz_zip.c: In function ‘mz_zip_set_comment’:
extlib/minizip-ng/mz_zip.c:1569:5: error: ‘__builtin___strncpy_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
1569 | strncpy(zip->comment, comment, comment_size);
| ^
extlib/minizip-ng/mz_zip.c:1563:29: note: length computed here
1563 | comment_size = (int32_t)strlen(comment);
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
A change in 4.0.8 results in ZEXPORT defaulting to nothing, which breaks
dllexports in the Windows version (and results in no import library
being generated).
Define ZEXPORT=__declspec(dllexport) to have the same behavior as 4.0.7.
This broke the Ubuntu 22.04 AppVeyor build:
extlib/microtar/src/microtar.c: In function ‘mtar_read_header’:
extlib/microtar/src/microtar.c:111:3: error: ‘__builtin_strncpy’ output may be truncated copying 99 bytes from a string of length 99 [-Werror=stringop-truncation]
111 | strncpy(h->name, rh->name, sizeof(h->name));
| ^
extlib/microtar/src/microtar.c:112:3: error: ‘__builtin_strncpy’ output may be truncated copying 99 bytes from a string of length 99 [-Werror=stringop-truncation]
112 | strncpy(h->linkname, rh->linkname, sizeof(h->linkname));
| ^
cc1: all warnings being treated as errors
This broke the Ubuntu 22.04 AppVeyor build:
extlib/minizip-ng/mz_compat.c: In function ‘unzGetFilePos’:
extlib/minizip-ng/mz_compat.c:1201:38: error: ‘file_pos64.pos_in_zip_directory’ may be used uninitialized [-Werror=maybe-uninitialized]
1201 | file_pos->pos_in_zip_directory = (uint32_t)file_pos64.pos_in_zip_directory;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extlib/minizip-ng/mz_compat.c:1194:20: note: ‘file_pos64.pos_in_zip_directory’ was declared here
1194 | unz64_file_pos file_pos64;
| ^~~~~~~~~~
extlib/minizip-ng/mz_compat.c:1202:29: error: ‘file_pos64.num_of_file’ may be used uninitialized [-Werror=maybe-uninitialized]
1202 | file_pos->num_of_file = (uint32_t)file_pos64.num_of_file;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extlib/minizip-ng/mz_compat.c:1194:20: note: ‘file_pos64.num_of_file’ was declared here
1194 | unz64_file_pos file_pos64;
| ^~~~~~~~~~
cc1: all warnings being treated as errors
This broke the Ubuntu 22.04 AppVeyor build:
extlib/minizip-ng/mz_zip_rw.c: In function ‘mz_zip_reader_entry_save_file’:
extlib/minizip-ng/mz_zip_rw.c:668:5: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
668 | strncat(pathwfs, path, path_length);
| ^
extlib/minizip-ng/mz_zip_rw.c:662:19: note: length computed here
662 | path_length = strlen(path);
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
extlib/minizip-ng/mz_zip.c: In function ‘mz_zip_set_comment’:
extlib/minizip-ng/mz_zip.c:1574:5: error: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
1574 | strncpy(zip->comment, comment, comment_size);
| ^
extlib/minizip-ng/mz_zip.c:1568:29: note: length computed here
1568 | comment_size = (int32_t)strlen(comment);
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
pugixml uses "_d" instead of "d".
[pugixml] CMakeLists.txt: Disable options. The cmake_dependent_option()
setup for PUGIXML_USE_POSTFIX prevented the postfix from working because
the top-level source directory is not the same as PugiXML's directory.
[libwin32common] DelayLoadHelper: Handle PugiXML's "_d" postfix.
DelayLoadHelper.cmake has new variables for debug/release only DLLs,
which is used for PugiXML due to the different debug postfix.
These warnings (now handled as errors) appeared in the AppVeyor build
with MSVC 2015:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\algorithm(1669): error C2220: warning treated as error - no 'object' file generated [build\src\amiibo-data\amiiboc.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\algorithm(1669): warning C4996: 'std::reverse_copy::_Unchecked_iterators::_Deprecate': Call to 'std::reverse_copy' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' [build\src\amiibo-data\amiiboc.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\algorithm(1669): note: see declaration of 'std::reverse_copy::_Unchecked_iterators::_Deprecate'
extlib\fmt\include\fmt/chrono.h(659): note: see reference to function template instantiation '_OutIt *std::reverse_copy<char*,char*>(_BidIt,_BidIt,_OutIt)' being compiled
with
[
_OutIt=char *,
_BidIt=char *
]
extlib\fmt\include\fmt\color.h(410): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) [build\src\amiibo-data\amiiboc.vcxproj]
extlib\fmt\include\fmt\color.h(409): note: while compiling class template member function 'bool fmt::v11::detail::ansi_color_escape<Char>::has_emphasis(fmt::v11::emphasis,fmt::v11::emphasis) noexcept'
with
[
Char=wchar_t
]
extlib\fmt\include\fmt\color.h(371): note: see reference to function template instantiation 'bool fmt::v11::detail::ansi_color_escape<Char>::has_emphasis(fmt::v11::emphasis,fmt::v11::emphasis) noexcept' being compiled
with
[
Char=wchar_t
]
extlib\fmt\include\fmt\color.h(450): note: see reference to class template instantiation 'fmt::v11::detail::ansi_color_escape<Char>' being compiled
with
[
Char=wchar_t
]
extlib\fmt\include\fmt/xchar.h(328): note: see reference to function template instantiation 'void fmt::v11::detail::vformat_to<T>(fmt::v11::detail::buffer<T> &,const fmt::v11::text_style &,fmt::v11::basic_string_view<wchar_t>,fmt::v11::basic_format_args<fmt::v11::wformat_context>)' being compiled
with
[
T=wchar_t
]
The MSVC build (64-bit, at least...) now builds with no warnings.
Tested using MSVC 2022 17.6.5.
NOTE: /W4 adds a *lot* of warnings that are mostly just noise. Need to
check /W4 and selectively enable at least some of them...
Removed /wd4482. I don't think this warning is relevant anymore.
Warning fixes:
[extlib] Add (unsigned int) casts where necessary.
[librpbase] Config::ImgTypePrio_t, KeyManager::KeyData_t:
- Change `length` from unsigned int to size_t.
The struct is 16 bytes on 64-bit either way, but making it size_t
fixes some conversion warnings.
[librpbase] Hash::Process():
- crc32() returns `unsigned long`, not `uint32_t`, for some reason.
- Also, its length parameter is `unsigned int`, not `size_t`.
- KeyManager::hexStringToBytes(): Take a `size_t` length parameter.
[librpfile] scsi:
- Change cdb_len from `uint8_t` to `size_t`. Using a `uint8_t` argument
doesn't actually save any memory, since it uses 4 bytes on the stack
for 32-bit, and one register on 64-bit, regardless.
- Also, limit the maximum cdb size to 260.
[rp-download] Disable warning C4996 when calling GetVersionEx().
[librptexture] DirectDrawSurface:
- Change some `expected_size` variables from `unsigned int` to `size_t`.
[librptexture] PalmOS_Tbmp:
- Change d->bitmapTypeAddr from `off64_t` to `uint32_t`.
- Change some size variables from `unsigned int` to `size_t`.
- loadTbmp(): v3 transparency: Explicitly cast the transparency value
to uint16_t. (It's stored as a big-endian 32-bit value, but only
16 bits are used.)
- getNextTbmpAddress(): Cast addresses to `uint32_t`. PalmOS executables
are 32-bit and cannot possibly exceed 4 GB.
- FIXME: This function isn't used? (Was it ever used?)
[libromdata]
- DMGPrivate::CartType(): Make `end_offset` constexpr.
- NCCHReader: Add casts for EncSections when using sizeof().
- KeyStoreUIPrivate: binToHexStr(), verifyKeyData():
- Take a `size_t` length parameter.
- WiiUPackagePrivate: Added a parseHexBinary32() wrapper function
that returns `uint32_t` instead of `uint64_t`.
[librpbyteswap/tests]
- BitstuffTest: Cast time(nullptr) to `unsigned int`.
srand() takes `unsigned int`, not `time_t`.
[librpbase/tests]
- RpPngFormatTest: crc32()'s length parameter is `unsigned int`,
not `size_t`.
[libromdata/tests]
- SuperMagicDriveTest: zlib uses `unsigned int`, so cast array sizes
to `unsigned int` instead of changing decompress() to take `size_t`.