Collin Funk wrote:
> Gnulib doesn't maintain an ABI since it is intended to be used in
> source-form and then statically linked [1].

This is correct.

But still, Gnulib tries to not add an 'rpl_' prefix gratuitously.
So that
  1) when debugging, you can set a breakpoint in the function with the
     expected name,
  2) to access such a function from Python or other scripting languages,
     you don't need to worry about a prefix.

I'm therefore applying this patch:


2025-11-10  Bruno Haible  <[email protected]>

        argp: Don't use an 'rpl_' function name prefix if not necessary.
        Reported by Andrew Schulman <[email protected]> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2025-11/msg00100.html>.
        * m4/argp.m4 (gl_ARGP): Don't rename argp_parse to rpl_argp_parse in
        config.h if libc does not have argp_parse().

diff --git a/m4/argp.m4 b/m4/argp.m4
index 7e4d10f92c..76a559f765 100644
--- a/m4/argp.m4
+++ b/m4/argp.m4
@@ -1,5 +1,5 @@
 # argp.m4
-# serial 17
+# serial 18
 dnl Copyright (C) 2003-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,11 +12,14 @@ AC_DEFUN([gl_ARGP]
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  dnl Rename argp_parse to another symbol, so that clang's ASAN does not
-  dnl intercept it.
-  dnl See 
<https://lists.gnu.org/archive/html/bug-gnulib/2023-12/msg00035.html>.
-  AC_DEFINE([argp_parse], [rpl_argp_parse],
-    [Define to the name of argp_parse outside libc.])
+  AC_CHECK_FUNCS_ONCE([argp_parse])
+  if test $ac_cv_func_argp_parse != no; then
+    dnl Rename argp_parse to another symbol, so that clang's ASAN does not
+    dnl intercept it. See
+    dnl <https://lists.gnu.org/archive/html/bug-gnulib/2023-12/msg00035.html>.
+    AC_DEFINE([argp_parse], [rpl_argp_parse],
+      [Define to the name of argp_parse outside libc.])
+  fi
 
   AC_CHECK_DECLS([program_invocation_name],
     [],




Reply via email to