1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-13 13:17:36 +03:00
Commit Graph

156 Commits

Author SHA1 Message Date
Nick Wellnhofer
d381e5de4a doc: Move doc/examples to example 2024-04-28 21:55:34 +02:00
Nick Wellnhofer
1cdfece12b memory: Remove memory debugging
This is useless compared to sanitizers or valgrind and has a
considerable performance impact if enabled accidentally.
2024-04-28 20:42:55 +02:00
Nick Wellnhofer
f7f1453772 build: Disable support for compression libraries by default
libxml2 has limited support for reading and writing compressed data
with the help of zlib and liblzma which used to be enabled by default.
This only works for files read from the file system and never worked
with memory buffers. My guess is that this feature is virtually unused.

In light of the recently discovered xz backdoor, it's a good time to
disable these features by default to reduce attack surface and prepare
for eventual removal.

If --with-legacy is passed to the Autotools build, compression will
be enabled by default as before.
2024-04-02 13:25:56 +02:00
Nick Wellnhofer
e97b4d843f autotools: Remove useless substitution
Fixes #689.
2024-02-13 12:00:02 +01:00
Nick Wellnhofer
24059ae92e autotools: Readd --with-xptr-locs configuration option
The option was removed accidentally in 4e4c89a4.
2024-01-10 18:10:10 +01:00
Nick Wellnhofer
d7d300ba04 parser: Remove remnants of runtime debugging feature
Apparently, this feature was remove long ago.

Fixes #651.
2024-01-04 17:50:11 +01:00
Nick Wellnhofer
2e9e758d1e dict: Get random seed from system PRNG 2023-12-24 16:24:34 +01:00
Nick Wellnhofer
be558647c1 autotools: Fix option description 2023-12-05 21:25:09 +01:00
Nick Wellnhofer
cf6e58d63c build: Disable compiler TLS by default
The global struct is quite large (~700 bytes on 64-bit systems which
will be allocated for each thread whether it uses libxml2 or not) and
already close to the total size limit on some platforms.

Disable compiler TLS by default.
2023-12-05 21:07:00 +01:00
Nick Wellnhofer
5cffba8381 Rework va_copy fallback
va_copy is a macro, so it can be detected without a feature test.
Fallback to __va_copy or memcpy.
2023-11-28 15:59:40 +01:00
Nick Wellnhofer
7d6969d955 Remove Trio
Trio is a rather old cross-platform printf library which was bundled with
libxml2. It was needed for ancient pre-C99 systems without snprintf and
should be safe to remove these days.
2023-11-23 15:48:52 +01:00
Nick Wellnhofer
f3c24112d3 autotools: Stop checking for snprintf
This works around a bug when cross-compiling to 32-bit MinGW:

https://sourceforge.net/p/mingw-w64/bugs/935/

This means that we don't fall back to the bundled Trio library if
snprintf couldn't be detected. Trio support is completely untested, most
likely broken and will be removed soon.

Fixes #625.
2023-11-22 02:12:44 +01:00
Nick Wellnhofer
3669316ad1 Bump version 2023-11-16 13:34:03 +01:00
Nick Wellnhofer
19161bab15 dict: Internal API to look up hash values 2023-09-29 12:43:08 +02:00
Nick Wellnhofer
de4b270aef autotools: Make --with-minimum disable lzma support
Fix an oversight when handling the --with-minimum option.
2023-09-21 14:31:31 +02:00
Nick Wellnhofer
e7f0d88ba4 build: Remove some GCC warnings
-Wnested-externs produces spurious warnings after implicit
declaration of functions.

-Winline is useless since we don't use inlines.

-Wredundant-decls was already removed for autotools.
2023-09-21 02:26:43 +02:00
James Le Cuirot
5a18c505a7
autoconf: Include non-pkg-config dependency flags in the pkg-config file
These were present before, but I accidentally dropped them in my recent
build improvements.
2023-09-04 22:14:13 +01:00
James Le Cuirot
6864d92f6c
autoconf: Don't bake build time CFLAGS into pkg-config file
Having slept on it, I've realised that baking the dependency CFLAGS into
the pkg-config file is pointless when it is only used to link against
them. It may even cause problems.
2023-09-04 22:14:02 +01:00
James Le Cuirot
93e8bb2a40
build: Generate better pkg-config files for static-only builds
pkg-config supports `Requires.private` and `Libs.private` fields for
static linking. However, if you're building a dynamic binary, then
pkg-config will use the non-private fields, even if just the static
libxml2 is available. This will result in libxml2 being underlinked,
causing the build to fail. The solution is to fold the private fields
into the non-private fields when the shared libxml2 is not being built.

This works for Autotools and CMake. Meson also knows how to handle this
when it automatically generates pkg-config files.
2023-09-03 08:52:36 +01:00
James Le Cuirot
4640ccac85
build: Generate better pkg-config file for SYSROOT builds
The -I and -L flags you use to build should not necessarily be the same
ones you bake into installed files. If you are building with
dependencies located under a SYSROOT then the installed files should
have no knowledge of that SYSROOT. For example, if the build requires
`-L/path/to/sysroot/usr/lib/foo` then only `-L/usr/lib/foo` should be
baked into the installed files.

pkg-config is SYSROOT-aware, so this issue can be sidestepped by using
the `Requires` field rather than the `Libs` and `Cflags` fields. This is
easily resolved if you rely solely on pkg-config, but this project falls
back to standard Autoconf checks, so a little more effort is required.

Unfortunately, this issue cannot feasibly be resolved for CMake.
`find_package` is used rather than `pkg_check_modules`, so we cannot
tell whether a pkg-config file for each dependency is present or not,
even if `find_package` uses pkg-config behind the scenes. The CMake
build does not record any dependency -I or -L flags into the pkg-config
file anyway. This is a problem in itself, although these dependencies
are most likely installed to standard locations.

Meson is very much better at handling this, as it generates the
pkg-config file automatically using the correct logic.
2023-09-03 08:52:22 +01:00
Nick Wellnhofer
54a0b19a9f autoconf: Allow custom --with-icu configure option 2023-09-01 14:52:14 +02:00
Nick Wellnhofer
c5989473b9 dict: Use thread-local storage for PRNG state 2023-09-01 14:52:11 +02:00
Nick Wellnhofer
57cfd221a6 dict: Use xoroshiro64** as PRNG
Stop using rand_r. This enables hash randomization on all platforms.
2023-09-01 14:52:04 +02:00
Nick Wellnhofer
4e4c89a4bc doc: Improve documentation of configuration options 2023-08-21 11:13:33 +02:00
Christoph Reiter
2473b4855e autotools: fix Python module file ext for cygwin/msys2
both use .dll, not .pyd
2023-06-21 14:38:38 +02:00
Nick Wellnhofer
cb8ccb1078 testapi: Don't set http_proxy environment variable
We already disable network access, so this has no effect.
2023-05-25 03:17:45 +02:00
Nick Wellnhofer
9fd57df815 autotools: Improve iconv check
Use a custom test program which includes iconv.h, so we can check
whether the possibly redefined symbols in this header file match the
symbols in the iconv library.

Should fix #547.
2023-05-25 02:47:27 +02:00
Nick Wellnhofer
bdb5667a5c autotools: Fix ICU detection
Fixes #540.
2023-05-10 18:13:47 +02:00
Mike Dalessio
3463063001
autoconf: fix iconv library paths
and pass cflags when building executables

See 0f77167f for prior related work
2023-05-06 12:26:17 -04:00
Nick Wellnhofer
a8fe4900be autoconf: Only use --undefined-version with version scripts 2023-04-29 20:17:38 +02:00
Nick Wellnhofer
d8f6e7602c Link with --undefined-version
lld 16 defaults to --no-undefined-version but the version script can
contain symbols disabled by configuration options.

See #473.
2023-04-29 19:12:23 +02:00
Nick Wellnhofer
e07f765f59 Bump version to 2.12.0 2023-04-28 14:51:06 +02:00
Nick Wellnhofer
2df2562e2b autoconf: Add AC_LANG_SOURCE to fix warning 2023-04-26 21:22:17 +02:00
Nick Wellnhofer
1db3567c9d autoconf: Warn about outdated C compilers 2023-04-19 12:19:36 +02:00
Nick Wellnhofer
101a542eb8 Remove RPM build, Makefile.tests, README.tests 2022-12-21 22:05:47 +01:00
Nick Wellnhofer
e2bae1bc04 autotools: Don't use version script on Windows
A feature test would be better, but blacklisting Windows platforms seems
good enough for now.
2022-09-20 14:39:52 +02:00
Nick Wellnhofer
f597eff8dd autotools: Fix winsock detection
Hardcode the required library on MinGW because winsock uses non-standard
calling conventions on 32-bit Windows which makes AC_SEARCH_LIBS fail.

Should fix #406.
2022-09-07 18:26:44 +02:00
Nick Wellnhofer
16d3e8b239 autotools: Only add network libraries if HTTP/FTP enabled 2022-09-07 18:10:03 +02:00
Nick Wellnhofer
5ff3baf0dc python: Create .pyd on Windows 2022-09-06 19:33:32 +02:00
Nick Wellnhofer
a41878bd4c build: Remove check for broken ss_family
This only seemed to affect ancient AIX systems.
2022-09-06 01:07:24 +02:00
Nick Wellnhofer
ad33845975 autotools: Fix bug with multiline arguments
Should fix #404.
2022-09-05 21:16:20 +02:00
Nick Wellnhofer
adcf399beb autotools: Try to fix bug with multiline arguments
Only happens with older autoconf?
2022-09-05 15:36:13 +02:00
Nick Wellnhofer
30c8d9bb23 http: Simplify IPv6 checks
This should also enable IPv6 support on Windows. Untested and mostly
useless anyway, since we don't support HTTPS.
2022-09-05 02:26:13 +02:00
Nick Wellnhofer
9e5a016ef0 autotools: Fix network checks on Windows 2022-09-05 01:25:35 +02:00
Nick Wellnhofer
5d32b12645 Fix detection of GNU libiconv
GNU libiconv prefixes symbols with "lib".
2022-09-04 22:05:16 +02:00
Nick Wellnhofer
27b2b86417 configure.ac: Also check for MSYS host 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
3a1c5ee7c1 Disable fuzzer tests if glob.h wasn't found 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
ad6f10a81b Fix Python build on Windows
Build Python bindings with -no-undefined on Windows. Remove libs that
should already be set by PKG_CHECK_MODULE.
2022-09-04 18:36:04 +02:00
Nick Wellnhofer
22b82d14d1 Improve network library detection 2022-09-04 18:36:04 +02:00
Nick Wellnhofer
0048fd0a50 Detect ws2_32 with AC_SEARCH_LIBS 2022-09-04 03:57:09 +02:00