Commit Graph

57 Commits

Author SHA1 Message Date
David Korth
c3643b9244 [libpng] Update: v1.6.48 -> v1.6.49
Includes the APNG patch.
2025-06-15 14:25:09 -04:00
David Korth
407fb36461 [libpng] Disable /guard:cf in MSVC builds for now.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
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.
2025-05-26 11:11:51 -04:00
David Korth
b4ba027439 [libpng] Forgot to check in new file PNGCheckLibconf.cmake.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
2025-05-03 20:18:22 -04:00
David Korth
c706f7ba9b [libpng] Update: v1.6.47 -> v1.6.48
The APNG patch for v1.6.48 isn't out yet, but unlike v1.6.47, this
release doesn't have any major breaking changes.
2025-05-03 10:23:59 -04:00
David Korth
b6538e24c9 [libpng] Rebased on 1.6.47 + "official" APNG patch.
The "official" patch doesn't put the APNG functions in the pngrutil.c
dispatch table like my version did, but my version might've been
a bit broken...
2025-04-20 02:27:45 -04:00
David Korth
301c895d33 [libpng] CMakeLists.txt: Fix PDB installation.
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
2025-04-20 02:19:28 -04:00
David Korth
0c0ff2e595 [libpng] pngrutil.c: Missed a few png_structrp/png_inforp changes. 2025-04-01 19:17:11 -04:00
David Korth
3be503184b [libpng] Fix incorrect signatures for the APNG functions.
png_structp -> png_structrp
png_infop -> png_inforp

TODO: Re-apply the APNG patch now that it's been rebased to 1.6.47.
2025-03-31 21:42:46 -04:00
David Korth
120505d880 [libpng] Update: v1.6.46 -> v1.6.47
The APNG patch for v1.6.47 isn't out yet, so I hacked in some changes
to get the APNG code to build in pngrutil.c. In particular, the PNGv3
chromacity changes also modified pngrutil.c to use table-based dispatch
instead of an if/else. png_read_frame_head() doesn't use this yet, so
the APNG functions in pngrutil.c haven't been marked static yet, but
they do now return png_handle_result_code.

TODO: Rebase using the APNG patch once it's rebased for v1.6.47.

NOTE: PNGv3 apparently makes APNG part of the specification, so
libpng "should" gain built-in support for APNG without a patch at
some point.
2025-02-21 03:50:12 -05:00
David Korth
9de5720776 [libpng] Update: v1.6.44 -> v1.6.46
[debian] copyright: Update libpng.
2025-01-27 18:22:34 -05:00
David Korth
f0647da5eb Remove CheckHiddenVisibility.cmake.
The root CMakeLists.txt has a minimum CMake version of 3.5, and
CheckHiddenVisibility.cmake's workarounds are only needed for
CMake 3.2 and earlier.

Set CMP0063 unconditionally (added in CMake 3.3) and set the
CMAKE_<LANG>_VISIBILITY_PRESET and CMAKE_VISIBILITY_INLINES_HIDDEN
variables where CHECK_HIDDEN_VISIBILITY() was called before.

There should effectively be no code changes with this commit.
2025-01-18 22:34:24 -05:00
David Korth
d470035e61 Switch to CMake's POSITION_INDEPENDENT_CODE property instead of manually adding "-fpic -fPIC".
Something changed that caused the build on Xubuntu 16.04 (32-bit) to fail:

[ 63%] Linking CXX shared library ../../lib/libromdata.so
/usr/bin/ld: read-only segment has dynamic IFUNC relocations; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status
src/libromdata/CMakeFiles/romdata.dir/build.make:3614: recipe for target 'lib/libromdata.so.6.0' failed
make[2]: *** [lib/libromdata.so.6.0] Error 1

Setting POSITION_INDEPENDENT_CODE instead of "-fpic -fPIC" fixes this.

[extlib] Correctly set properties on the 'mspack' target instead of
'libmspack'. Otherwise, libmspack won't have either EXCLUDE_FROM_ALL
or POSITION_INDEPENDENT_CODE.
2025-01-05 14:02:13 -05:00
David Korth
0fba585f24 [libpng] Update: v1.6.43 -> v1.6.44
[extlib] CMakeLists.txt: Set SKIP_INSTALL_CONFIG_FILE=ON.
New setting checked by the libpng-1.6.44 update.
2024-09-26 21:29:36 -04:00
David Korth
c4c6d8a2f6 [libpng] CMakeLists.txt: Link to ${ZLIB_LIBRARY} instead of ZLIB::ZLIB.
ZLIB::ZLIB was causing problems where it would try linking to a literal
"zlibstatic" instead of libz.a. Not sure why...
2024-03-16 00:05:55 -04:00
David Korth
f26c7f8970 [libpng] Add a few _M_ARM64EC checks to fix the arm64ec build. 2024-03-03 16:28:35 -05:00
David Korth
2aef3c7b06 [libpng] Add files to the repository that were missed in the v1.6.43 update commit. 2024-02-25 13:33:13 -05:00
David Korth
c66509896c [libpng] Update: v1.6.42 -> v1.6.43
Also added some LoongArch files that were missed in the v1.6.42 update.
2024-02-25 13:16:35 -05:00
David Korth
20d731aad7 [libpng] Update: v1.6.40 -> v1.6.42
[zlib-ng] Export zlib as ZLIB::ZLIB. This is needed by
libpng-1.6.42's CMakeLists.txt
2024-02-17 20:13:22 -05:00
David Korth
dd87260759 [libpng] Update: v1.6.39 -> v1.6.40 2023-06-26 18:01:52 -04:00
David Korth
629f836c16 [libpng] Update: v1.6.38 -> v1.6.39 2022-12-10 16:29:26 -05:00
David Korth
436a0461bc [minizip-ng] Update: v1.6.37 -> v1.6.38 2022-10-16 15:22:48 -04:00
David Korth
28a97ccc2d [extlib] Make sure statically-linked extlibs don't export symbols in libromdata.so.
For most libraries, this merely required adding hidden visibility
flags to the CMakeLists.txt files. zlib-ng was a bit finicky,
and TinyXML2 needed a new macro, TINYXML2_NO_GCC_EXPORT.

TODO: zstd isn't currently used by libromdata.so. If I make use of it
later, either directly or indirectly via minizip, update it to not
export symbols when statically linking to it on Linux.

APNG_dlopen.c: Rework this file so it's always compiled regardless of
USE_INTERNAL_PNG and USE_INTERNAL_PNG_DLL. It exports two symbols,
APNG_ref() and APNG_unref(). When using the statically-linked libpng,
these functions are now no-ops, but they still need to be exported.
2022-06-29 22:26:24 -04:00
David Korth
991618e6c6 [extlib] The PDBs *do* need to be marked as OPTIONAL.
We're technically installing both the Debug and Release files, but only
one will exist at any given time, so it has to be OPTIONAL.

[libpng] CMakeLists.txt: Minor formatting improvements.
2020-09-20 15:02:50 -04:00
David Korth
d7d5ddbae4 [libpng] Make sure dllexport and dllimport are used correctly. 2020-06-27 03:09:19 -04:00
David Korth
b243f47341 [tinyxml2] Fix DLL installation in Windows packaging.
We need to install in ${INSTALL_BIN_DIR}, not ${CMAKE_INSTALL_BINDIR}.
Otherwise, it ends up in bin/ instead of i386/ or amd64/.

[libpng] Use ${INSTALL_BIN_DIR} for the Framework destination. This will
be used if I ever get any Mac OS X frontends done (besides rpcli).

This fixes issue #194: package.cmd: tinyxml2.dll isn't copied over correctly.
2020-01-12 23:56:43 -05:00
David Korth
9c9498b1b1 [libpng] Updated to libpng-1.6.37. 2019-04-16 23:26:07 -04:00
David Korth
72202b6ef0 [libpng] CMakeLists.txt: Disable INSTALL(EXPORT).
This broke the AppVeyor build.
2019-01-12 20:56:40 -05:00
David Korth
b86919a466 [libpng] Updated to libpng-1.6.36. 2019-01-12 14:15:39 -05:00
David Korth
fbb1d58f2d extlib, tests: Marked target link libraries as PUBLIC and/or PRIVATE.
Tests are all executables, so none of the libraries need to be PUBLIC.

External libraries should not be exporting their dependencies if they
aren't needed.
2018-08-26 20:58:23 -04:00
David Korth
b8c52ea528 [libpng] Updated to libpng-1.6.35. 2018-07-23 15:15:20 -04:00
David Korth
7163ec1dc4 [libpng] _MODIFIED_LIBPNG.txt: 1.6.34, not 1.6.32. 2018-04-14 13:44:10 -04:00
David Korth
8b9b214f51 [libpng] Updated to libpng-1.6.34. 2017-10-29 19:19:06 -04:00
David Korth
775835d309 [libpng] Updated to libpng-1.6.32.
The eXIf functions added in 1.6.31 were broken, so two new functions
were added and the old ones stubbed. This shifts the ordinals for APNG
over by two again.
2017-09-02 11:46:27 -04:00
David Korth
8767e15e6c [libpng] .gitattributes: Set EOL for *.dfa.
This fixes issue #95. (libpng: pnglibconf.dfa needs to be LF line endings.)
2017-08-05 03:57:42 -04:00
David Korth
e5d0759f1c [libpng] scripts/makefile.linux-opt: Forgot to add this file to the repository. 2017-07-28 00:35:29 -04:00
David Korth
00988f0a3c [libpng] Updated to libpng-1.6.31.
Note that two new functions were added to the original libpng, so the
ordinals for APNG were shifted over by two. This shouldn't be a problem,
since programs should be accessing functions by name instead of by
ordinal in 2017.
2017-07-28 00:20:18 -04:00
David Korth
a6902185af [libpng] CMakeLists.txt: Fix CMAKE_HOST_WIN32 stuff. 2017-07-15 20:00:40 -04:00
David Korth
36b53e5111 [libpng] Updated to libpng-1.6.30. 2017-07-04 13:26:25 -04:00
David Korth
c52df506cb Miscellaneous build system changes.
CMakeLists.txt: Use the top-level CMake directories.

cmake/platform/win32*.cmake: Define the Windows SDK version in
win32.cmake. Use the same version (Windows XP) regardless of
the target operating system in order to keep everything consistent.

[libpng] CMakeLists.txt: Fix MSVC debug paths for png_static.
2017-05-04 01:16:17 -04:00
David Korth
0143302326 [libpng] CMakeLists.txt: Fix setting "-msse2" when building with gcc.
The intel/ directory was moved outside of contrib/.
The MSVC path was updated, but the non-MSVC path wasn't.
2017-04-08 16:38:34 -04:00
David Korth
8f0092087f [libpng] scripts/symbols.def: Re-added the APNG symbols.
This fixes a regression from commit 8745251acc.
([libpng] Updated to libpng-1.6.29.)
2017-03-18 17:17:19 -04:00
David Korth
8745251acc [libpng] Updated to libpng-1.6.29.
Intel SSE2 was merged into the main codebase.

Added more ARM, MIPS, and PowerPC optimizations, though some of them
aren't currently used by CMakeLists.txt.
2017-03-18 16:01:56 -04:00
David Korth
a59181c460 Fixed several issues in the MinGW-w64 build.
Using MinGW-w64 4.0.6 with gcc-6.2.0.

Note that it still doesn't compile successfully due to missing
functionality in MinGW-w64 4.0.6. I'll try it again with 5.0.1 later.
Note that MinGW-w64 5.0.1 is still missing isolation-aware functionality,
so it won't be able to handle XP theming correctly.

Summary of changes:

- cmake/platform.cmake: MinGW-w64 uses separate crt*.o files for Unicode
  instead of a separate entry point. Handle this by removing the "w" from
  the Unicode entry point and passing the "-municode" option instead.

- libpng, rpcli, win32: CMake-3.7.2 doesn't add include paths to windres.
  Add the include paths manually in order to fix .rc compilation.

- c++11-compat.h: Moved the case-insensitive string comparison macros
  from c++11-compat.msvc.h. MinGW-w64 doesn't have the wcs*() functions,
  but it does have macros for str*(), so we have to define the macros
  only if said macros don't already exist.

- [libcachemgr] CacheManager: gettimeofday() is in time.h on MSVC,
  and sys/time.h on MinGW-w64 and other platforms. sys/types.h is
  no longer needed.

libromdata:
- RpWin32.cpp: Added more conditionals to the error list in order to
  fix compilation with MinGW-w64.
- RpWin32.hpp: Use reinterpret_cast<> for the atomic memory access
  functions.

rpcli:
- time_r.h: #define _POSIX_C_SOURCE is required on MinGW-w64 in order
  to use the *_r() functions.
- properties.cpp: #include "time_r.h" earlier to prevent time.h from
  being included before _POSIX_C_SOURCE is defined.

win32:
- QITab.h: Split the QISearch() defines out of RP_ComBase.h and added
  definitions that are missing on MinGW-w64.
- Added an extra '0' in QITAB instances in order to suppress gcc's
  "missing initializer" warning. [-Wmissing-field-initializers]
- Moved all COM smart pointers to the top of the file. Disabled some of
  them in MSVC builds because they're already defined in comdefsp.h.
- rom-properties.def: Removed the comment and "LIBRARY" statement, since
  GNU ld doesn't recognize them.
2017-03-05 03:18:45 -05:00
David Korth
209c38703c [libpng] CMakeLists.txt: Fixed installation of libpng16d.pdb.
Based on a similar fix for zlib.

Added a comment to both libpng and zlib regarding the PDB shenanigans.
2017-03-02 23:55:51 -05:00
David Korth
c10b0d156b [extlib] libpng, zlib: Set the Windows subsystem.
The subsystem was being set to 6.0 in 64-bit builds, which prevents
usage on XP64 and Server 2003 64-bit. Use SET_WINDOWS_SUBSYSTEM()
to fix this.

Also mark the DLLs as using the Windows subsystem. (Not that it matters,
since that field is only relevant for EXEs...)

TODO: Check other DLLs before committing, and do this before the
/TSAWARE commit.
2017-02-06 22:19:49 -05:00
David Korth
d1a6fe34f8 [libpng] Updated to libpng-1.6.28.
libpng's CMakeLists.txt has a new option, PNG_BUILD_ZLIB. If set,
FIND_PACKAGE(ZLIB) will be skipped.
2017-01-07 20:07:23 -05:00
David Korth
cd844c8d01 libpng] Updated to libpng-1.6.27. 2016-12-29 22:46:44 -05:00
David Korth
a4779dbc6a [libpng] .gitattributes: Force LF line endings for *.awk.
awk doesn't like CRLF line endings, which results in build errors
on Windows if autocrlf is enabled.
2016-11-20 21:09:25 -05:00
David Korth
95b22295ce [libpng] pngwin.rc: Only indicate APNG if PNG_APNG_SUPPORTED is defined.
Just in case I update libpng later and forget to apply the APNG patch.
2016-11-05 17:23:37 -04:00
David Korth
2222701a1b [libpng] pngwin.rc: Add "APNG"; set the POSTFIX even if PNG_DEBUG == 0.
Indicate that this is an APNG build.

For the debug postfix: Setting -DPNG_DEBUG worked, but not -DPNG_DEBUG=0.
2016-11-05 16:40:49 -04:00