Commit Graph

28 Commits

Author SHA1 Message Date
David Korth
dd4251101c [zstd] zstd_compress.c, ZSTD_convertBlockSequences(): Add const to make it match the declaration in zstd_compress_internal.h.
MSVC 2015 is complaining now:

extlib\zstd\compress\zstd_compress.c(7321): error C2220: warning treated as error - no 'object' file generated [build\extlib\zstd\zstd.vcxproj]
extlib\zstd\compress\zstd_compress.c(7321): warning C4028: formal parameter 4 different from declaration [build\extlib\zstd\zstd.vcxproj]
2025-04-01 19:17:11 -04:00
David Korth
7960595158 [zstd] Update: 1.5.6 -> 1.5.7 2025-02-19 22:07:44 -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
288375ab44 [zstd] Update: 1.5.5 -> 1.5.6
CheckZSTD.cmake: Update the version number here, too.
2024-03-30 12:16:26 -04:00
David Korth
b6e4e044cd [zstd] Handle ARM64EC as ARM64.
TODO: Send a patch upstream.
2023-07-14 20:11:55 -04:00
David Korth
089d692cc0 [zstd] Update: 1.5.4 -> 1.5.5
CheckZSTD.cmake: Update the version number here, too.
2023-04-23 11:08:39 -04:00
David Korth
91492b290b [zstd] common/bits.h: New file; missed this in the v1.5.4 update. 2023-02-10 18:32:35 -05:00
David Korth
a73ad060c8 [zstd] Update: 1.5.2 -> 1.5.4
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2023-02-10 18:28:12 -05:00
David Korth
019a0470de Fix some build issues on macOS.
- Split debug symbols doesn't work properly due to an issue with `strip`:
  error: symbols referenced by indirect symbol table entries that can't be stripped in: [library]

- Add "arm64" for M1/M2 Macs.

- zstd: "-fdeclspec" is needed for Clang due to use of __declspec() even
  on non-MS compilers or OSes. Note that we have to check for both
  "Clang" and "AppleClang", since Apple uses its own customized version
  of LLVM/clang.

- msvc.cmake: Make sure "Clang" is quoted when STREQUAL is used.
2023-02-03 19:46:59 -05:00
David Korth
d01e9c7ff8 [zstd] Update: 1.5.1 -> 1.5.2
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2022-01-23 14:52:33 -05:00
David Korth
7ab6934a26 [zstd] Update: 1.5.0 -> 1.5.1
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2021-12-22 22:48:29 -05:00
David Korth
609ff366a7 [zstd] Fix a few MSVC uninitialized variable errors due to /sdl.
extlib\zstd\compress\zstd_lazy.c(1399): error C4703: potentially uninitialized local pointer variable 'dmsTagRow' used
extlib\zstd\compress\zstd_lazy.c(1407): error C4703: potentially uninitialized local pointer variable 'dmsRow' used
2021-05-15 00:37:09 -04:00
David Korth
5885b62c9e [zstd] Update: 1.4.9 -> 1.5.0
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2021-05-15 00:04:50 -04:00
David Korth
eadcdf9327 Remove "/Gz" for stdcall on i386 when building with MSVC.
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.
2021-03-31 22:24:17 -04:00
David Korth
e21814a754 [zstd] zstd.h: Update some function declarations; increment version number.
I somehow missed these when updating zstd earlier. It only seemed to
break the MinGW-w64 builds, which is odd, since I would have expected
this to break every build in cases where we didn't have a system zstd...
2021-03-13 22:29:33 -05:00
David Korth
17d33de325 [zstd] Updated: 1.4.8 -> 1.4.9 2021-03-13 21:07:16 -05:00
David Korth
4da7a51056 [zstd] Updated from 1.4.5 to 1.4.8. 2021-02-17 18:34:16 -05:00
David Korth
42ebf46334 [zstd] _MODIFIED_ZSTD.txt: Mention the RC file in DLL builds. 2020-09-05 02:47:27 -04:00
David Korth
047f3d149e [zstd] _MODIFIED_ZSTD.txt: s/zlib/zstd/ 2020-09-05 01:40:43 -04:00
David Korth
49902f0445 [zstd] CMakeLists.txt: Check for BUILD_SHARED_LIBS/BUILD_STATIC_LIBS before linking CMAKE_THREAD_LIBS_INIT. 2020-06-27 03:09:19 -04:00
David Korth
b216f75ed7 [zstd] CMakeLists.txt: Wrap various things in BUILD_SHARED_LIBS/BUILD_STATIC_LIBS checks.
This should fix the travis-ci build.

Removed SET_WINDOWS_SUBSYSTEM(zstdstatic) since that doesn't make
any sense.
2020-06-27 03:09:19 -04:00
David Korth
17b962a9a3 [zstd] zstd.h: Added ZSTDLIB_CALL.
It turns out we need it because other modules are compiled with /Gz,
even if zstd isn't.

FIXME: Compiling zstd with /Gz fails due to C2373 type redefinition
errors, which doesn't make any sense...
2020-06-27 03:09:19 -04:00
David Korth
7e19c4d5a8 [zstd] CMakeLists.txt: Explicitly mark zstd as SHARED.
Otherwise, the travis-ci build fails because BUILD_SHARED_LIBS is OFF
here, so CMake tries building it as a static library, and then fails
because the INSTALL() rule lacks an ARCHIVE target.
2020-06-27 03:09:19 -04:00
David Korth
c3b31369a0 [zstd] Added the Win32 resource file to DLL builds.
- TARGET_INCLUDE_DIRECTORIES(): Needs to be PUBLIC, not INTERFACE.
  Otherwise, rc.exe can't find zstd.h.

- verrsrc.h: Added VS_FF_DEBUG, which is used by libzstd-dll.rc but
  wasn't present in the original version upstream.
2020-06-27 03:09:19 -04:00
David Korth
87933aa685 [zstd] Fix MSVC builds.
- Remove "/Ob0 /Od /RTC1" from debug flags. In particular, "/Od" and
  "/RTC1" conflict with each other:

cl : Command line error D8016: '/O2' and '/RTC1' command-line options are incompatible

- Add "/Ob2" to debug CFLAGS.

- Set -DZSTD_DLL_EXPORT when building the DLL. Otherwise, symbols aren't
  exported and the import library isn't built.

- Set -DZSTD_DLL_IMPORT when importing the DLL. This isn't strictly
  necessary, but it does reduce some overhead.

- Install the PDB files. (Copied from zlib.)
2020-06-27 03:09:19 -04:00
David Korth
81be81f4af [zstd] Added LICENSE and a section in the Debian copyright file. 2020-06-27 03:09:19 -04:00
David Korth
f4c96fb289 [zstd] Added _MODIFIED_ZSTD.txt. 2020-06-27 03:09:19 -04:00
David Korth
dc587561b4 [zstd] Added zstd for use with MiniZip.
MiniZip 2.10.0 added support for zstd as a compression method, so we
should support it.

Note that a system version of zstd is preferred on Linux systems.

Enabled the MiniZip test tools for manual builds only. Info-ZIP hasn't
been updated in a while, so I'm going to use the MiniZip test tools to
compress ZIP archives using zstd.

Enabled MiniZip compression in order to compress stuff using the minizip
test program.

mz_strm_zstd.c: FIXME: Compression level doesn't work. Hard-coded the
maximum compression level for now.
2020-06-27 03:09:15 -04:00