From 078cf9c9e0723d7bae51535d16fdb0eee9d7749a Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Mon, 23 Feb 2026 09:55:35 +0000 Subject: [PATCH 1/3] Configure sym files to solve Solaris SPARC symbol issue --- .gitignore | 4 ++ CMakeLists.txt | 57 +++++++++++++------ Makefile.am | 6 +- README | 8 +-- configure.ac | 32 +++++++++-- maint/README | 2 +- maint/UpdateAlways | 2 +- maint/manifest-tarball | 8 +-- src/{libpcre2-16.sym => libpcre2-16.sym.in} | 3 +- src/{libpcre2-32.sym => libpcre2-32.sym.in} | 3 +- src/{libpcre2-8.sym => libpcre2-8.sym.in} | 3 +- ...bpcre2-posix.sym => libpcre2-posix.sym.in} | 3 +- 12 files changed, 90 insertions(+), 41 deletions(-) rename src/{libpcre2-16.sym => libpcre2-16.sym.in} (99%) rename src/{libpcre2-32.sym => libpcre2-32.sym.in} (99%) rename src/{libpcre2-8.sym => libpcre2-8.sym.in} (98%) rename src/{libpcre2-posix.sym => libpcre2-posix.sym.in} (89%) diff --git a/.gitignore b/.gitignore index 08b044a0c..5de1f646e 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,10 @@ src/config.h src/config.h.in src/pcre2.h src/pcre2_chartables.c +src/libpcre2-8.sym +src/libpcre2-16.sym +src/libpcre2-32.sym +src/libpcre2-posix.sym src/stamp-h1 /bazel-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 8589930ff..95418a45a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,17 @@ check_c_source_compiles( pcre2_check_vscript(HAVE_VSCRIPT VSCRIPT_FLAG) +# On some platforms (e.g. Solaris SPARC), _lib_version is a symbol provided by +# a platform library. When using linker version scripts, all symbols must have +# a defined version, so _lib_version must be listed in the script. However, on +# platforms that do not provide this symbol (e.g. FreeBSD, non-SPARC Solaris), +# the linker will error out if it is listed. Detect whether it is available. + +check_c_source_compiles( + "extern int _lib_version; int main(void) { return _lib_version; }" + HAVE_PLATFORM_LIB_VERSION +) + # Check whether Intel CET is enabled, and if so, adjust compiler flags. This # code was written by PH, trying to imitate the logic from the autotools # configuration. @@ -702,10 +713,6 @@ endif() file(REMOVE ${PROJECT_SOURCE_DIR}/src/config.h) file(REMOVE ${PROJECT_SOURCE_DIR}/src/pcre2.h) -# Output files - -configure_file(src/config-cmake.h.in ${PROJECT_BINARY_DIR}/src/config.h @ONLY) - # Parse version numbers and date out of configure.ac file( @@ -762,13 +769,26 @@ parse_lib_version(LIBPCRE2_8) parse_lib_version(LIBPCRE2_16) parse_lib_version(LIBPCRE2_32) +# Output files + +configure_file(src/config-cmake.h.in ${PROJECT_BINARY_DIR}/src/config.h @ONLY) + configure_file(src/pcre2.h.in ${PROJECT_BINARY_DIR}/interface/pcre2.h @ONLY) configure_file(src/pcre2posix.h ${PROJECT_BINARY_DIR}/interface/pcre2posix.h COPYONLY) -# Make sure to not link debug libs -# against release libs and vice versa -if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") +# Configure the version script files. + +if(HAVE_VSCRIPT AND PCRE2_SYMVERS) + if(HAVE_PLATFORM_LIB_VERSION) + set(PCRE2_EXTRA_LOCAL_SYMS " _lib_version;\n") + else() + set(PCRE2_EXTRA_LOCAL_SYMS "") + endif() + + configure_file(src/libpcre2-8.sym.in ${PROJECT_BINARY_DIR}/src/libpcre2-8.sym @ONLY) + configure_file(src/libpcre2-16.sym.in ${PROJECT_BINARY_DIR}/src/libpcre2-16.sym @ONLY) + configure_file(src/libpcre2-32.sym.in ${PROJECT_BINARY_DIR}/src/libpcre2-32.sym @ONLY) + configure_file(src/libpcre2-posix.sym.in ${PROJECT_BINARY_DIR}/src/libpcre2-posix.sym @ONLY) endif() # Character table generation @@ -893,6 +913,11 @@ if(MSVC) add_compile_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS) endif() +# Make sure to not link debug libs against release libs and vice versa. +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") +endif() + set(TARGETS) set(DLL_PDB_FILES) set(DLL_PDB_DEBUG_FILES) @@ -969,8 +994,8 @@ if(PCRE2_BUILD_PCRE2_8) target_link_libraries(pcre2-8-shared Threads::Threads) endif() if(HAVE_VSCRIPT AND PCRE2_SYMVERS) - target_link_options(pcre2-8-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_SOURCE_DIR}/src/libpcre2-8.sym) - set_target_properties(pcre2-8-shared PROPERTIES LINK_DEPENDS ${PROJECT_SOURCE_DIR}/src/libpcre2-8.sym) + target_link_options(pcre2-8-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_BINARY_DIR}/src/libpcre2-8.sym) + set_target_properties(pcre2-8-shared PROPERTIES LINK_DEPENDS ${PROJECT_BINARY_DIR}/src/libpcre2-8.sym) endif() list(APPEND TARGETS pcre2-8-shared) list(APPEND DLL_PDB_FILES $/pcre2-8.pdb) @@ -992,8 +1017,8 @@ if(PCRE2_BUILD_PCRE2_8) OUTPUT_NAME pcre2-posix ) if(HAVE_VSCRIPT AND PCRE2_SYMVERS) - target_link_options(pcre2-posix-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_SOURCE_DIR}/src/libpcre2-posix.sym) - set_target_properties(pcre2-posix-shared PROPERTIES LINK_DEPENDS ${PROJECT_SOURCE_DIR}/src/libpcre2-posix.sym) + target_link_options(pcre2-posix-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_BINARY_DIR}/src/libpcre2-posix.sym) + set_target_properties(pcre2-posix-shared PROPERTIES LINK_DEPENDS ${PROJECT_BINARY_DIR}/src/libpcre2-posix.sym) endif() target_compile_definitions(pcre2-posix-shared PUBLIC PCRE2POSIX_SHARED) target_link_libraries(pcre2-posix-shared pcre2-8-shared) @@ -1074,8 +1099,8 @@ if(PCRE2_BUILD_PCRE2_16) target_link_libraries(pcre2-16-shared Threads::Threads) endif() if(HAVE_VSCRIPT AND PCRE2_SYMVERS) - target_link_options(pcre2-16-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_SOURCE_DIR}/src/libpcre2-16.sym) - set_target_properties(pcre2-16-shared PROPERTIES LINK_DEPENDS ${PROJECT_SOURCE_DIR}/src/libpcre2-16.sym) + target_link_options(pcre2-16-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_BINARY_DIR}/src/libpcre2-16.sym) + set_target_properties(pcre2-16-shared PROPERTIES LINK_DEPENDS ${PROJECT_BINARY_DIR}/src/libpcre2-16.sym) endif() list(APPEND TARGETS pcre2-16-shared) list(APPEND DLL_PDB_FILES $/pcre2-16.pdb) @@ -1152,8 +1177,8 @@ if(PCRE2_BUILD_PCRE2_32) target_link_libraries(pcre2-32-shared Threads::Threads) endif() if(HAVE_VSCRIPT AND PCRE2_SYMVERS) - target_link_options(pcre2-32-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_SOURCE_DIR}/src/libpcre2-32.sym) - set_target_properties(pcre2-32-shared PROPERTIES LINK_DEPENDS ${PROJECT_SOURCE_DIR}/src/libpcre2-32.sym) + target_link_options(pcre2-32-shared PRIVATE -Wl,${VSCRIPT_FLAG},${PROJECT_BINARY_DIR}/src/libpcre2-32.sym) + set_target_properties(pcre2-32-shared PROPERTIES LINK_DEPENDS ${PROJECT_BINARY_DIR}/src/libpcre2-32.sym) endif() list(APPEND TARGETS pcre2-32-shared) list(APPEND DLL_PDB_FILES $/pcre2-32.pdb) diff --git a/Makefile.am b/Makefile.am index da5e3d912..d06f52e6a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -897,11 +897,11 @@ pkgconfig_DATA += libpcre2-32.pc endif -# Symbol version files for use with GNU and Sun ld. +# Symbol version template files for use with GNU and Sun ld. EXTRA_DIST += \ - src/libpcre2-8.sym src/libpcre2-16.sym src/libpcre2-32.sym \ - src/libpcre2-posix.sym + src/libpcre2-8.sym.in src/libpcre2-16.sym.in src/libpcre2-32.sym.in \ + src/libpcre2-posix.sym.in # gcov/lcov code coverage reporting diff --git a/README b/README index 593bab279..1c064770b 100644 --- a/README +++ b/README @@ -962,10 +962,10 @@ The distribution should contain the files listed below. testdata/testoutput* expected test results testdata/grep* input and output for pcre2grep tests testdata/* other supporting test files - src/libpcre2-8.sym ) - src/libpcre2-16.sym ) symbol version scripts for the GNU and Sun linkers - src/libpcre2-32.sym ) - src/libpcre2-posix.sym ) + src/libpcre2-8.sym.in ) + src/libpcre2-16.sym.in ) symbol version script templates for the + src/libpcre2-32.sym.in ) GNU, BSD and Sun linkers + src/libpcre2-posix.sym.in ) (D) Auxiliary files for CMake support diff --git a/configure.ac b/configure.ac index a034e3d7a..7a75619d3 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,26 @@ PCRE2_VISIBILITY AX_CHECK_VSCRIPT +# On some platforms (e.g. Solaris SPARC), _lib_version is a symbol provided by +# a platform library. When using linker version scripts, all symbols must have +# a defined version, so _lib_version must be listed in the script. However, on +# platforms that do not provide this symbol (e.g. FreeBSD, non-SPARC Solaris), +# the linker will error out if it is listed. Detect whether it is available. + +AS_IF([test x$ax_check_vscript_flag != x], + [AC_MSG_CHECKING([whether _lib_version symbol is provided by the platform]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([extern int _lib_version;], [return _lib_version;])], + [pcre2_have_lib_version=yes], + [pcre2_have_lib_version=no]) + AC_MSG_RESULT([$pcre2_have_lib_version]) + AS_IF([test "x$pcre2_have_lib_version" = xyes], + [PCRE2_EXTRA_LOCAL_SYMS=" _lib_version;"], + [PCRE2_EXTRA_LOCAL_SYMS=""]) + ], + [PCRE2_EXTRA_LOCAL_SYMS=""]) +AC_SUBST([PCRE2_EXTRA_LOCAL_SYMS]) + # Check for Clang __attribute__((uninitialized)) feature AC_MSG_CHECKING([for __attribute__((uninitialized))]) @@ -1045,16 +1065,16 @@ EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \ if test x$ax_check_vscript_flag != x ; then EXTRA_LIBPCRE2_8_LDFLAGS="$EXTRA_LIBPCRE2_8_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(srcdir)/src/libpcre2-8.sym" + -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-8.sym" EXTRA_LIBPCRE2_16_LDFLAGS="$EXTRA_LIBPCRE2_16_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(srcdir)/src/libpcre2-16.sym" + -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-16.sym" EXTRA_LIBPCRE2_32_LDFLAGS="$EXTRA_LIBPCRE2_32_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(srcdir)/src/libpcre2-32.sym" + -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-32.sym" EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(srcdir)/src/libpcre2-posix.sym" + -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-posix.sym" fi AC_SUBST(EXTRA_LIBPCRE2_8_LDFLAGS) @@ -1208,6 +1228,10 @@ AC_CONFIG_FILES( libpcre2-posix.pc pcre2-config src/pcre2.h + src/libpcre2-8.sym + src/libpcre2-16.sym + src/libpcre2-32.sym + src/libpcre2-posix.sym ) # Make the generated script files executable. diff --git a/maint/README b/maint/README index 68dd4e308..290ed14a0 100644 --- a/maint/README +++ b/maint/README @@ -263,7 +263,7 @@ new release. * Update the library version numbers in configure.ac according to the rules given below. -* Add the new library version to the src/libpcre2-*.sym files (even if no new +* Add the new library version to the src/libpcre2-*.sym.in files (even if no new symbols have been added since the last release). * Push all these changes to main. diff --git a/maint/UpdateAlways b/maint/UpdateAlways index da428dc9c..19bf0ce3c 100755 --- a/maint/UpdateAlways +++ b/maint/UpdateAlways @@ -255,7 +255,7 @@ txt_files=( m4/pcre2_zos.m4 doc/p* doc/html/* - src/libpcre2-*.sym + src/libpcre2-*.sym.in ) crlf_files=( diff --git a/maint/manifest-tarball b/maint/manifest-tarball index be0ef0d66..ea96d293e 100644 --- a/maint/manifest-tarball +++ b/maint/manifest-tarball @@ -307,10 +307,10 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/src -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/config-cmake.h.in -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/config.h.generic -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/config.h.in --rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-16.sym --rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-32.sym --rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-8.sym --rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-posix.sym +-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-16.sym.in +-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-32.sym.in +-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-8.sym.in +-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/libpcre2-posix.sym.in -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2.h.generic -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2.h.in -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_auto_possess.c diff --git a/src/libpcre2-16.sym b/src/libpcre2-16.sym.in similarity index 99% rename from src/libpcre2-16.sym rename to src/libpcre2-16.sym.in index 3af7ac79b..eddd043c9 100644 --- a/src/libpcre2-16.sym +++ b/src/libpcre2-16.sym.in @@ -83,7 +83,6 @@ PCRE2_10.47 { local: _fini; _init; - _lib_version; -}; +@PCRE2_EXTRA_LOCAL_SYMS@}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-32.sym b/src/libpcre2-32.sym.in similarity index 99% rename from src/libpcre2-32.sym rename to src/libpcre2-32.sym.in index 78d4081be..f44bc07f1 100644 --- a/src/libpcre2-32.sym +++ b/src/libpcre2-32.sym.in @@ -83,7 +83,6 @@ PCRE2_10.47 { local: _fini; _init; - _lib_version; -}; +@PCRE2_EXTRA_LOCAL_SYMS@}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-8.sym b/src/libpcre2-8.sym.in similarity index 98% rename from src/libpcre2-8.sym rename to src/libpcre2-8.sym.in index 90e6c4bf9..b12928ec6 100644 --- a/src/libpcre2-8.sym +++ b/src/libpcre2-8.sym.in @@ -83,7 +83,6 @@ PCRE2_10.47 { local: _fini; _init; - _lib_version; -}; +@PCRE2_EXTRA_LOCAL_SYMS@}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-posix.sym b/src/libpcre2-posix.sym.in similarity index 89% rename from src/libpcre2-posix.sym rename to src/libpcre2-posix.sym.in index 5224016b7..b0cf22fa1 100644 --- a/src/libpcre2-posix.sym +++ b/src/libpcre2-posix.sym.in @@ -8,7 +8,6 @@ PCRE2_10.47 { local: _fini; _init; - _lib_version; -}; +@PCRE2_EXTRA_LOCAL_SYMS@}; # PCRE2_10.48 {} PCRE2_10.47; From ffc4c6278d6e0800449c7bdda649c246f5c59000 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:59:25 +0000 Subject: [PATCH 2/3] Sync autogenerated files #noupdate --- doc/html/README.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/html/README.txt b/doc/html/README.txt index 593bab279..1c064770b 100644 --- a/doc/html/README.txt +++ b/doc/html/README.txt @@ -962,10 +962,10 @@ The distribution should contain the files listed below. testdata/testoutput* expected test results testdata/grep* input and output for pcre2grep tests testdata/* other supporting test files - src/libpcre2-8.sym ) - src/libpcre2-16.sym ) symbol version scripts for the GNU and Sun linkers - src/libpcre2-32.sym ) - src/libpcre2-posix.sym ) + src/libpcre2-8.sym.in ) + src/libpcre2-16.sym.in ) symbol version script templates for the + src/libpcre2-32.sym.in ) GNU, BSD and Sun linkers + src/libpcre2-posix.sym.in ) (D) Auxiliary files for CMake support From c6b7255d3b90062fefee5f11127272252aa58955 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Mon, 23 Feb 2026 14:46:39 +0000 Subject: [PATCH 3/3] Do some experimentation for the BSD/Solaris builds --- .gitignore | 1 + CMakeLists.txt | 19 +---- Makefile.am | 2 +- cmake/PCRE2CheckVscript.cmake | 153 ++++++++++++++++++++-------------- configure.ac | 49 +++++------ m4/ax_check_vscript.m4 | 153 ---------------------------------- m4/pcre2_check_vscript.m4 | 118 ++++++++++++++++++++++++++ maint/UpdateAlways | 2 +- maint/manifest-tarball | 2 +- src/libpcre2-16.sym.in | 7 +- src/libpcre2-32.sym.in | 7 +- src/libpcre2-8.sym.in | 7 +- src/libpcre2-posix.sym.in | 7 +- 13 files changed, 250 insertions(+), 277 deletions(-) delete mode 100644 m4/ax_check_vscript.m4 create mode 100644 m4/pcre2_check_vscript.m4 diff --git a/.gitignore b/.gitignore index 5de1f646e..4ffdb8594 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ config.guess config.log config.status config.sub +config.lt configure depcomp install-sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 95418a45a..34ef6596c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,18 +274,7 @@ check_c_source_compiles( # Detect support for linker scripts. -pcre2_check_vscript(HAVE_VSCRIPT VSCRIPT_FLAG) - -# On some platforms (e.g. Solaris SPARC), _lib_version is a symbol provided by -# a platform library. When using linker version scripts, all symbols must have -# a defined version, so _lib_version must be listed in the script. However, on -# platforms that do not provide this symbol (e.g. FreeBSD, non-SPARC Solaris), -# the linker will error out if it is listed. Detect whether it is available. - -check_c_source_compiles( - "extern int _lib_version; int main(void) { return _lib_version; }" - HAVE_PLATFORM_LIB_VERSION -) +pcre2_check_vscript(HAVE_VSCRIPT VSCRIPT_FLAG HAVE_VSCRIPT_NO_STAR) # Check whether Intel CET is enabled, and if so, adjust compiler flags. This # code was written by PH, trying to imitate the logic from the autotools @@ -779,10 +768,10 @@ configure_file(src/pcre2posix.h ${PROJECT_BINARY_DIR}/interface/pcre2posix.h COP # Configure the version script files. if(HAVE_VSCRIPT AND PCRE2_SYMVERS) - if(HAVE_PLATFORM_LIB_VERSION) - set(PCRE2_EXTRA_LOCAL_SYMS " _lib_version;\n") - else() + if(HAVE_VSCRIPT_NO_STAR) set(PCRE2_EXTRA_LOCAL_SYMS "") + else() + set(PCRE2_EXTRA_LOCAL_SYMS " local: *;") endif() configure_file(src/libpcre2-8.sym.in ${PROJECT_BINARY_DIR}/src/libpcre2-8.sym @ONLY) diff --git a/Makefile.am b/Makefile.am index d06f52e6a..3a6a5da1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -278,8 +278,8 @@ EXTRA_DIST = # These files contain additional m4 macros that are used by autoconf. EXTRA_DIST += \ - m4/ax_check_vscript.m4 \ m4/ax_pthread.m4 \ + m4/pcre2_check_vscript.m4 \ m4/pcre2_visibility.m4 \ m4/pcre2_zos.m4 diff --git a/cmake/PCRE2CheckVscript.cmake b/cmake/PCRE2CheckVscript.cmake index ed3ae12f8..eeda4c004 100644 --- a/cmake/PCRE2CheckVscript.cmake +++ b/cmake/PCRE2CheckVscript.cmake @@ -4,9 +4,63 @@ # support is detected then sets "flag_var" to the appropriate flag to pass to # the linker (namely, --version-script or -M). -function(pcre2_check_vscript have_var flag_var) +# Helper function: try to compile a shared library with a given linker flag and +# version script. This properly tests version script support by building a +# shared library rather than an executable, avoiding issues with +# executable-specific symbols (e.g. FreeBSD's crt1.o symbols, Solaris linker +# symbols in values-Xc.o). +function(_pcre2_try_vscript_shared_lib link_flag map_file result_var) + if(DEFINED ${result_var}) + return() + endif() + + message(STATUS "Performing Test ${result_var}") + + set(${result_var} FALSE PARENT_SCOPE) + + set(try_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeScratch/CheckVscript") + file(REMOVE_RECURSE "${try_dir}") + file(MAKE_DIRECTORY "${try_dir}") + + # Write a minimal C source with exported symbols + file(WRITE "${try_dir}/test_vscript.c" " +int hidethis(void) { return 0; } +int exposethis(void) { return hidethis(); } +") + + # Write a CMakeLists.txt that builds a shared library with the version script + file(WRITE "${try_dir}/CMakeLists.txt" " +cmake_minimum_required(VERSION 3.15) +project(test_vscript C) +add_library(test_vscript SHARED test_vscript.c) +target_link_options(test_vscript PRIVATE \"-Wl,${link_flag},${map_file}\") +") + + try_compile( + compile_result + "${try_dir}/build" # BINARY_DIR + "${try_dir}" # SOURCE_DIR + test_vscript # Project name + OUTPUT_VARIABLE compile_output + ) + + if(compile_result) + set(${result_var} TRUE PARENT_SCOPE) + endif() + + if(${compile_result}) + set(${result_var} 1 CACHE INTERNAL "Test ${result_var}") + message(STATUS "Performing Test ${result_var} - Success") + else() + set(${result_var} "" CACHE INTERNAL "Test ${result_var}") + message(STATUS "Performing Test ${result_var} - Failed") + endif() +endfunction() + +function(pcre2_check_vscript have_var flag_var no_star_var) set(${have_var} FALSE PARENT_SCOPE) set(${flag_var} "" PARENT_SCOPE) + set(${no_star_var} FALSE PARENT_SCOPE) if(MSVC) return() @@ -18,95 +72,70 @@ function(pcre2_check_vscript have_var flag_var) message(STATUS "Detecting linker version script support") endif() - include(CheckCSourceCompiles) - include(CMakePushCheckState) - - # The BSD file here is a workaround for the fact that check_c_source_compiles - # very unfortunately only supports linking executables - # with an entrypoint (or a static library), and yet the symbol visibility - # requirements for executables are understandably different on some platforms - # as compared to linking a shared library. On FreeBSD, linking fails if you - # use the linker script to hide various global symbols from /usr/lib/crt1.o. - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269370 - # Basically, everyone using --version-script is actually going to be creating - # a shared library. It's a frustrating mismatch. - file(WRITE ${PROJECT_BINARY_DIR}/test-map-file.sym "PCRE2_10.00 { global: exposethis; local: *; };") - file(WRITE ${PROJECT_BINARY_DIR}/test-map-file-bsd.sym "PCRE2_10.00 { global: exposethis; environ; __progname; local: *; };") - file(WRITE ${PROJECT_BINARY_DIR}/test-map-file-broken.sym "PCRE2_10.00 { global: exposethis; local: *; }; {") + # Write test version script files + file(WRITE "${PROJECT_BINARY_DIR}/test-map-file.sym" "PCRE2_10.00 { global: exposethis; local: *; };") + file(WRITE "${PROJECT_BINARY_DIR}/test-map-file-broken.sym" "PCRE2_10.00 { global: exposethis; local: *; }; {") + file(WRITE "${PROJECT_BINARY_DIR}/test-map-file-no-star.sym" "PCRE2_10.00 { global: exposethis; local: hidethis; };") set(HAVE_VSCRIPT FALSE) - # Using an executable to check for version-script support is rather delicate, - # because linking in an entrypoint (main) adds extra symbols into the mix. - # If CMake ever added a SHARED_LIBRARY option to check_c_source_compiles, we'd - # use it here. - set( - test_source - [=[ - int exposethis = 0, hidethis = 0; - int main(void) { - return exposethis + hidethis; - } - ]=] - ) - - cmake_push_check_state(RESET) - set(CMAKE_REQUIRED_QUIET TRUE) - - set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script,${PROJECT_BINARY_DIR}/test-map-file.sym") - check_c_source_compiles("${test_source}" HAVE_VSCRIPT_GNU) + # Test GNU ld --version-script flag + _pcre2_try_vscript_shared_lib("--version-script" "${PROJECT_BINARY_DIR}/test-map-file.sym" HAVE_VSCRIPT_GNU) if(HAVE_VSCRIPT_GNU) set(VSCRIPT_FLAG --version-script) set(HAVE_VSCRIPT TRUE) else() - set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script,${PROJECT_BINARY_DIR}/test-map-file-bsd.sym") - check_c_source_compiles("${test_source}" HAVE_VSCRIPT_BSD) + # Test Sun linker -M flag + _pcre2_try_vscript_shared_lib("-M" "${PROJECT_BINARY_DIR}/test-map-file.sym" HAVE_VSCRIPT_SUN) - if(HAVE_VSCRIPT_BSD) - set(VSCRIPT_FLAG --version-script) + if(HAVE_VSCRIPT_SUN) + set(VSCRIPT_FLAG -M) set(HAVE_VSCRIPT TRUE) - else() - set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,-M,${PROJECT_BINARY_DIR}/test-map-file.sym") - check_c_source_compiles("${test_source}" HAVE_VSCRIPT_SUN) - - if(HAVE_VSCRIPT_SUN) - set(VSCRIPT_FLAG -M) - set(HAVE_VSCRIPT TRUE) - endif() endif() endif() if(HAVE_VSCRIPT) # Perform the same logic as ax_check_vscript.m4, to test whether the linker # silently ignores (and overwrites) linker scripts it doesn't understand. - set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,${VSCRIPT_FLAG},${PROJECT_BINARY_DIR}/test-map-file-broken.sym") - check_c_source_compiles("${test_source}" HAVE_VSCRIPT_BROKEN) + _pcre2_try_vscript_shared_lib("${VSCRIPT_FLAG}" "${PROJECT_BINARY_DIR}/test-map-file-broken.sym" HAVE_VSCRIPT_BROKEN) if(HAVE_VSCRIPT_BROKEN) set(HAVE_VSCRIPT FALSE) - if(first_run) - message(STATUS "Detecting linker version script support - no (linker overwrites unknown scripts)") - endif() - else() - if(first_run) - message(STATUS "Detecting linker version script support - yes (${VSCRIPT_FLAG})") - endif() endif() - else() - if(first_run) + endif() + + if(first_run) + if(HAVE_VSCRIPT) + message(STATUS "Detecting linker version script support - yes (${VSCRIPT_FLAG})") + elseif(HAVE_VSCRIPT_BROKEN) + message(STATUS "Detecting linker version script support - no (linker overwrites unknown scripts)") + else() message(STATUS "Detecting linker version script support - none detected") endif() endif() - cmake_pop_check_state() + if(HAVE_VSCRIPT) + if(first_run) + message(STATUS "Detecting if version scripts work without wildcard") + endif() + + # Test that the linker works without requiring a wildcard to hide platform-specific + # symbols (_init, _fini, etc.). + _pcre2_try_vscript_shared_lib("${VSCRIPT_FLAG}" "${PROJECT_BINARY_DIR}/test-map-file-no-star.sym" HAVE_VSCRIPT_NO_STAR) + + if(first_run) + message(STATUS "Detecting if version scripts work without wildcard - ${HAVE_VSCRIPT_NO_STAR}") + endif() + endif() - file(REMOVE ${PROJECT_BINARY_DIR}/test-map-file.sym) - file(REMOVE ${PROJECT_BINARY_DIR}/test-map-file-bsd.sym) - file(REMOVE ${PROJECT_BINARY_DIR}/test-map-file-broken.sym) + file(REMOVE "${PROJECT_BINARY_DIR}/test-map-file.sym") + file(REMOVE "${PROJECT_BINARY_DIR}/test-map-file-broken.sym") + file(REMOVE "${PROJECT_BINARY_DIR}/test-map-file-no-star.sym") if(HAVE_VSCRIPT) set(${have_var} TRUE PARENT_SCOPE) set(${flag_var} "${VSCRIPT_FLAG}" PARENT_SCOPE) + set(${no_star_var} "${HAVE_VSCRIPT_NO_STAR}" PARENT_SCOPE) endif() endfunction() diff --git a/configure.ac b/configure.ac index 7a75619d3..dfe545b11 100644 --- a/configure.ac +++ b/configure.ac @@ -76,9 +76,13 @@ AC_TYPE_INT64_T PCRE2_ZOS_FIXES AC_PROG_INSTALL -LT_INIT([win32-dll]) AC_PROG_LN_S +# As well as LT_INIT, we use LT_OUTPUT so that PCRE2_CHECK_VSCRIPT can invoke +# libtool to test version scripts correctly. +LT_INIT([win32-dll]) +LT_OUTPUT + AC_SYS_LARGEFILE # Check for GCC visibility feature @@ -87,27 +91,7 @@ PCRE2_VISIBILITY # Check for the availability of -Wl,--version-script (or -Wl,-M on Solaris) -AX_CHECK_VSCRIPT - -# On some platforms (e.g. Solaris SPARC), _lib_version is a symbol provided by -# a platform library. When using linker version scripts, all symbols must have -# a defined version, so _lib_version must be listed in the script. However, on -# platforms that do not provide this symbol (e.g. FreeBSD, non-SPARC Solaris), -# the linker will error out if it is listed. Detect whether it is available. - -AS_IF([test x$ax_check_vscript_flag != x], - [AC_MSG_CHECKING([whether _lib_version symbol is provided by the platform]) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([extern int _lib_version;], [return _lib_version;])], - [pcre2_have_lib_version=yes], - [pcre2_have_lib_version=no]) - AC_MSG_RESULT([$pcre2_have_lib_version]) - AS_IF([test "x$pcre2_have_lib_version" = xyes], - [PCRE2_EXTRA_LOCAL_SYMS=" _lib_version;"], - [PCRE2_EXTRA_LOCAL_SYMS=""]) - ], - [PCRE2_EXTRA_LOCAL_SYMS=""]) -AC_SUBST([PCRE2_EXTRA_LOCAL_SYMS]) +PCRE2_CHECK_VSCRIPT # Check for Clang __attribute__((uninitialized)) feature @@ -1063,18 +1047,18 @@ EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \ # Append each library's version script, if the platform supports it. -if test x$ax_check_vscript_flag != x ; then +if test x$pcre2_check_vscript_flag != x ; then EXTRA_LIBPCRE2_8_LDFLAGS="$EXTRA_LIBPCRE2_8_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-8.sym" + -Wl,$pcre2_check_vscript_flag,\$(builddir)/src/libpcre2-8.sym" EXTRA_LIBPCRE2_16_LDFLAGS="$EXTRA_LIBPCRE2_16_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-16.sym" + -Wl,$pcre2_check_vscript_flag,\$(builddir)/src/libpcre2-16.sym" EXTRA_LIBPCRE2_32_LDFLAGS="$EXTRA_LIBPCRE2_32_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-32.sym" + -Wl,$pcre2_check_vscript_flag,\$(builddir)/src/libpcre2-32.sym" EXTRA_LIBPCRE2_POSIX_LDFLAGS="$EXTRA_LIBPCRE2_POSIX_LDFLAGS \ - -Wl,$ax_check_vscript_flag,\$(builddir)/src/libpcre2-posix.sym" + -Wl,$pcre2_check_vscript_flag,\$(builddir)/src/libpcre2-posix.sym" fi AC_SUBST(EXTRA_LIBPCRE2_8_LDFLAGS) @@ -1218,6 +1202,15 @@ AC_LANG_POP([C]) # Pass empty LIB_POSTFIX to *.pc files and pcre2-config here. AC_SUBST(LIB_POSTFIX) +# Set the extra "local: *" symbol section conditionally for Solaris (effectively). + +if test x$pcre2_check_vscript_flag != x && test x$pcre2_check_vscript_no_star = xno; then + PCRE2_EXTRA_LOCAL_SYMS=" local: *;" +else + PCRE2_EXTRA_LOCAL_SYMS="" +fi +AC_SUBST([PCRE2_EXTRA_LOCAL_SYMS]) + # Produce these files, in addition to config.h. AC_CONFIG_FILES( @@ -1274,7 +1267,7 @@ fi with_symbol_versioning=n/a if test x$want_symvers != xyes; then with_symbol_versioning=no -elif test x$ax_check_vscript_flag != x; then +elif test x$pcre2_check_vscript_flag != x; then with_symbol_versioning=yes fi diff --git a/m4/ax_check_vscript.m4 b/m4/ax_check_vscript.m4 deleted file mode 100644 index ed834ef61..000000000 --- a/m4/ax_check_vscript.m4 +++ /dev/null @@ -1,153 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_vscript.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_VSCRIPT -# -# DESCRIPTION -# -# Check whether the linker supports version scripts. Version scripts are -# used when building shared libraries to bind symbols to version nodes -# (helping to detect incompatibilities) or to limit the visibility of -# non-public symbols. -# -# Output: -# -# If version scripts are supported, VSCRIPT_LDFLAGS will contain the -# appropriate flag to pass to the linker. On GNU systems this would -# typically be "-Wl,--version-script", and on Solaris it would typically -# be "-Wl,-M". -# -# Two Automake conditionals are also set: -# -# HAVE_VSCRIPT is true if the linker supports version scripts with -# entries that use simple wildcards, like "local: *". -# -# HAVE_VSCRIPT_COMPLEX is true if the linker supports version scripts with -# pattern matching wildcards, like "global: Java_*". -# -# On systems that do not support symbol versioning, such as Mac OS X, both -# conditionals will be false. They will also be false if the user passes -# "--disable-symvers" on the configure command line. -# -# Example: -# -# configure.ac: -# -# AX_CHECK_VSCRIPT -# -# Makefile.am: -# -# if HAVE_VSCRIPT -# libfoo_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libfoo.map -# endif -# -# if HAVE_VSCRIPT_COMPLEX -# libbar_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbar.map -# endif -# -# LICENSE -# -# Copyright (c) 2014 Kevin Cernekee -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2.99 PCRE2 - -# _AX_CHECK_VSCRIPT(flag, global-sym, action-if-link-succeeds, [junk-file=no]) -AC_DEFUN([_AX_CHECK_VSCRIPT], [ - AC_LANG_PUSH([C]) - ax_check_vscript_save_flags="$LDFLAGS" - echo "V1 { global: $2; local: *; };" > conftest.map - AS_IF([test x$4 = xyes], [ - echo "{" >> conftest.map - ]) - LDFLAGS="$LDFLAGS -Wl,$1,conftest.map" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[int show, hide;]], [])], [$3]) - LDFLAGS="$ax_check_vscript_save_flags" - rm -f conftest.map - AC_LANG_POP([C]) -]) dnl _AX_CHECK_VSCRIPT - -AC_DEFUN([AX_CHECK_VSCRIPT], [ - - AC_ARG_ENABLE([symvers], - AS_HELP_STRING([--disable-symvers], - [disable library symbol versioning [default=auto]]), - [want_symvers=$enableval], - [want_symvers=yes] - ) - - AS_IF([test x$want_symvers = xyes], [ - - dnl First test --version-script and -M with a simple wildcard. - - AC_CACHE_CHECK([linker version script flag], ax_cv_check_vscript_flag, [ - ax_cv_check_vscript_flag=unsupported - _AX_CHECK_VSCRIPT([--version-script], [show], [ - ax_cv_check_vscript_flag=--version-script - ]) - AS_IF([test x$ax_cv_check_vscript_flag = xunsupported], [ - # PCRE2: Support for FreeBSD. Rather annoyingly, AC_LINK_IFELSE will - # only test linking executables, and in turn, on FreeBSD the main - # entrypoint will fail to link if you use "local: *" to hide the - # visibility of various shared symbols injected from /usr/lib/crt1.o. - # It's not at all pretty to hardcode those symbol names here, but I - # can't think of an obvious way to improve on this. - _AX_CHECK_VSCRIPT([--version-script], [show;environ;__progname], [ - ax_cv_check_vscript_flag=--version-script - ]) - ]) - AS_IF([test x$ax_cv_check_vscript_flag = xunsupported], [ - _AX_CHECK_VSCRIPT([-M], [show], [ax_cv_check_vscript_flag=-M]) - ]) - - dnl The linker may interpret -M (no argument) as "produce a load map." - dnl If "-M conftest.map" doesn't fail when conftest.map contains - dnl obvious syntax errors, assume this is the case. - - AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [ - _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [show], - [ax_cv_check_vscript_flag=unsupported], [yes]) - ]) - ]) - - dnl If the simple wildcard worked, retest with a complex wildcard. - - AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [ - ax_check_vscript_flag=$ax_cv_check_vscript_flag - AC_CACHE_CHECK([if version scripts can use complex wildcards], - ax_cv_check_vscript_complex_wildcards, [ - ax_cv_check_vscript_complex_wildcards=no - _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [sh*], [ - ax_cv_check_vscript_complex_wildcards=yes]) - ]) - ax_check_vscript_complex_wildcards="$ax_cv_check_vscript_complex_wildcards" - ], [ - ax_check_vscript_flag= - ax_check_vscript_complex_wildcards=no - ]) - ], [ - AC_MSG_CHECKING([linker version script flag]) - AC_MSG_RESULT([disabled]) - - ax_check_vscript_flag= - ax_check_vscript_complex_wildcards=no - ]) - - AS_IF([test x$ax_check_vscript_flag != x], [ - VSCRIPT_LDFLAGS="-Wl,$ax_check_vscript_flag" - AC_SUBST([VSCRIPT_LDFLAGS]) - ]) - - AM_CONDITIONAL([HAVE_VSCRIPT], - [test x$ax_check_vscript_flag != x]) - AM_CONDITIONAL([HAVE_VSCRIPT_COMPLEX], - [test x$ax_check_vscript_complex_wildcards = xyes]) - -]) dnl AX_CHECK_VSCRIPT diff --git a/m4/pcre2_check_vscript.m4 b/m4/pcre2_check_vscript.m4 new file mode 100644 index 000000000..cfe67e48b --- /dev/null +++ b/m4/pcre2_check_vscript.m4 @@ -0,0 +1,118 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_vscript.html +# =========================================================================== +# +# Our pcre2_check_vscript.m4 is derived from the upstream ax_check_vscript.m4, +# with several modifications. +# +# The original upstream file requires the following notice: +# +# LICENSE +# +# Copyright (c) 2014 Kevin Cernekee +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2.99 PCRE2 + +# _PCRE2_CHECK_VSCRIPT_SHLIB(flag, map-contents, action-if-link-succeeds) +# Build a shared library with the given linker flag and map file contents. +# This properly tests version script support by building a shared library +# rather than an executable, avoiding issues with executable-specific symbols +# (e.g. FreeBSD's crt1.o symbols, Solaris linker symbols in values-Xc.o). +# Uses libtool for portability across different platforms. +AC_DEFUN([_PCRE2_CHECK_VSCRIPT_SHLIB], [ + rm -rf conftest.vscript + mkdir conftest.vscript + cat > conftest.vscript/conftest.c <<_ACEOF +int hidethis(void) { return 0; } +int exposethis(void) { return hidethis(); } +_ACEOF + echo "$2" > conftest.vscript/conftest.map + _pcre2_abs_top_builddir="$ac_pwd" + _pcre2_vscript_libtool="$SHELL $_pcre2_abs_top_builddir/libtool" + _pcre2_vscript_cc="$CC" + _pcre2_vscript_compile_flags="$CFLAGS $CPPFLAGS" + _pcre2_vscript_ld_flags="$CFLAGS $LDFLAGS" + _pcre2_vscript_script_flag="$1" + export _pcre2_vscript_libtool + export _pcre2_vscript_cc + export _pcre2_vscript_compile_flags + export _pcre2_vscript_ld_flags + export _pcre2_vscript_script_flag + AS_IF([(cd conftest.vscript && \ + $_pcre2_vscript_libtool --tag=CC --mode=compile $_pcre2_vscript_cc $_pcre2_vscript_compile_flags -c -o conftest.lo conftest.c && \ + $_pcre2_vscript_libtool --tag=CC --mode=link $_pcre2_vscript_cc $_pcre2_vscript_ld_flags -o libconftest.la conftest.lo -rpath /usr/lib -Wl,$_pcre2_vscript_script_flag,conftest.map) >&AS_MESSAGE_LOG_FD 2>&1], [$3]) + unset _pcre2_vscript_libtool + unset _pcre2_vscript_cc + unset _pcre2_vscript_compile_flags + unset _pcre2_vscript_ld_flags + unset _pcre2_vscript_script_flag + rm -rf conftest.vscript +]) dnl _PCRE2_CHECK_VSCRIPT_SHLIB + +AC_DEFUN([PCRE2_CHECK_VSCRIPT], [ + + AC_ARG_ENABLE([symvers], + AS_HELP_STRING([--disable-symvers], + [disable library symbol versioning [default=auto]]), + [want_symvers=$enableval], + [want_symvers=yes] + ) + + AS_IF([test x$want_symvers = xyes], [ + + dnl First, test --version-script and -M with a simple wildcard. + AC_CACHE_CHECK([linker version script flag], pcre2_cv_check_vscript_flag, [ + pcre2_cv_check_vscript_flag=unsupported + + _PCRE2_CHECK_VSCRIPT_SHLIB([--version-script], + [PCRE2_10.00 { global: exposethis; local: *; };], + [pcre2_cv_check_vscript_flag=--version-script]) + AS_IF([test x$pcre2_cv_check_vscript_flag = xunsupported], [ + _PCRE2_CHECK_VSCRIPT_SHLIB([-M], + [PCRE2_10.00 { global: exposethis; local: *; };], + [pcre2_cv_check_vscript_flag=-M]) + ]) + + dnl The linker may interpret -M (no argument) as "produce a load map." + dnl If "-M conftest.map" doesn't fail when conftest.map contains + dnl obvious syntax errors, assume this is the case. + + AS_IF([test x$pcre2_cv_check_vscript_flag != xunsupported], [ + _PCRE2_CHECK_VSCRIPT_SHLIB([$pcre2_cv_check_vscript_flag], + [PCRE2_10.00 { global: exposethis; local: *; }; {], + [pcre2_cv_check_vscript_flag=unsupported]) + ]) + ]) + + AS_IF([test x$pcre2_cv_check_vscript_flag != xunsupported], [ + + dnl Test without wildcard - for detecting Solaris, which requires the + dnl wildcard (or else a much more complex and brittle configuration). + AC_CACHE_CHECK([if version scripts work without wildcard], + pcre2_cv_check_vscript_no_star, [ + pcre2_cv_check_vscript_no_star=no + _PCRE2_CHECK_VSCRIPT_SHLIB([$pcre2_cv_check_vscript_flag], + [PCRE2_10.00 { global: exposethis; local: hidethis; };], + [pcre2_cv_check_vscript_no_star=yes]) + ]) + + pcre2_check_vscript_flag=$pcre2_cv_check_vscript_flag + pcre2_check_vscript_no_star=$pcre2_cv_check_vscript_no_star + ], [ + pcre2_check_vscript_flag= + pcre2_check_vscript_no_star=no + ]) + ], [ + AC_MSG_CHECKING([linker version script flag]) + AC_MSG_RESULT([disabled]) + + pcre2_check_vscript_flag= + pcre2_check_vscript_no_star=no + ]) + +]) dnl PCRE2_CHECK_VSCRIPT diff --git a/maint/UpdateAlways b/maint/UpdateAlways index 19bf0ce3c..a6e96d638 100755 --- a/maint/UpdateAlways +++ b/maint/UpdateAlways @@ -249,8 +249,8 @@ txt_files=( perltest.sh cmake/COPYING-CMAKE-SCRIPTS cmake/{*.cmake,*.cmake.in} - m4/ax_check_vscript.m4 m4/ax_pthread.m4 + m4/pcre2_check_vscript.m4 m4/pcre2_visibility.m4 m4/pcre2_zos.m4 doc/p* diff --git a/maint/manifest-tarball b/maint/manifest-tarball index ea96d293e..720c5f641 100644 --- a/maint/manifest-tarball +++ b/maint/manifest-tarball @@ -291,13 +291,13 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/doc/html -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/libpcre2-posix.pc.in -rwxr-xr-x tarball-dir/pcre2-SNAPSHOT/ltmain.sh drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/m4 --rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/ax_check_vscript.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/ax_pthread.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/libtool.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/ltoptions.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/ltsugar.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/ltversion.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/lt~obsolete.m4 +-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/pcre2_check_vscript.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/pcre2_visibility.m4 -rw-r--r-- tarball-dir/pcre2-SNAPSHOT/m4/pcre2_zos.m4 -rwxr-xr-x tarball-dir/pcre2-SNAPSHOT/missing diff --git a/src/libpcre2-16.sym.in b/src/libpcre2-16.sym.in index eddd043c9..60e103a6b 100644 --- a/src/libpcre2-16.sym.in +++ b/src/libpcre2-16.sym.in @@ -80,9 +80,8 @@ PCRE2_10.47 { pcre2_substring_list_get_16; pcre2_substring_nametable_scan_16; pcre2_substring_number_from_name_16; - local: - _fini; - _init; -@PCRE2_EXTRA_LOCAL_SYMS@}; + +@PCRE2_EXTRA_LOCAL_SYMS@ +}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-32.sym.in b/src/libpcre2-32.sym.in index f44bc07f1..698ccc21e 100644 --- a/src/libpcre2-32.sym.in +++ b/src/libpcre2-32.sym.in @@ -80,9 +80,8 @@ PCRE2_10.47 { pcre2_substring_list_get_32; pcre2_substring_nametable_scan_32; pcre2_substring_number_from_name_32; - local: - _fini; - _init; -@PCRE2_EXTRA_LOCAL_SYMS@}; + +@PCRE2_EXTRA_LOCAL_SYMS@ +}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-8.sym.in b/src/libpcre2-8.sym.in index b12928ec6..a7a54a683 100644 --- a/src/libpcre2-8.sym.in +++ b/src/libpcre2-8.sym.in @@ -80,9 +80,8 @@ PCRE2_10.47 { pcre2_substring_list_get_8; pcre2_substring_nametable_scan_8; pcre2_substring_number_from_name_8; - local: - _fini; - _init; -@PCRE2_EXTRA_LOCAL_SYMS@}; + +@PCRE2_EXTRA_LOCAL_SYMS@ +}; # PCRE2_10.48 {} PCRE2_10.47; diff --git a/src/libpcre2-posix.sym.in b/src/libpcre2-posix.sym.in index b0cf22fa1..502404d44 100644 --- a/src/libpcre2-posix.sym.in +++ b/src/libpcre2-posix.sym.in @@ -5,9 +5,8 @@ PCRE2_10.47 { pcre2_regerror; pcre2_regexec; pcre2_regfree; - local: - _fini; - _init; -@PCRE2_EXTRA_LOCAL_SYMS@}; + +@PCRE2_EXTRA_LOCAL_SYMS@ +}; # PCRE2_10.48 {} PCRE2_10.47;