]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gprofng: 32018 Compilation of binutils 2.43 failed on CentOS 6
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Mon, 29 Jul 2024 21:15:01 +0000 (14:15 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 1 Aug 2024 18:30:27 +0000 (11:30 -0700)
strchr is redefined as a macro in /usr/include/bits/string.h on CentOS 6/7.
In this case, we may not use our CALL_UTIL macro for strchr.
Use __collector_strchr instead of "CALL_UTIL (strchr)".

gprofng/ChangeLog
2024-07-28  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR 32018
* libcollector/hwprofile.c (open_experiment): Use __collector_strchr.

gprofng/libcollector/hwprofile.c

index cfe0d84dc1e16f9d2b0962e2a2097ea5a85d167d..3b7f4840aa00e00896289cbb76b79b32a40d183e 100644 (file)
@@ -216,13 +216,13 @@ open_experiment (const char *exp)
          params += 2;
          break;
        }
-      params = CALL_UTIL (strchr)(params, ';');
+      params = __collector_strchr (params, ';');
       if (params)
        params++;
     }
   if (params == NULL)  /* HWC profiling not specified */
     return COL_ERROR_HWCINIT;
-  char *s = CALL_UTIL (strchr)(params, (int) ';');
+  char *s = __collector_strchr (params, (int) ';');
   int sz = s ? s - params : CALL_UTIL (strlen)(params);
   char *defstring = (char*) alloca (sz + 1);
   CALL_UTIL (strlcpy)(defstring, params, sz + 1);