On Linux, this will create a file "expat-2.2.9-Linux.tar.gz"
with the following content:
$ tar tf expat-2.2.9-Linux.tar.gz | sort | grep -v '/$'
expat-2.2.9-Linux/bin/xmlwf
expat-2.2.9-Linux/include/expat_config.h
expat-2.2.9-Linux/include/expat_external.h
expat-2.2.9-Linux/include/expat.h
expat-2.2.9-Linux/lib64/cmake/expat-2.2.9/expat.cmake
expat-2.2.9-Linux/lib64/cmake/expat-2.2.9/expat-config.cmake
expat-2.2.9-Linux/lib64/cmake/expat-2.2.9/expat-config-version.cmake
expat-2.2.9-Linux/lib64/cmake/expat-2.2.9/expat-noconfig.cmake
expat-2.2.9-Linux/lib64/libexpat.so
expat-2.2.9-Linux/lib64/libexpat.so.1
expat-2.2.9-Linux/lib64/libexpat.so.1.6.11
expat-2.2.9-Linux/lib64/pkgconfig/expat.pc
expat-2.2.9-Linux/share/doc/expat/AUTHORS
expat-2.2.9-Linux/share/doc/expat/changelog
expat-2.2.9-Linux/share/man/man1/xmlwf.1
While unsigned integer overflow is well-defined, Android sanitizers treat it
as an error. We also have some in the SipHash implementation but those won't
be easy to get rid of.
In C it is undefined to add anything to NULL. Clang recently began
taking advantage of this and can assume that if anything is added or
subtracted from a pointer that the pointer can be assumed non-NULL. The
Address Sanitizer has been updated to report when this happens at
runtime and produces messages like
expat/lib/xmlparse.c:6509:23: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior expat/lib/xmlparse.c:6509:23
This can be mitigated with 'p ? p + n : NULL' which optimizes to just
the add in all optimizing compilers, but avoids the undefined behavior.
The issue was that the code generated by AC_LANG_PROGRAM
produces warnings, and hence -Werror makes detection fail:
$ gcc -x c -Werror -Wstrict-prototypes - <<<'int main() {}'; echo $?
<stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
cc1: all warnings being treated as errors
1
Warnings were:
configure.ac:336: warning: macro 'AM_CPPFLAGS' not found in library
configure.ac:337: warning: macro 'AM_CFLAGS' not found in library
configure.ac:338: warning: macro 'AM_CXXFLAGS' not found in library
configure.ac:339: warning: macro 'AM_LDFLAGS' not found in library
Apparently, PARENT_SCOPE _only_ sets a variable in the parent scope
so we now first set it for Expat and do another exporting
call using PARENT_SCOPE if needed.
Error output of CMake 3.16.2 was:
CMake Error at libexpat/expat/CMakeLists.txt:319 (target_include_directories):
Cannot specify include directories for target "INTERFACE" which is not
built by this project.
CMake Error at libexpat/expat/CMakeLists.txt:368 (add_custom_command):
add_custom_command Wrong syntax. A TARGET or OUTPUT must be specified.