aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-06-17arm: Add a placeholder file in lieu of the former `filter_neon.S`upstream-masterCosmin Truta
In the previous commit 9e538750d99c8f1accf7e93878e4fde47c069908 we removed the obsolete assembler implementation `filter_neon.S`. In this commit we add a stand-in for the original file, restoring the original source tree structure, for the benefit of continuing hassle-free libpng source upgrades in the 1.6.x line.
2024-06-15arm: Remove obsolete assembler implementation filter_neon.SRoss Burton
This file contains hand-coded assembler implementations of the filter functions for 32-bit Arm platforms. These are only used when the compiler doesn't support neon intrinsics (added to GCC 4.3 in 2008) or is exactly GCC 4.5.4 (released 2012), both of which are sufficiently unlikely to be true that it's fair to say the assembler is no longer used. This commit deletes filter_neon.S and removes the now obsolete preprocessor logic in pngpriv.h. Signed-off-by: Bill Roberts <bill.roberts@arm.com> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-05-31SECURITY: disable build of filter_neon.S on armJohn Bowler
This fixes the bug https://github.com/pnggroup/libpng/issues/505 "libpng does not support PAC/BTI on aarch64 targets" which arises because the build mechanisms (both cmake and configure) assemble arm/filter_neon.S even though it ends up completely empty. The empty file effectively poisons the so that the PAC/BTI support gets disabled. The fix is minimal; it simply removes arm/filter_neon.S from the list of sources included in the 64-bit ARM builds build. Note that this was already done in cmake for MSVC - it's not clear whether this change was a partial fix for the same issue. This version of the fix ONLY affects aarch64 (arm64) builds; 32-bit ARM systems can still invoke the assembler if required and, indeed, there should be no change whatsover to those builds. The assembler code could not be used on 64-bit systems in any case so in practice there is no material change to 64-bit builds either. TESTING: pull the changes then type "autoreconf" if using configure (not required for cmake). TESTS: cmake has not been tested because cross-builds with cmake currently fail to find the zlib installation from the cmake system root path. The following has been tested with configure cross builds: armv7-linux-gnueabi [no neon support] armv7a-linux-gnueabi [no neon support] armv7a-hardfloat-linux-gnueabi [neon support not enabled] armv7a-hardfloat-linux-gnueabi -mfpu=neon [uses intrinics] armv7a-hardfloat-linux-gnueabi -mfpu=neon -DPNG_ARM_NEON_IMPLEMENTATION=2 [uses assembler] aarch64-linux-gnu [uses intrinsics] aarch64-linux-gnu -DPNG_ARM_NEON_OPT=0 [neon support disabled] Signed-off-by: John Bowler <jbowler@acm.org>
2024-02-24Bump version to 1.6.44.gitCosmin Truta
2024-02-23Release libpng version 1.6.43Cosmin Truta
2024-02-23ci: Add the libpng release tags to the list of exclusionsCosmin Truta
The release tags are redundant in the CI process. It is the main branch that is always verified.
2024-02-23test: Fix a compiler warning in pngtest.cCosmin Truta
2024-02-22chore: Delete comments and config settings and stuff from here and thereCosmin Truta
2024-02-22doc: Review the libpng history and update scripts/cmake/AUTHORS.mdCosmin Truta
2024-02-22doc: Update the README fileCosmin Truta
2024-02-22pngexif: Import pngexifinfo as an externally-contributed projectCosmin Truta
We used this experimental project in the development of the PNG-EXIF ("eXIf") specification, back in 2017. The project evolved together with the draft specification, which was finalized on 2017-Jun-15 and approved by the PNG Group on 2017-Jul-13. The EXIF specification, outside of the scope of PNG and libpng, is quite complex. The libpng implementation cannot grow too much beyond performing basic integrity checks on top of serialization. In order to create and manipulate PNG-EXIF image files, the use of external libraries and tools such as ExifTool is necessary. Now, with the addition of contrib/pngexif to the libpng repository, offline tasks like metadata inspection and linting can be performed without importing external dependencies.
2024-02-21build: Mark the installed libpng headers as system headers in CMakeBenjamin Buch
Modern compilers can disable the warnings that originate from system headers. This change allows them to do so with the libpng headers. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-20build: Checking for compiler support of LoongArch LSX should be guardedCosmin Truta
In the configure script, checking whether the LoongArch LSX intrinsics are supported by the compiler was done unconditionally, regardless of the targetted host platform. Compared to how we support the other SIMD platforms and compilers, this is rather unconventional. We are placing this check under the guard of its own platform, for the time being. A full solution, in line with the rest of the configure.ac patterns concering SIMD optimizations, is TODO. We also do an overall cleanup in the SIMD section of configure.ac, and, finally, we regenerate the configure script.
2024-02-20build: Add an explicit declaration of the AWK variable to configure.acCosmin Truta
Declare AWK explicitly via the AC_ARG_VAR directive, in order to make it "precious", and to include it in the list of influential variables at the end of the configure help text. Rephrase a few comments and config traces. Finally, regenerate the configure script.
2024-02-19build: Improve the search for an AWK processor in the CMake buildCosmin Truta
Add nawk to the list of AWK-processing programs that are known to work, and show the search result in the CMake log.
2024-02-19build: Update the CMake build options PNG_TOOLS and PNG_FRAMEWORKCosmin Truta
Update the PNG_TOOLS option: set it to OFF by default when the target is an embedded system, yet still allow it to be overridden. Update the PNG_FRAMEWORK option: force it back to OFF and print a warning if the option was ON but the target is not an Apple system.
2024-02-19build: Fix a CMake build regression introduced in version 1.6.41Dan Rosser
This fixes commit 4edbb4da81626a7342a22824d7a8f60a3ea71bd0. During the move of CMake scripts to the scripts/cmake/ subdirectory, some of the workflows have been broken. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-17Fix "ci: Fix the reporting in ci_lint.sh"Cosmin Truta
This fixes commit dddaf0c625a8daea4d027cb57380b7fac6f58285. The way to reliably `find` executable files is different on BSD, Mac and Linux, unfortunately.
2024-02-17ci: Fix the reporting in ci_lint.shCosmin Truta
The variable `CI_LINT_COUNTER` was incremented inside subshells, but remained unchanged in the main shell process. The errors detected by the internal linters remained unreported by the main script. (Oopsie!) Besides fixing this defect, considering that only a pass/fail status is needed, we are replacing `CI_LINT_COUNTER` with `CI_LINT_STATUS`.
2024-02-17ci: Allow the user to force an in-tree cleanup before verificationCosmin Truta
Introduce the environment option CI_FORCE: * ci_verify_configure.sh is known to fail if an existing build configuration is found in the top-level directory. Setting CI_FORCE=1 will run `make distclean` before verification. * ci_verify_makefiles.sh cannot be reliably executed if random object files are found in the top-level directory. Setting CI_FORCE=1 will run `rm *.o *.obj` before verification. * ci_verify_cmake.sh is not known at this time to fail for similar reasons; but if it does, we will use CI_FORCE to trigger any necessary pre-build cleanup.
2024-02-15chore: Clean up the spurious uses of `sizeof(png_byte)`; fix the manualCosmin Truta
By definition, `sizeof(png_byte)` is 1. Remove all the occurences of `sizeof(png_byte)` from the code, and fix a related typo in the libpng manual. Also update the main .editorconfig file to reflect the fixing expected by a FIXME note.
2024-02-15chore: Update the .editorconfig files and pacify editorconfig-checkerCosmin Truta
2024-02-15Add a GitHub Action for lintingCosmin Truta
2024-02-15ci: Pacify shellcheck version 0.8 and apply other linting improvementsCosmin Truta
Work around a limitation in the `shellcheck source` directive, which does not recognize quotes in shellcheck versions older than 0.9. Also extend the checks for YAML files over the entire source tree, in preparation for the introduction of the GitHub Actions config file.
2024-02-12ci: Fix the check of `PNG_LIBPNG_VER_BUILD` in ci_verify_version.shCosmin Truta
`PNG_LIBPNG_VER_BUILD` should be zero for public releases and non-zero for development versions. The ci_verify_version.sh script should check this requirement as such.
2024-02-11ci: Remove the workaround for CI_AR from ci_verify_makefiles.shCosmin Truta
2024-02-11build: Update the makefiles for the benefit of cross-compilationCosmin Truta
Split AR_RC into AR and ARFLAGS. The variables AR and ARFLAGS are de-facto standards (like CC and CFLAGS, LD and LDFLAGS, etc.) that may be overridden when running make. Moreover, configuring CC, LD, AR, etc., to point to a cross-platform compiler, linker, librarian, etc., is a de-facto standard practice as well. Also remove the MKDIR_P variable definitions from all makefiles. They've been leftovers from the removal of the "install*" targets.
2024-02-11ci: Update (again) the ci_verify_*.sh scripts; update .shellcheckrcCosmin Truta
Apply stylistic improvements and remove a shellcheck exclusion.
2024-02-10ci: Update the ci_verify_*.sh scripts.Cosmin Truta
Bring the coding patterns in line with the newest scripts.
2024-02-09ci: Add ci_verify_version.shCosmin Truta
This program verifies the libpng source tree, expecting consistent definitions of version numbers in the C source code, in the Autoconf scripts, and in the CMake scripts. The version verification is performed as follows. (Please note that the version definitions in png.h are checked twice.) * The files png.h, configure.ac and CMakeLists.txt are checked by the ci_verify_version.sh program. * The files png.h, png.c and pngtest.c are checked by the pngtest program.
2024-02-08ci: Update and rename ci_lint_ci.sh to ci_lint.sh; update .shellcheckrcCosmin Truta
The ci_lint.sh program can now lint the entire libpng source tree.
2024-02-08ci: Add ci_shellify.shCosmin Truta
This program can shellify png.h, configure.ac and CMakeLists.txt.
2024-02-06ci: Reformat all scripts using 1TBSCosmin Truta
One may truly embrace the stylishness of the One True Brace Style.
2024-02-05api: Introduce the `PNG_LIBPNG_VER_SHAREDLIB` macro; update pngwin.rcCosmin Truta
The version macros `PNG_LIBPNG_VER_SONUM` and `PNG_LIBPNG_VER_DLLNUM` weren't always in sync, but they should be, going forward. Or, better yet, we should keep them in, deprecated, and introduce `PNG_LIBPNG_VER_SHAREDLIB` for all shared library builds of all kinds on all platforms. It is unknown how many user applications have been using these macros. We have been using `PNG_LIBPNG_VER_DLLNUM` for pngwin.rc, for example. Which, by the way, was last updated in 2009.
2024-02-05test: Add consistency checks for the `PNG_LIBPNG_VER*` numbersCosmin Truta
Trigger a compile-time error in pngtest.c if there is any disagreement among `PNG_LIBPNG_VER`, `PNG_LIBPNG_VER_MAJOR`, `PNG_LIBPNG_VER_MINOR`, etc.
2024-02-05test: Remove compile-time option `SINGLE_ROWBUF_ALLOC` from pngtest.cCosmin Truta
We have been running address-sanitized CI verifications for a while. We can finally afford to simplify pngtest.c by removing a compile-time option and the associated code branches that used to serve (only to a limited extent) the purpose of bounds checking. Also change the brief description of pngtest.c at the top of the file. This is no longer just a simple test program.
2024-02-04ci: Add a pre-build checkup stage to ci_verify_configure.shCosmin Truta
Also update comments and tracing printouts in ci/ci_*.sh
2024-02-02build: Update and rename makefile.acorn to makefile.riscosCameron Cawley
Co-authored-by: Cosmin Truta <ctruta@gmail.com> Reviewed-by: John Bowler <jbowler@acm.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-02Improve, refactor and clean up pngtest.cCosmin Truta
Improve: The pngtest program used to be rather relaxed upon seeing invalid parameters in callbacks: it either ignored them, or it bailed out of the callbacks, essentially sweeping the bug under the rug. But no more. Now it terminates with a severe `png_error`, in which it says what's broken and where. Improve: `PNG_DEBUG`, defined externally at build time, and defaulting to zero, was assumed to be non-negative. Now it's checked. Clean up: In a very distant past, the pngtest program used to "travel" across libpng versions, on its own, not necessarily accompanied by the actual library version that it was meant to test. However, this stopped being the case, and now is as good a time as any to remove the compatibility workarounds that had made the aforementioned "travel" possible. Other chores include: * The refactoring of the user-defined chunk handling routines; * The cleanup of an unnecessary use of volatile; * The various cosmetic improvements of code and comments.
2024-02-02API usage: add 'basic' configurationJohn Bowler
This adds a new configuration file, 'contrib/conftest/basic.dfa' which disables unused APIs on a test Linux-based system. So support the configuration several fixes were necessary in the test programs so that the tests are skipped correctly when APIs are not available. The configuration has been tested on a range of common Linux apps including web browser code (qtwebengine), image processing code (e.g. ImageMagick) and general display code (X11, Qt5 and Qt6, KDE). Overall this first step reduces libpng linked code and data size to about 2/3 of the full configuration. To use the new test simply copy basic.dfa to 'pngusr.dfa' in the root of the source directory and build. Signed-off-by: John Bowler <jbowler@acm.org>
2024-02-02Correct row width check in png_check_IHDRJohn Bowler
This changes the mask used in the IHDR width check from ~7U to ~(png_alloc_size_t)7 which is a quantity at least as big as both png_uint_32 and size_t whereas "7U" will be 16 bits on a 16 bit system. The change both corrects a bug in the code (on 16 bit systems) and removes compiler warnings about the test always being false on 64-bit architectures. Signed-off-by: John Bowler <jbowler@acm.org>
2024-02-01loongarch: Add cmake supportguxiwei
2024-02-01Add eXIf support to push modeChris Blume
libpng already supports eXIf as of v1.6.31. However, it seems like support was added for normal mode and not added to push mode. Notice PNG_READ_eXIfJSUPPORTED is in pngread.c: https://github.com/pnggroup/libpng/blob/libpng16/pngread.c#L178 but is missing from pngpread.c: https://github.com/pnggroup/libpng/blob/libpng16/pngpread.c#L274 This commit adds eXIf support to push mode. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-31Fix contrib/conftest/pngcp.dfaJohn Bowler
This was broken by the corrections to the 'palette max' handling; if that is disabled the test of num_palette_max must be removed in pnread.c Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-31chore: Split lines in scripts/*.awk to pacify the editorconfig checkerCosmin Truta
2024-01-31chore: Fix a comment in pngrtran.cCosmin Truta
2024-01-31chore: Add .editorconfig filesCosmin Truta
2024-01-31Bump version to 1.6.43.gitCosmin Truta
2024-01-29Release libpng version 1.6.42Cosmin Truta
2024-01-29chore: Fix whitespace in pngpriv.hCosmin Truta