From fe39ffdc202f04397f31557f17170b40bc42b77a Mon Sep 17 00:00:00 2001 From: Vladimir Mezentsev Date: Wed, 14 Sep 2022 01:11:45 -0700 Subject: gprofng: fix build issues on musl gprofng/ChangeLog 2022-09-14 Vladimir Mezentsev PR gprofng/29477 * configure.ac: Set __MUSL_LIBC. * configure: Rebuild. * common/config.h.in: Rebuild. * src/collector_module.h: Fix compiler errors because mmap64, open64, pwrite64 are macros and getcontext() is absent on musl. * libcollector/collector.c: Likewise. * libcollector/hwprofile.c: Likewise. * libcollector/iolib.c: Likewise. * libcollector/libcol_util.c: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/memmgr.c: Likewise. * libcollector/profile.c: Likewise. * libcollector/unwind.c: Likewise. * libcollector/dispatcher.c: Likewise. * src/Experiment.cc: Likewise. * libcollector/collector.h: Use dlsym() because dlvsym() is not defined on musl. * libcollector/iotrace.c: Remove interposition of versioned functions. * libcollector/mmaptrace.c: Likewise. * libcollector/libcol_util.h: Fix -Wint-to-pointer-cast warnings. * libcollector/jprofile.c: Likewise. * libcollector/synctrace.c: Include "collector.h". * src/Print.cc: Use get_basename() because basename() is not defined on musl. * common/hwcdrv.c: Fix -Wformat= warnings. --- gprofng/common/hwcdrv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gprofng/common/hwcdrv.c') diff --git a/gprofng/common/hwcdrv.c b/gprofng/common/hwcdrv.c index caab983..05390e2 100644 --- a/gprofng/common/hwcdrv.c +++ b/gprofng/common/hwcdrv.c @@ -440,7 +440,7 @@ typedef struct { // per-thread context counter_state_t *ctr_list; int signal_fd; // fd that caused the most recent signal - pthread_t tid; // for debugging signal delivery problems + pid_t tid; // for debugging signal delivery problems } hdrv_pcl_ctx_t; /*---------------------------------------------------------------------------*/ @@ -1321,7 +1321,7 @@ hwcdrv_free_counters () // note: only performs shutdown for this thread for (int ii = 0; ii < hdrv_pcl_state.hwcdef_cnt; ii++) if (stop_one_ctr (ii, ctr_list)) hwc_rc = HWCFUNCS_ERROR_GENERIC; - TprintfT (DBG_LT1, "hwcdrv: hwcdrv_free_counters(tid=0x%lx).\n", pctx->tid); + TprintfT (DBG_LT1, "hwcdrv: hwcdrv_free_counters(tid=0x%lx).\n", (long) pctx->tid); pctx->ctr_list = NULL; return hwc_rc; } @@ -1351,7 +1351,7 @@ hwcdrv_start (void) /* must be called from each thread ? */ return HWCFUNCS_ERROR_UNEXPECTED; } pctx->tid = hwcdrv_gettid (); - TprintfT (DBG_LT1, "hwcdrv: hwcdrv_start(tid=0x%lx)\n", pctx->tid); + TprintfT (DBG_LT1, "hwcdrv: hwcdrv_start(tid=0x%lx)\n", (long) pctx->tid); /* * create per-thread counter list -- cgit v1.1