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/libcollector/linetrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gprofng/libcollector/linetrace.c') diff --git a/gprofng/libcollector/linetrace.c b/gprofng/libcollector/linetrace.c index 978c550..a209308 100644 --- a/gprofng/libcollector/linetrace.c +++ b/gprofng/libcollector/linetrace.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include "descendants.h" @@ -360,7 +362,7 @@ check_fd_dynamic (int fd) size_t sz = (size_t) 8192; /* one page should suffice */ if (sz > off) sz = off; - char *p = CALL_UTIL (mmap64)((char *) 0, sz, PROT_READ, MAP_PRIVATE, fd, (off64_t) 0); + char *p = CALL_UTIL (mmap64_)((char *) 0, sz, PROT_READ, MAP_PRIVATE, fd, (off64_t) 0); if (p == MAP_FAILED) { TprintfT (DBG_LT0, "check_fd_dynamic(): ERROR/WARNING: mmap failed for `%d'\n", fd); -- cgit v1.1