Commit Graph

146 Commits

Author SHA1 Message Date
Nicholas Wilson
990d53f192 Add linker scripts with symbol versioning (#721)
Both the Autoconf and CMake build systems are updated to detect linker support for symbol versioning.

Currently, Linux, Solaris, and FreeBSD are tested and working. Windows (COFF) and macOS (Mach-O) have no symbol versioning.

There is an Autoconf/CMake flag to opt out of the versioning behaviour.
2025-03-18 08:55:38 +00:00
Nicholas Wilson
929b7404f9 Build fixes for z/OS (#695)
Fixes to enable the code to build with a simple `CC=xlc ./configure --enable-ebcdic --disable-unicode`.

Fixes to the tests, so that `make check` passes on EBCDIC platforms.

Add a CI job to do z/OS testing.
2025-02-26 22:31:51 +00:00
Nicholas Wilson
0d0ac3aa0f Update EBCDIC support to support testing on normal ASCII systems (#656)
The pcre2test utility needs quite a few changes to accommodate this.
It is simpler to add a new mode to it, than to make it fully
EBCDIC-native. On an ASCII system, pcre2test performs ASCII I/O, but
tranlates the input when passing it to the fully-EBCDIC-supporting
library.
2025-02-12 22:31:00 +00:00
Nicholas Wilson
715757775c Add AM_MAINTAINER_MODE for users checking out a release tag (#682) 2025-02-04 12:24:03 +00:00
Carlo Marcelo Arenas Belón
95181ffc05 macOS related patches for 10.45 (#668)
* autotools: retire conditional for debug build

likely added by mistake, the functionality works through `--enable-debug`
instead.

* maint: allow selecting compiler for ManyConfigTests

Instead of hardcoding the compiler as `cc`, let a CC environment
variable dictate which compiler to use.

For example, in macOS/arm64 where the GNU compiler is provided by
brew the following will allow using it instead of the system compiler
(which ALSO answers to `gcc` even though is `clang`)

  % CC=gcc-13 maint/ManyConfigTests
2025-01-13 15:42:07 +00:00
Nicholas Wilson
e02e52804c Update release number to 10.46-DEV #noupdate (#667) 2025-01-12 15:28:37 +00:00
Nicholas Wilson
acb4b56944 Enable and fix additional build warnings (#655)
Part of #651

* Use much stricter windows warnings (`/W3` rather than `/W1`). This requires quite a few fixes for all the sloppy places where we do implicit assignment of 64-bit values to 32-bit storage.
* Use and test CMake build & install on FreeBSD and Solaris
* Add 64 bit Solaris build (`cc -m64`) and fix existing Solaris warnings
* Make compile flags used in CI consistent across platforms. Previously Mac & Linux were building with different warning flags.
* Add `--enable-Werror` to `configure.ac`. This means that you can build with `-Werror` in a clean way. Previously, you had to hackily override the CPPFLAGS when calling `make` since you can't pass `-Werror` as a CFLAG into `./configure` (it messes with compiler feature detection).
2025-01-10 13:33:52 +00:00
Nicholas Wilson
4d3eada79b Update soversion passed to libtool for 10.45 (#636)
I believe this is the correct procedure, based on Philip's documentation.

The libpcre2-posix interface is completely unchanged, but the source code has been updated.

The libpcre2-NN interface has been extended in backwards-compatible ways, with new enum values and API functions, so callers compiled and linked against the old version may use the newer as a drop-in replacement, but callers compiled against the 10.45 headers will fail when used against the old version (if they require any newly-added functions).
2024-12-20 13:36:08 +00:00
Nicholas Wilson
ac528f2d26 Details on new maintainership (#603)
* Add details on new maintainership
* Remove checked-in autoconf outputs
* Sync & cleanup files with Detrail
* Add CI job for ensuring PrepareRelease is run
* Add Ubuntu-20.04 autoconf runner
* Make CMake installed files match autoconf
* Update acknowledgements
2024-12-11 09:53:59 +00:00
Carlo Marcelo Arenas Belón
8a109eab14 Do not use __builtin_unreachable() in PCRE2_ASSERT() (#485)
__builting_unreachable() implementation is not defined and has
been known to not trigger failures under some compilers.

Default instead to using assert(), which has the added benefit
of printing a descriptive message and it is also likely more
portable as it is part of ANSI C.

While at it, really allow configuring builtins with cmake.
2024-09-21 14:19:25 +01:00
Alex Dowad
04dc664b85 Implement PCRE2_UNREACHABLE assertion for MS Visual C++ (#465) 2024-09-10 15:14:09 +01:00
Carlo Marcelo Arenas Belón
3f271de591 build: improve portability of assertions (#462)
Move them out from the public API header and improve detection
by making sure the code used wouldn't trigger false positives.

While at it, migrate two more opem coded assertions and avoid
use of -Werror on AIX with xlc as well as clear a warning
triggered in Windows since the original commit.
2024-09-07 09:43:14 +01:00
Carlo Marcelo Arenas Belón
b72bf20d0c autotools: fix --enable-jit=auto (#454)
Reflect the new location of sljit and update release files
2024-09-02 16:11:55 +01:00
Alex Dowad
4f6c43d2c3 Add assertion macros, use new PCRE2_UNREACHABLE assertion at unreachable points in code (#446)
* Correct typo ('mimimum' -> 'minimum')

* Add assertion macros

* Use PCRE2_UNREACHABLE assertion for unreachable points in code
2024-08-28 14:43:58 +01:00
Philip Hazel
04a60de75c Fix typo in configure.ac 2024-08-09 17:08:05 +01:00
Carlo Marcelo Arenas Belón
430237f4dc m4/pcre2_visibility.m4: add basic support for non GCC compilers (#421)
Assume that a compatible `-fvisibility=hidden` option is available
and that the compiler handles correctly `#warning` macros.

Restrict the visibility test if `-Werror` is unrealiable to protect
for compilers like xlc or systems like cygwin that might allow the
compiler flag without errors but wouldn't work.

While at it, lower the minimum autoconf required to the one that
introduced the latest macros and tested in OpenBSD 7.5 with automake
1.9.
2024-06-12 12:26:38 +01:00
Philip Hazel
bb8e7e0c72 Add ChangeLog detail for commit 5790662 and advance version in HEAD to 10.45-DEV. 2024-06-09 16:32:28 +01:00
Philip Hazel
6ae58beca0 Final file tidies for 10.44 2024-06-07 15:09:00 +01:00
Martin Joerg
29764f94a9 Fix autoconf test for --enable-jit=auto (#396)
The test is now done in sljitConfigCPU.h
2024-03-23 16:33:05 +00:00
Philip Hazel
ced3b0f06f Increase name length to 128 2024-03-11 15:50:52 +00:00
Philip Hazel
3864abdb71 File tidies for 10.43 2024-02-16 17:12:25 +00:00
Addison Crump
30a3acdcec conditionally enable differential fuzzing (#381) 2024-02-16 15:37:44 +00:00
Philip Hazel
aadef0c3b4 File tidies for 10.43-RC1 release 2023-12-28 16:34:04 +00:00
Carlo Marcelo Arenas Belón
14e0c41be1 admin: update ChangeLog and config.h for recent changes (#286) 2023-08-16 16:56:34 +01:00
Philip Hazel
1e78b77382 Code for variable-length lookbehinds 2023-08-06 15:42:55 +01:00
Carlo Marcelo Arenas Belón
a8a875eb89 windows: integrate visibility attributes without conflicts (#249)
When using a DLL in Windows, the function declarations (and definitions)
that are public are decorated with attributes but those declarations would
conflict with the ones that are selected when the compiler supports the
visibility feature.

Define instead a new macro that would be added to the corresponding
macros independently and while at it allow setting visibility with cmake.
2023-05-16 15:05:13 +01:00
Carlo Marcelo Arenas Belón
29d65e0cd3 pcre2test: print library bitwidth in banner for usability (#227)
While at it update related documentation and missed changes in Changelog
2023-04-15 15:33:57 +01:00
Carlo Marcelo Arenas Belón
10dc79fd1c improve __buitin_mul_overflow() checks (#209)
Use <stddef.h> as a source for size_t as suggested by ANSI in preference
to <sys/types.h> (as suggested by POSIX), and make sure that the check
includes linkin so it won't result in a false positive in platforms that
allow link time resolution of unknown objects (ex: AIX with lxc)
2023-02-11 14:35:27 +00:00
Carlo Marcelo Arenas Belón
4678857266 add a C23 inspired checked integer multiplication helper (#198)
Compilers had become far more creative about optimizing code that
might be considered undefined behaviour, so improve our integer
overflow checking to prevent any possible miscompilations.

While at it, expand the use of the checks to pcre2test to fix a
similar problem to the one that was tackled in pcre2_compile.

Prefer (if available) a builtin provided by the compiler.
2023-02-03 14:52:57 +00:00
Carlo Marcelo Arenas Belón
6068ae19fb build: make the C99 requirement explicit (#193)
Recent code uses C99 syntax (as reported in #163, and therefore it
will fail to build unless C99 (or higher) support is required by the
compiler (gcc >= 5 does it by default).

For those unfortunate to need an older compiler that does require a
flag to enable that, make sure that both autoconf and cmake make it
explicit.

While testing the change with the ancient autoconf version listed as
a prerequisite, noticed that the LT_INIT syntax introduced with 91485e5
(Update configure.ac for latest version of autoconf., 2021-02-02), was
not supported, so update the autoconf minimum as well.
2023-01-19 17:19:02 +00:00
Philip Hazel
d73a949ec1 Refactor heapframe_size code in pcre2test and update documentation for heap frame information 2023-01-18 17:57:07 +00:00
Philip Hazel
52c0884792 Final file tidies for 10.42 2022-12-12 17:16:53 +00:00
Philip Hazel
7c49b40e8a File and documentation tidies for 10.41 release 2022-12-06 15:53:25 +00:00
David Seifert
b513504101 Enable LFS on 32-bit platforms (#153)
* required to support 64-bit filesystems (inodes) on 32-bit platforms:
  https://flameeyes.blog/2010/12/15/another-good-reason-to-use-64-bit-installations-large-file-support-headaches/

Bug: https://bugs.gentoo.org/878475
2022-10-31 15:24:34 +00:00
Philip Hazel
5271b533c4 Fix compiler warning in pcre2test 2022-06-08 17:05:24 +01:00
Philip Hazel
3103b8f20a Final file tidies for 10.40 2022-04-15 16:57:57 +01:00
Carlo Marcelo Arenas Belón
4279abbd7d pcre2test: allow using readline headers for libedit (#99)
At least in OpenBSD, there is a libedit library in base, but without
public headers.  Public headers for readline are available but since
15db5d36 (pcre2test: avoid using readline headers with libedit,
2022-04-07) won't be picked up automatically.

Allow pointing cmake to those headers by doing (for example):

  $ cmake -DEDITLINE_INCLUDE_DIR=/usr/include/readline

Or using custom CPPFLAGS with configure (for example):

  $ CPPFLAGS=-I/usr/include/readline ./configure --enable-pcre2test-libedit

Since the headers from readline.h would be otherwise incomplete, detect
that case and pull the extra headers that are required automagically and
while at it, cleanup the NCURSES dependency that was unnecessarily copied
from readline.
2022-04-14 16:51:51 +01:00
Carlo Marcelo Arenas Belón
9c8abddc52 pcre2test: really allow using libedit when enabled (#96)
* pcre2test: use the right header for libedit in FreeBSD with autoconf

When `./configure --enable-pcre2test-libedit` is used in FreeBSD,
the resulting test will succeed but won't set the necessary flag
to distinguish between libedit and readline header files, therefore
using readline's at built time (if installed)

Consolidate all header tests into one and use instead the corresponding
autogenerated defines to check for each possibility.

* pcre2test: really allow libedit with cmake

Using cmake to configure and enable linking pcre2test with libedit,
could result in a broken build, because the header used was instead
pointing to readline.

In cases were the build will succeed (because both libraries were
available), it would likely show warnings, because several history
functions were being used without declarations, since readline
requires including "history.h" for those.

Additionally, since PCRE2_SUPPORT_READLINE is ON by default (unlike
configure), turning PCRE2_SUPPORT_LIBEDIT=ON, would require setting
that other option to OFF explicitly (even if readline wasn't available)
or the setup would abort.

Lastly, in systems with no default sysroot (ex: macOS), the use of
absolute paths for searching for libedit's readline.h could fail so
use instead relative PATH_SUFFIXES.

* pcre2test: avoid using readline headers with libedit

When asked to enable libedit in a system that ALSO has readline,
the headers of the former would be found and used by the earlier.

While that would mostly work, some functions will be missing
definitions (which is forbidden in C99), so instead abort the
configuration and let the user provide for them.
2022-04-08 17:07:30 +01:00
Carlo Marcelo Arenas Belón
adf76faace pcre2grep: fix build for Hurd (#52)
Since d5a61ee8 (Patch to detect (and ignore) symlink loops in
pcre2grep., 2021-08-28), there is optional code that depends
on readlink and PATH_MAX but that had only detection added for
the first.

GNU Hurd doesn't have the later so it fails to build.

Improve the detection to include both dependencies in autotools
and cmake to fix that.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
2021-11-26 17:31:35 +00:00
Philip Hazel
1ed34b9cb1 Update version to 10.40-RC1 and fix consequent version test issue. 2021-11-09 17:12:50 +00:00
Philip Hazel
3469b13b8e Update docs and version info for 10.39. 2021-10-29 17:03:31 +01:00
Philip Hazel
8d9e91228c Update version number to 10.39-RC1. 2021-10-06 12:00:04 +01:00
Philip Hazel
0612ed77c2 Update dates and tidy files for 10.38 release. 2021-10-01 16:44:09 +01:00
Philip Hazel
e2fde18833 Prepare for 10.38-RC1 release 2021-08-31 17:10:37 +01:00
Philip Hazel
d5a61ee891 Patch to detect (and ignore) symlink loops in pcre2grep. 2021-08-28 17:37:33 +01:00
Philip Hazel
c2fc6cfa0a Revert "Remove dist-bzip2 from AM_INIT_AUTOMAKE in configure.ac because GitHub does not"
This reverts commit 5c0d38b3a8.

I misunderstood GitHub.
2021-08-27 12:06:07 +01:00
Philip Hazel
5c0d38b3a8 Remove dist-bzip2 from AM_INIT_AUTOMAKE in configure.ac because GitHub does not
support .bz2 "assets" for releases so there is no point building it.
2021-08-26 16:32:02 +01:00
Philip.Hazel
1c3256349f Final source changes for 10.37 2021-05-26 14:34:14 +00:00
Philip.Hazel
cd45050ee4 Final file tidies for 10.37-RC1 2021-04-28 16:44:51 +00:00
Philip.Hazel
4cfa216898 Try reducing autoconf requirement to 2.60. 2021-02-06 11:48:06 +00:00