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.
- 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.
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
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.
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...
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...
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.
- 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.
- 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.)
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.