Github messages for voidlinux
 help / color / mirror / Atom feed
From: oreo639 <oreo639@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] binutils: update to 2.39. 
Date: Sun, 25 Sep 2022 03:20:52 +0200	[thread overview]
Message-ID: <20220925012052.XgymUwdl721jBVutZkMRrGydSXsDnnpClrU0hiN6EbA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39312@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2025 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages binutils
https://github.com/void-linux/void-packages/pull/39312

binutils: update to 2.39. 
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

Most of the testing for this was done as a part of the [gcc12 PR](https://github.com/void-linux/void-packages/pull/34902), this was split on request.

There were some api changes in libfd, the following packages were tested to build against binutils-devel:
- [x] oprofile
- [x] prelink-cross
- [x] kcov
- [x] linux-tools
- [x] distcc
- [x] chroot-distcc
- [x] sbsigntool
- [ ] llvm12 (I can't remember if I tested it with binutils 2.39 or just 2.38, building it takes forever, but it should be fine since afaict it doesn't use libbfd or `dis-asm.h`)
- [x] rpm (doesn't actually use binutils-devel but it is listed in the makedepends, builds fine without it)

Please test this PR before merging.

Closes: https://github.com/void-linux/void-packages/pull/39291

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39312.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-binutils-39312.patch --]
[-- Type: text/x-diff, Size: 60599 bytes --]

From 229248a984026c0f22d4d05852d131a3224419b5 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 03:46:04 -0700
Subject: [PATCH 1/4] libiberty-devel: update to 20220713

---
 srcpkgs/libiberty-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libiberty-devel/template b/srcpkgs/libiberty-devel/template
index 55255dceae8b..ca2d858a7abc 100644
--- a/srcpkgs/libiberty-devel/template
+++ b/srcpkgs/libiberty-devel/template
@@ -1,6 +1,6 @@
 # Template file for 'libiberty-devel'
 pkgname=libiberty-devel
-version=20210106
+version=20220713
 revision=1
 wrksrc=libiberty-${version}
 build_wrksrc=libiberty
@@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://gcc.gnu.org/"
 distfiles="http://deb.debian.org/debian/pool/main/libi/libiberty/libiberty_${version}.orig.tar.xz"
-checksum=9df153d69914c0f5a9145e0abbb248e72feebab6777c712a30f1c3b8c19047d4
+checksum=b59050f48c8a0f9c9e6fba5d17c7a4f11d1329de0c0dca7331b767a6d2bbe8d9
 conflicts="binutils-devel<=2.35.1_3"
 
 CFLAGS="-fPIC"

From d02fac824817608de5042679d2f6afaf25dbc22a Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 03:44:16 -0700
Subject: [PATCH 2/4] binutils: update to 2.39.

---
 ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch |   60 -
 ...ffdc202f04397f31557f17170b40bc42b77a.patch | 1181 +++++++++++++++++
 .../fix-libcollector-without-java.patch       |   53 +
 .../patches/ppc64-revert-gnu-attributes.patch |   66 +-
 srcpkgs/binutils/template                     |   22 +-
 5 files changed, 1267 insertions(+), 115 deletions(-)
 delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
 create mode 100644 srcpkgs/binutils/patches/fe39ffdc202f04397f31557f17170b40bc42b77a.patch
 create mode 100644 srcpkgs/binutils/patches/fix-libcollector-without-java.patch

diff --git a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch b/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
deleted file mode 100644
index a55432d83cff..000000000000
--- a/srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 16 Nov 2020 06:37:53 -0800
-Subject: [PATCH] elf: Set rel_from_abs to 1 for __ehdr_start
-
-bfdlink.h has
-
-  /* Symbol will be converted from absolute to section-relative.  Set for
-     symbols defined by a script from "dot" (also SEGMENT_START or ORIGIN)
-     outside of an output section statement.  */
-  unsigned int rel_from_abs : 1;
-
-linker.c has
-
-.{* Return TRUE if the symbol described by a linker hash entry H
-.   is going to be absolute.  Linker-script defined symbols can be
-.   converted from absolute to section-relative ones late in the
-.   link.  Use this macro to correctly determine whether the symbol
-.   will actually end up absolute in output.  *}
-.#define bfd_is_abs_symbol(H) \
-.  (((H)->type == bfd_link_hash_defined \
-.    || (H)->type == bfd_link_hash_defweak) \
-.   && bfd_is_abs_section ((H)->u.def.section) \
-.   && !(H)->rel_from_abs)
-.
-
-Set rel_from_abs to 1 for __ehdr_start which will be converted from
-absolute to section-relative in assign_file_positions_for_load_sections.
-
-	PR ld/26869
-	* ldelf.c (ldelf_before_allocation): Set rel_from_abs to 1 for
-	__ehdr_start.
-	* testsuite/ld-i386/i386.exp: Run pr26869.
-	* testsuite/ld-i386/pr26869.d: New file.
-	* testsuite/ld-i386/pr26869.s: Likewise.
-
-(cherry picked from commit cbd5b99cce073273f668b154d4514e8e7e7ccc51)
----
- ld/ChangeLog                   |  9 +++++++++
- ld/ldelf.c                     |  2 ++
- ld/testsuite/ld-i386/i386.exp  |  1 +
- ld/testsuite/ld-i386/pr26869.d | 14 ++++++++++++++
- ld/testsuite/ld-i386/pr26869.s |  3 +++
- 5 files changed, 29 insertions(+)
- create mode 100644 ld/testsuite/ld-i386/pr26869.d
- create mode 100644 ld/testsuite/ld-i386/pr26869.s
-
-diff --git a/ld/ldelf.c b/ld/ldelf.c
-index bada3ade2d7..831d032fe56 100644
---- a/ld/ldelf.c
-+++ b/ld/ldelf.c
-@@ -1589,6 +1589,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
- 		      (char *) &ehdr_start->u + sizeof ehdr_start->u.def.next,
- 		      sizeof ehdr_start_save_u);
- 	      ehdr_start->type = bfd_link_hash_defined;
-+	      /* It will be converted to section-relative later.  */
-+	      ehdr_start->rel_from_abs = 1;
- 	      ehdr_start->u.def.section = bfd_abs_section_ptr;
- 	      ehdr_start->u.def.value = 0;
- 	    }
diff --git a/srcpkgs/binutils/patches/fe39ffdc202f04397f31557f17170b40bc42b77a.patch b/srcpkgs/binutils/patches/fe39ffdc202f04397f31557f17170b40bc42b77a.patch
new file mode 100644
index 000000000000..9ce0a8ff9d6d
--- /dev/null
+++ b/srcpkgs/binutils/patches/fe39ffdc202f04397f31557f17170b40bc42b77a.patch
@@ -0,0 +1,1181 @@
+From fe39ffdc202f04397f31557f17170b40bc42b77a Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 14 Sep 2022 01:11:45 -0700
+Subject: [PATCH] gprofng: fix build issues on musl
+
+gprofng/ChangeLog
+2022-09-14  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	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/config.h.in         |   3 +
+ gprofng/common/hwcdrv.c            |   6 +-
+ gprofng/configure                  |  30 ++++-
+ gprofng/configure.ac               |  27 ++++-
+ gprofng/libcollector/collector.c   |   9 +-
+ gprofng/libcollector/collector.h   |   6 +-
+ gprofng/libcollector/dispatcher.c  |   4 +-
+ gprofng/libcollector/hwprofile.c   |  11 +-
+ gprofng/libcollector/iolib.c       |  52 ++++-----
+ gprofng/libcollector/iotrace.c     | 179 +++++++++++++++--------------
+ gprofng/libcollector/jprofile.c    |   6 -
+ gprofng/libcollector/libcol_util.c |  19 ++-
+ gprofng/libcollector/libcol_util.h |   9 +-
+ gprofng/libcollector/linetrace.c   |   4 +-
+ gprofng/libcollector/memmgr.c      |   2 +-
+ gprofng/libcollector/mmaptrace.c   | 132 ++++++++-------------
+ gprofng/libcollector/profile.c     |   2 +-
+ gprofng/libcollector/synctrace.c   |   3 +-
+ gprofng/libcollector/unwind.c      |   2 +-
+ gprofng/src/Experiment.cc          |   4 +-
+ gprofng/src/Print.cc               |   6 +-
+ gprofng/src/collector_module.h     |   6 +-
+ 22 files changed, 277 insertions(+), 245 deletions(-)
+
+diff --git a/gprofng/common/config.h.in b/gprofng/common/config.h.in
+index 8409ce74a57..f8484f238fd 100644
+--- a/gprofng/common/config.h.in
++++ b/gprofng/common/config.h.in
+@@ -118,3 +118,6 @@
+ 
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
+ #undef _POSIX_SOURCE
++
++/* Build with musl-libc. */
++#undef __MUSL_LIBC
+diff --git a/gprofng/common/hwcdrv.c b/gprofng/common/hwcdrv.c
+index caab9839b49..05390e239df 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
+diff --git a/gprofng/configure b/gprofng/configure
+index fad5b030072..301ac10050b 100755
+--- a/gprofng/configure
++++ b/gprofng/configure
+@@ -16572,7 +16572,7 @@ class Simple{
+   }
+ }
+ EOF
+-      if { ac_try='$JAVAC conftest.java &5 2>&1'
++      if { ac_try='$JAVAC configtest.java &5 2>&1'
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -16608,6 +16608,34 @@ $as_echo "#define DEBUG 1" >>confdefs.h
+ 
+ fi
+ 
++cat > "dummy.c" << EOF
++#include <features.h>
++#if defined(__UCLIBC__)
++LIBC=uclibc
++#elif defined(__dietlibc__)
++LIBC=dietlibc
++#elif defined(__GLIBC__)
++LIBC=gnu
++#else
++#include <stdarg.h>
++/* First heuristic to detect musl libc.  */
++#ifdef __DEFINED_va_list
++LIBC=musl
++#else
++LIBC=gnu
++#endif
++#endif
++EOF
++cc_set_libc=`$CC -E "dummy.c" 2>/dev/null | grep '^LIBC=' | sed 's, ,,g'`
++eval "$cc_set_libc"
++echo "cc_set_libc=$cc_set_libc;"
++if test "$LIBC" = musl; then
++
++$as_echo "#define __MUSL_LIBC 1" >>confdefs.h
++
++fi
++
++
+ # Check if linker supports --as-needed and --no-as-needed options.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --as-needed support" >&5
+ $as_echo_n "checking linker --as-needed support... " >&6; }
+diff --git a/gprofng/configure.ac b/gprofng/configure.ac
+index e9453109602..2d7640dfdc8 100644
+--- a/gprofng/configure.ac
++++ b/gprofng/configure.ac
+@@ -142,7 +142,7 @@ class Simple{
+   }
+ }
+ EOF
+-      if AC_TRY_COMMAND($JAVAC conftest.java &AS_MESSAGE_LOG_FD 2>&1); then
++      if AC_TRY_COMMAND($JAVAC configtest.java &AS_MESSAGE_LOG_FD 2>&1); then
+ 	GPROFNG_BROKEN_JAVAC=no
+       else
+ 	GPROFNG_BROKEN_JAVAC=yes
+@@ -159,6 +159,31 @@ if test "${enable_gprofng_debug}" = yes; then
+     AC_DEFINE(DEBUG, 1, [Enable debugging output.])
+ fi
+ 
++cat > "dummy.c" << EOF
++#include <features.h>
++#if defined(__UCLIBC__)
++LIBC=uclibc
++#elif defined(__dietlibc__)
++LIBC=dietlibc
++#elif defined(__GLIBC__)
++LIBC=gnu
++#else
++#include <stdarg.h>
++/* First heuristic to detect musl libc.  */
++#ifdef __DEFINED_va_list
++LIBC=musl
++#else
++LIBC=gnu
++#endif
++#endif
++EOF
++cc_set_libc=`$CC -E "dummy.c" 2>/dev/null | grep '^LIBC=' | sed 's, ,,g'`
++eval "$cc_set_libc"
++if test "$LIBC" = musl; then
++  AC_DEFINE(__MUSL_LIBC, 1, [Build with musl-libc.])
++fi
++
++
+ # Check if linker supports --as-needed and --no-as-needed options.
+ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+ 	[bfd_cv_ld_as_needed=no
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index ceff2c1cacc..93015305587 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -2155,7 +2155,7 @@ log_header_write (sp_origin_t origin)
+   ucontext_t ucp;
+   ucp.uc_stack.ss_sp = NULL;
+   ucp.uc_stack.ss_size = 0;
+-  if (getcontext (&ucp) == 0)
++  if (CALL_UTIL (getcontext) (&ucp) == 0)
+     {
+       (void) __collector_log_write ("<process stackbase=\"0x%lx\"></process>\n",
+ 				    (unsigned long) ucp.uc_stack.ss_sp + ucp.uc_stack.ss_size);
+@@ -2413,10 +2413,9 @@ __collector_dlog (int tflag, int level, char *format, ...)
+   int left = bufsz;
+   if ((tflag & SP_DUMP_NOHEADER) == 0)
+     {
+-      p += CALL_UTIL (snprintf)(p, left, "P%d,L%02u,t%02lu",
+-				(int) getpid (),
+-				(unsigned int) __collector_lwp_self (),
+-				__collector_no_threads ? 0 : __collector_thr_self ());
++      p += CALL_UTIL (snprintf) (p, left, "P%ld,L%02lu,t%02lu",
++	 (long) getpid (), (unsigned long) __collector_lwp_self (),
++	 (unsigned long) (__collector_no_threads ? 0 : __collector_thr_self ()));
+       left = bufsz - (p - buf);
+       if (tflag)
+ 	{
+diff --git a/gprofng/libcollector/collector.h b/gprofng/libcollector/collector.h
+index c54568d891c..b589d3f3d18 100644
+--- a/gprofng/libcollector/collector.h
++++ b/gprofng/libcollector/collector.h
+@@ -21,7 +21,6 @@
+ #ifndef _COLLECTOR_H
+ #define _COLLECTOR_H
+ 
+-#include <ucontext.h>
+ #include <signal.h>
+ 
+ #include "gp-defs.h"
+@@ -31,6 +30,11 @@
+ 
+ #define GETRELTIME()    (__collector_gethrtime() - __collector_start_time)
+ 
++#if defined(__MUSL_LIBC)
++#define dlvsym(f, nm, v)  dlsym (f, nm)
++#define SIGEV_THREAD_ID   4
++#endif
++
+ extern hrtime_t __collector_start_time;
+ 
+ /* ========================================================== */
+diff --git a/gprofng/libcollector/dispatcher.c b/gprofng/libcollector/dispatcher.c
+index f0308605d76..d3e4c52d667 100644
+--- a/gprofng/libcollector/dispatcher.c
++++ b/gprofng/libcollector/dispatcher.c
+@@ -30,9 +30,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <ucontext.h>
+ #include <sys/param.h>
+-#include <sys/signal.h>
+ #include <sys/syscall.h>
+ #include <time.h>
+ #include <signal.h>
+@@ -575,7 +573,9 @@ collector_timer_create (timer_t * ptimerid)
+   sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL;
+   sigev.sigev_signo = SIGPROF;
+   sigev.sigev_value.sival_ptr = ptimerid;
++#if !defined(__MUSL_LIBC)
+   sigev._sigev_un._tid = __collector_gettid ();
++#endif
+   if (CALL_REAL (timer_create)(CLOCK_THREAD_CPUTIME_ID, &sigev, ptimerid) == -1)
+     {
+       TprintfT (DBG_LT2, "collector_timer_settime() failed! errno=%d\n", errno);
+diff --git a/gprofng/libcollector/hwprofile.c b/gprofng/libcollector/hwprofile.c
+index 6fdaf1bd8ff..e360068ea30 100644
+--- a/gprofng/libcollector/hwprofile.c
++++ b/gprofng/libcollector/hwprofile.c
+@@ -29,7 +29,6 @@
+ #include <errno.h>
+ #include <sys/syscall.h>
+ #include <signal.h>
+-#include <ucontext.h>
+ 
+ #include "gp-defs.h"
+ #define _STRING_H 1  /* XXX MEZ: temporary workaround */
+@@ -378,23 +377,23 @@ static void
+ init_ucontexts (void)
+ {
+   /* initialize dummy context for "collector" frames */
+-  getcontext (&expr_dummy_uc);
++  CALL_UTIL (getcontext) (&expr_dummy_uc);
+   SETFUNCTIONCONTEXT (&expr_dummy_uc, NULL);
+ 
+   /* initialize dummy context for "out-of-range" frames */
+-  getcontext (&expr_out_of_range_uc);
++  CALL_UTIL (getcontext) (&expr_out_of_range_uc);
+   SETFUNCTIONCONTEXT (&expr_out_of_range_uc, &__collector_hwcs_out_of_range);
+ 
+   /* initialize dummy context for "frozen" frames */
+-  getcontext (&expr_frozen_uc);
++  CALL_UTIL (getcontext) (&expr_frozen_uc);
+   SETFUNCTIONCONTEXT (&expr_frozen_uc, &__collector_hwcs_frozen);
+ 
+   /* initialize dummy context for non-program-related frames */
+-  getcontext (&expr_nopc_uc);
++  CALL_UTIL (getcontext) (&expr_nopc_uc);
+   SETFUNCTIONCONTEXT (&expr_nopc_uc, &__collector_not_program_related);
+ 
+   /* initialize dummy context for lost-counts-related frames */
+-  getcontext (&expr_lostcounts_uc);
++  CALL_UTIL (getcontext) (&expr_lostcounts_uc);
+   SETFUNCTIONCONTEXT (&expr_lostcounts_uc, &__collector_hwc_samples_lost);
+ }
+ /* initialize the signal handler */
+diff --git a/gprofng/libcollector/iolib.c b/gprofng/libcollector/iolib.c
+index 6881f02fd30..861843c183d 100644
+--- a/gprofng/libcollector/iolib.c
++++ b/gprofng/libcollector/iolib.c
+@@ -243,16 +243,14 @@ __collector_create_handle (char *descp)
+     {
+       /* allocate our buffers in virtual memory */
+       /* later, we will remap buffers individually to the file */
+-      uint8_t *memory = (uint8_t*) CALL_UTIL (mmap64)(0,
+-						      (size_t) (NBUFS * blksz),
+-						      PROT_READ | PROT_WRITE,
++      uint8_t *memory = (uint8_t*) CALL_UTIL (mmap64_) (0,
++	      (size_t) (NBUFS * blksz), PROT_READ | PROT_WRITE,
+ #if ARCH(SPARC)
+ 	      MAP_SHARED | MAP_ANON,
+ #else
+ 	      MAP_PRIVATE | MAP_ANON,
+ #endif
+-	      -1,
+-						      (off64_t) 0);
++	      -1, (off64_t) 0);
+       if (memory == MAP_FAILED)
+ 	{
+ 	  TprintfT (0, "create_handle: can't mmap MAP_ANON (for %s): %s\n", hndl->fname, CALL_UTIL (strerror)(errno));
+@@ -516,9 +514,8 @@ allocateChunk (DataHandle *hndl, unsigned ichunk)
+       if (__collector_cas_ptr (&hndl->chunks[ichunk], NULL, CHUNK_BUSY) == NULL)
+ 	{
+ 	  /* allocate virtual memory */
+-	  uint8_t *newchunk = (uint8_t*) CALL_UTIL (mmap64)(0,
+-							    (size_t) (blksz * hndl->nflow),
+-							    PROT_READ | PROT_WRITE,
++	  uint8_t *newchunk = (uint8_t*) CALL_UTIL (mmap64_) (0,
++		  (size_t) (blksz * hndl->nflow), PROT_READ | PROT_WRITE,
+ #if ARCH(SPARC)
+ 		  MAP_SHARED | MAP_ANON,
+ #else
+@@ -611,8 +608,10 @@ remapBlock (DataHandle *hndl, unsigned iflow, unsigned ichunk)
+ 		  char errmsg[MAXPATHLEN + 50];
+ 		  hrtime_t teo = __collector_gethrtime ();
+ 		  double deltato = (double) (teo - tso) / 1000000.;
+-		  (void) CALL_UTIL (snprintf) (errmsg, sizeof (errmsg), " t=%d, %s: open-retries-failed = %d, %3.6f ms.; remap",
+-					       __collector_thr_self (), hndl->fname, iter, deltato);
++		  (void) CALL_UTIL (snprintf) (errmsg, sizeof (errmsg),
++			" t=%lu, %s: open-retries-failed=%d, %3.6f ms.; remap\n",
++			(unsigned long) __collector_thr_self (), hndl->fname,
++			iter, deltato);
+ 		  __collector_log_write ("<event kind=\"%s\" id=\"%d\">%s</event>\n",
+ 					 SP_JCMD_COMMENT, COL_COMMENT_NONE, errmsg);
+ 		  rc = 1;
+@@ -623,9 +622,9 @@ remapBlock (DataHandle *hndl, unsigned iflow, unsigned ichunk)
+ 	    }
+ 	  deleteHandle (hndl);
+ 	  TprintfT (0, "remapBlock: can't open file: %s: %s\n", hndl->fname, STR (CALL_UTIL (strerror)(errno)));
+-	  __collector_log_write ("<event kind=\"%s\" id=\"%d\" ec=\"%d\">t=%llu, %s: remap </event>\n",
++	  __collector_log_write ("<event kind=\"%s\" id=\"%d\" ec=\"%d\">t=%lu, %s: remap </event>\n",
+ 				 SP_JCMD_CERROR, COL_ERROR_FILEOPN, errno,
+-				 (unsigned long long) __collector_thr_self (),
++				 (unsigned long) __collector_thr_self (),
+ 				 hndl->fname);
+ 	  rc = 1;
+ 	  goto exit;
+@@ -640,15 +639,18 @@ remapBlock (DataHandle *hndl, unsigned iflow, unsigned ichunk)
+       char errmsg[MAXPATHLEN + 50];
+       hrtime_t teo = __collector_gethrtime ();
+       double deltato = (double) (teo - tso) / 1000000.;
+-      (void) CALL_UTIL (snprintf) (errmsg, sizeof (errmsg), " t=%d, %s: open-retries = %d, %3.6f ms.; remap",
+-				   __collector_thr_self (), hndl->fname, iter, deltato);
++      (void) CALL_UTIL (snprintf) (errmsg, sizeof (errmsg),
++	      " t=%d, %s: open-retries=%lu, %3.6f ms.; remap\n",
++	      (unsigned long) __collector_thr_self (), hndl->fname,
++	      iter, deltato);
+       __collector_log_write ("<event kind=\"%s\" id=\"%d\">%s</event>\n",
+ 			     SP_JCMD_COMMENT, COL_COMMENT_NONE, errmsg);
+     }
+ 
+   /* Ensure disk space is allocated and the block offset is 0 */
+   uint32_t zero = 0;
+-  int n = CALL_UTIL (pwrite64)(fd, &zero, sizeof (zero), (off64_t) (offset + blksz - sizeof (zero)));
++  int n = CALL_UTIL (pwrite64_) (fd, &zero, sizeof (zero),
++				(off64_t) (offset + blksz - sizeof (zero)));
+   if (n <= 0)
+     {
+       deleteHandle (hndl);
+@@ -663,13 +665,9 @@ remapBlock (DataHandle *hndl, unsigned iflow, unsigned ichunk)
+ 
+   /* Map block to file */
+   uint8_t *bptr = getBlock (hndl, iflow, ichunk);
+-  uint8_t *vaddr = (uint8_t *) CALL_UTIL (mmap64)(
+-						  (void*) bptr,
+-						  (size_t) blksz,
+-						  PROT_READ | PROT_WRITE,
+-						  MAP_SHARED | MAP_FIXED,
+-						  fd,
+-						  offset);
++  uint8_t *vaddr = (uint8_t *) CALL_UTIL (mmap64_) ((void*) bptr,
++	  (size_t) blksz, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
++	  fd, offset);
+ 
+   if (vaddr != bptr)
+     {
+@@ -784,8 +782,9 @@ __collector_write_packet (DataHandle *hndl, CM_Packet *pckt)
+       TprintfT (0, "collector_write_packet: packet too long: %d (max %ld)\n", recsz, blksz);
+       return 1;
+     }
+-  unsigned tid = (__collector_no_threads ? __collector_lwp_self () : __collector_thr_self ());
+-  unsigned iflow = tid % hndl->nflow;
++  collector_thread_t tid = __collector_no_threads ? __collector_lwp_self ()
++						  : __collector_thr_self ();
++  unsigned iflow = (unsigned) (((unsigned long) tid) % hndl->nflow);
+ 
+   /* Acquire block */
+   uint32_t *sptr = &hndl->blkstate[iflow * NCHUNKS];
+@@ -925,7 +924,8 @@ mapBuffer (char *fname, Buffer *buf, off64_t foff)
+ 
+   /* ensure disk space is allocated */
+   char nl = '\n';
+-  int n = CALL_UTIL (pwrite64)(fd, &nl, sizeof (nl), (off64_t) (foff + blksz - sizeof (nl)));
++  int n = CALL_UTIL (pwrite64_) (fd, &nl, sizeof (nl),
++				 (off64_t) (foff + blksz - sizeof (nl)));
+   if (n <= 0)
+     {
+       TprintfT (0, "mapBuffer ERROR: can't pwrite file %s at 0x%llx\n", fname,
+@@ -937,7 +937,7 @@ mapBuffer (char *fname, Buffer *buf, off64_t foff)
+       goto exit;
+     }
+   /* mmap buf->vaddr to fname at foff */
+-  uint8_t *vaddr = CALL_UTIL (mmap64)(buf->vaddr, (size_t) blksz,
++  uint8_t *vaddr = CALL_UTIL (mmap64_) (buf->vaddr, (size_t) blksz,
+ 	  PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, foff);
+   if (vaddr != buf->vaddr)
+     {
+diff --git a/gprofng/libcollector/iotrace.c b/gprofng/libcollector/iotrace.c
+index 9b47724bab9..d94daefa89b 100644
+--- a/gprofng/libcollector/iotrace.c
++++ b/gprofng/libcollector/iotrace.c
+@@ -34,7 +34,7 @@
+ #include <fcntl.h>
+ 
+ #include "gp-defs.h"
+-#include "collector_module.h"
++#include "collector.h"
+ #include "gp-experiment.h"
+ #include "data_pckts.h"
+ #include "tsd.h"
+@@ -999,6 +999,22 @@ init_io_intf ()
+   return rc;
+ }
+ 
++static void
++write_io_packet (int fd, ssize_t ret, hrtime_t reqt, int iotype)
++{
++  IOTrace_packet iopkt;
++  collector_memset (&iopkt, 0, sizeof ( IOTrace_packet));
++  iopkt.comm.tsize = sizeof (IOTrace_packet);
++  iopkt.comm.tstamp = gethrtime ();
++  iopkt.requested = reqt;
++  iopkt.iotype = iotype;
++  iopkt.fd = fd;
++  iopkt.nbyte = ret;
++  iopkt.comm.frinfo = collector_interface->getFrameInfo (io_hndl,
++			iopkt.comm.tstamp, FRINFO_FROM_STACK, &iopkt);
++  collector_interface->writeDataRecord (io_hndl, (Common_packet*) & iopkt);
++}
++
+ /*------------------------------------------------------------- open */
+ int
+ open (const char *path, int oflag, ...)
+@@ -2412,162 +2428,147 @@ pread (int fildes, void *buf, size_t nbyte, off_t offset)
+ }
+ 
+ /*------------------------------------------------------------- pwrite */
+-#if ARCH(Intel) && WSIZE(32)
++
++#if !defined(__MUSL_LIBC) && ARCH(Intel) && WSIZE(32)
+ // map interposed symbol versions
+-static int
+-__collector_pwrite_symver (int(real_pwrite) (), int fildes, const void *buf, size_t nbyte, off_t offset);
+ 
+ SYMVER_ATTRIBUTE (__collector_pwrite_2_2, pwrite@@GLIBC_2.2)
+ int
+ __collector_pwrite_2_2 (int fildes, const void *buf, size_t nbyte, off_t offset)
+ {
+-  TprintfT (DBG_LTT, "iotrace: __collector_pwrite_2_2@%p(fildes=%d, buf=%p, nbyte=%lld, offset=%lld)\n",
+-	    CALL_REAL (pwrite_2_2), fildes, buf, (long long) nbyte, (long long) offset);
+-  if (NULL_PTR (pwrite))
++  int *guard;
++  if (NULL_PTR (pwrite_2_2))
+     init_io_intf ();
+-  return __collector_pwrite_symver (CALL_REAL (pwrite_2_2), fildes, buf, nbyte, offset);
++  if (CHCK_REENTRANCE (guard))
++    return CALL_REAL (pwrite_2_2)(fildes, buf, nbyte, offset);
++  PUSH_REENTRANCE (guard);
++  hrtime_t reqt = gethrtime ();
++  ssize_t ret = CALL_REAL (pwrite_2_2)(fildes, buf, nbyte, offset);
++  if (RECHCK_REENTRANCE (guard))
++    {
++      POP_REENTRANCE (guard);
++      return ret;
++    }
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
++  POP_REENTRANCE (guard);
++  return ret;
+ }
+ 
+ SYMVER_ATTRIBUTE (__collector_pwrite_2_1, pwrite@GLIBC_2.1)
+ int
+ __collector_pwrite_2_1 (int fildes, const void *buf, size_t nbyte, off_t offset)
+ {
+-  TprintfT (DBG_LTT, "iotrace: __collector_pwrite_2_1@%p(fildes=%d, buf=%p, nbyte=%lld, offset=%lld)\n",
+-	    CALL_REAL (pwrite_2_1), fildes, buf, (long long) nbyte, (long long) offset);
+-  if (NULL_PTR (pwrite))
++  int *guard;
++  if (NULL_PTR (pwrite_2_1))
+     init_io_intf ();
+-  return __collector_pwrite_symver (CALL_REAL (pwrite_2_1), fildes, buf, nbyte, offset);
++  if (CHCK_REENTRANCE (guard))
++    return CALL_REAL (pwrite_2_1)(fildes, buf, nbyte, offset);
++  PUSH_REENTRANCE (guard);
++  hrtime_t reqt = gethrtime ();
++  ssize_t ret = CALL_REAL (pwrite_2_1)(fildes, buf, nbyte, offset);
++  if (RECHCK_REENTRANCE (guard))
++    {
++      POP_REENTRANCE (guard);
++      return ret;
++    }
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
++  POP_REENTRANCE (guard);
++  return ret;
+ }
+-
+-static int
+-__collector_pwrite_symver (int(real_pwrite) (), int fildes, const void *buf, size_t nbyte, off_t offset)
+-{
+-#else /* ^ARCH(Intel) && WSIZE(32) */
++#endif /* !defined(__MUSL_LIBC) && ARCH(Intel) && WSIZE(32) */
+ 
+ ssize_t
+ pwrite (int fildes, const void *buf, size_t nbyte, off_t offset)
+ {
+-#endif /* ^ARCH(Intel) && WSIZE(32) */
+   int *guard;
+-  ssize_t ret;
+-  IOTrace_packet iopkt;
+   if (NULL_PTR (pwrite))
+     init_io_intf ();
+   if (CHCK_REENTRANCE (guard))
+-    {
+-#if ARCH(Intel) && WSIZE(32)
+-      return (real_pwrite) (fildes, buf, nbyte, offset);
+-#else
+-      return CALL_REAL (pwrite)(fildes, buf, nbyte, offset);
+-#endif
+-    }
++    return CALL_REAL (pwrite)(fildes, buf, nbyte, offset);
+   PUSH_REENTRANCE (guard);
+   hrtime_t reqt = gethrtime ();
+-#if ARCH(Intel) && WSIZE(32)
+-  ret = (real_pwrite) (fildes, buf, nbyte, offset);
+-#else
+-  ret = CALL_REAL (pwrite)(fildes, buf, nbyte, offset);
+-#endif
++  ssize_t ret = CALL_REAL (pwrite)(fildes, buf, nbyte, offset);
+   if (RECHCK_REENTRANCE (guard))
+     {
+       POP_REENTRANCE (guard);
+       return ret;
+     }
+-  hrtime_t grnt = gethrtime ();
+-  collector_memset (&iopkt, 0, sizeof ( IOTrace_packet));
+-  iopkt.comm.tsize = sizeof ( IOTrace_packet);
+-  iopkt.comm.tstamp = grnt;
+-  iopkt.requested = reqt;
+-  if (ret >= 0)
+-    iopkt.iotype = WRITE_TRACE;
+-  else
+-    iopkt.iotype = WRITE_TRACE_ERROR;
+-  iopkt.fd = fildes;
+-  iopkt.nbyte = ret;
+-  iopkt.comm.frinfo = collector_interface->getFrameInfo (io_hndl, iopkt.comm.tstamp, FRINFO_FROM_STACK, &iopkt);
+-  collector_interface->writeDataRecord (io_hndl, (Common_packet*) & iopkt);
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
+   POP_REENTRANCE (guard);
+   return ret;
+ }
+ 
+ /*------------------------------------------------------------- pwrite64 */
++#if !defined(__MUSL_LIBC)
+ #if ARCH(Intel) && WSIZE(32)
+ // map interposed symbol versions
+-static int
+-__collector_pwrite64_symver (int(real_pwrite64) (), int fildes, const void *buf, size_t nbyte, off64_t offset);
+ 
+ SYMVER_ATTRIBUTE (__collector_pwrite64_2_2, pwrite64@@GLIBC_2.2)
+-int
++ssize_t
+ __collector_pwrite64_2_2 (int fildes, const void *buf, size_t nbyte, off64_t offset)
+ {
+-  TprintfT (DBG_LTT, "iotrace: __collector_pwrite64_2_2@%p(fildes=%d, buf=%p, nbyte=%lld, offset=%lld)\n",
+-	    CALL_REAL (pwrite64_2_2), fildes, buf, (long long) nbyte, (long long) offset);
+-  if (NULL_PTR (pwrite64))
++  int *guard;
++  if (NULL_PTR (pwrite64_2_2))
+     init_io_intf ();
+-  return __collector_pwrite64_symver (CALL_REAL (pwrite64_2_2), fildes, buf, nbyte, offset);
++  if (CHCK_REENTRANCE (guard))
++    return CALL_REAL (pwrite64_2_2)(fildes, buf, nbyte, offset);
++  PUSH_REENTRANCE (guard);
++  hrtime_t reqt = gethrtime ();
++  ssize_t ret = CALL_REAL (pwrite64_2_2)(fildes, buf, nbyte, offset);
++  if (RECHCK_REENTRANCE (guard))
++    {
++      POP_REENTRANCE (guard);
++      return ret;
++    }
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
++  POP_REENTRANCE (guard);
++  return ret;
+ }
+ 
+ SYMVER_ATTRIBUTE (__collector_pwrite64_2_1, pwrite64@GLIBC_2.1)
+ int
+ __collector_pwrite64_2_1 (int fildes, const void *buf, size_t nbyte, off64_t offset)
+ {
+-  TprintfT (DBG_LTT, "iotrace: __collector_pwrite64_2_1@%p(fildes=%d, buf=%p, nbyte=%lld, offset=%lld)\n",
+-	    CALL_REAL (pwrite64_2_1), fildes, buf, (long long) nbyte, (long long) offset);
+-  if (NULL_PTR (pwrite64))
++  int *guard;
++  if (NULL_PTR (pwrite64_2_1))
+     init_io_intf ();
+-  return __collector_pwrite64_symver (CALL_REAL (pwrite64_2_1), fildes, buf, nbyte, offset);
++  if (CHCK_REENTRANCE (guard))
++    return CALL_REAL (pwrite64_2_1)(fildes, buf, nbyte, offset);
++  PUSH_REENTRANCE (guard);
++  hrtime_t reqt = gethrtime ();
++  ssize_t ret = CALL_REAL (pwrite64_2_1)(fildes, buf, nbyte, offset);
++  if (RECHCK_REENTRANCE (guard))
++    {
++      POP_REENTRANCE (guard);
++      return ret;
++    }
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
++  POP_REENTRANCE (guard);
++  return ret;
+ }
+-
+-static int
+-__collector_pwrite64_symver (int(real_pwrite64) (), int fildes, const void *buf, size_t nbyte, off64_t offset)
+-{
+-#else /* ^ARCH(Intel) && WSIZE(32) */
++#endif
+ 
+ ssize_t
+ pwrite64 (int fildes, const void *buf, size_t nbyte, off64_t offset)
+ {
+-#endif /* ^ARCH(Intel) && WSIZE(32) */
+   int *guard;
+-  ssize_t ret;
+-  IOTrace_packet iopkt;
+   if (NULL_PTR (pwrite64))
+     init_io_intf ();
+   if (CHCK_REENTRANCE (guard))
+-    {
+-#if ARCH(Intel) && WSIZE(32)
+-      return (real_pwrite64) (fildes, buf, nbyte, offset);
+-#else
+-      return CALL_REAL (pwrite64)(fildes, buf, nbyte, offset);
+-#endif
+-    }
++    return CALL_REAL (pwrite64)(fildes, buf, nbyte, offset);
+   PUSH_REENTRANCE (guard);
+   hrtime_t reqt = gethrtime ();
+-#if ARCH(Intel) && WSIZE(32)
+-  ret = (real_pwrite64) (fildes, buf, nbyte, offset);
+-#else
+-  ret = CALL_REAL (pwrite64)(fildes, buf, nbyte, offset);
+-#endif
++  ssize_t ret = CALL_REAL (pwrite64)(fildes, buf, nbyte, offset);
+   if (RECHCK_REENTRANCE (guard))
+     {
+       POP_REENTRANCE (guard);
+       return ret;
+     }
+-  hrtime_t grnt = gethrtime ();
+-  collector_memset (&iopkt, 0, sizeof ( IOTrace_packet));
+-  iopkt.comm.tsize = sizeof ( IOTrace_packet);
+-  iopkt.comm.tstamp = grnt;
+-  iopkt.requested = reqt;
+-  if (ret >= 0)
+-    iopkt.iotype = WRITE_TRACE;
+-  else
+-    iopkt.iotype = WRITE_TRACE_ERROR;
+-  iopkt.fd = fildes;
+-  iopkt.nbyte = ret;
+-  iopkt.comm.frinfo = collector_interface->getFrameInfo (io_hndl, iopkt.comm.tstamp, FRINFO_FROM_STACK, &iopkt);
+-  collector_interface->writeDataRecord (io_hndl, (Common_packet*) & iopkt);
++  write_io_packet (fildes, ret, reqt, ret >= 0 ? WRITE_TRACE : WRITE_TRACE_ERROR);
+   POP_REENTRANCE (guard);
+   return ret;
+ }
++#endif
+ 
+ /*------------------------------------------------------------- fgets */
+ char*
+diff --git a/gprofng/libcollector/jprofile.c b/gprofng/libcollector/jprofile.c
+index 9daaa5a267e..52114066726 100644
+--- a/gprofng/libcollector/jprofile.c
++++ b/gprofng/libcollector/jprofile.c
+@@ -285,12 +285,6 @@ __collector_jprofile_start_attach (void)
+ 	    {
+ 	      jthread thread;
+ 	      (*jvmti)->GetCurrentThread (jvmti, &thread);
+-#ifdef DEBUG
+-	      collector_thread_t tid;
+-	      tid = __collector_thr_self ();
+-	      TprintfT (0, "jprofile attach: AttachCurrentThread: thread: %lu jni_env=%p jthread=%p\n",
+-			(unsigned long) tid, jni_env, thread);
+-#endif /* DEBUG */
+ 	      jvmti_VMInit (jvmti, jni_env, thread);
+ 	      (*jvmti)->GenerateEvents (jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD);
+ 	      (*jvmti)->GenerateEvents (jvmti, JVMTI_EVENT_DYNAMIC_CODE_GENERATED);
+diff --git a/gprofng/libcollector/libcol_util.c b/gprofng/libcollector/libcol_util.c
+index c709b3c5ed1..d682aa0ab29 100644
+--- a/gprofng/libcollector/libcol_util.c
++++ b/gprofng/libcollector/libcol_util.c
+@@ -1116,9 +1116,9 @@ __collector_util_init ()
+   /*    internal calls for mapping in libcollector call mmap64 */
+   ptr = dlsym (libc, "mmap64");
+   if (ptr)
+-    __collector_util_funcs.mmap64 = (void*(*)(void *, size_t, int, int, int, off_t))ptr;
++    __collector_util_funcs.mmap64_ = (void*(*)(void *, size_t, int, int, int, off_t))ptr;
+   else
+-    __collector_util_funcs.mmap64 = __collector_util_funcs.mmap;
++    __collector_util_funcs.mmap64_ = __collector_util_funcs.mmap;
+ 
+   ptr = dlsym (libc, "munmap");
+   if (ptr)
+@@ -1214,16 +1214,16 @@ __collector_util_init ()
+ #if ARCH(Intel) && WSIZE(32)
+   ptr = dlvsym (libc, "pwrite64", "GLIBC_2.2"); // it is in /lib/libpthread.so.0
+   if (ptr)
+-    __collector_util_funcs.pwrite64 = (ssize_t (*)())ptr;
++    __collector_util_funcs.pwrite64_ = (ssize_t (*)())ptr;
+   else
+     {
+       Tprintf (DBG_LT0, "libcol_util: WARNING: dlvsym for %s@%s failed. Using dlsym() instead.", "pwrite64", "GLIBC_2.2");
+ #endif /* ARCH(Intel) && WSIZE(32) */
+       ptr = dlsym (libc, "pwrite64");
+       if (ptr)
+-	__collector_util_funcs.pwrite64 = (ssize_t (*)())ptr;
++	__collector_util_funcs.pwrite64_ = (ssize_t (*)())ptr;
+       else
+-	__collector_util_funcs.pwrite64 = __collector_util_funcs.pwrite;
++	__collector_util_funcs.pwrite64_ = __collector_util_funcs.pwrite;
+ #if ARCH(Intel) && WSIZE(32)
+     }
+ #endif /* ARCH(Intel) && WSIZE(32) */
+@@ -1319,6 +1319,15 @@ __collector_util_init ()
+   __collector_util_funcs.getcpuid = __collector_getcpuid;
+   __collector_util_funcs.memset = collector_memset;
+ 
++  ptr = dlsym (libc, "getcontext");
++  if (ptr)
++    __collector_util_funcs.getcontext = (int(*)())ptr;
++  else
++    {
++      CALL_UTIL (fprintf)(stderr, "collector_util_init COL_ERROR_UTIL_INIT getcontext: %s\n", dlerror ());
++      err = COL_ERROR_UTIL_INIT;
++    }
++
+   ptr = dlsym (libc, "malloc");
+   if (ptr)
+     __collector_util_funcs.malloc = (void *(*)(size_t))ptr;
+diff --git a/gprofng/libcollector/libcol_util.h b/gprofng/libcollector/libcol_util.h
+index e13a02ea6d7..c32c76f091b 100644
+--- a/gprofng/libcollector/libcol_util.h
++++ b/gprofng/libcollector/libcol_util.h
+@@ -59,12 +59,11 @@ extern int __collector_xml_snprintf (char *s, size_t n, const char *format, ...)
+ extern int __collector_xml_vsnprintf (char *s, size_t n, const char *format, va_list args);
+ 
+ /* -------  collector_thread ----------------- */
+-pid_t __collector_gettid ();
++extern pid_t __collector_gettid ();
+ extern void __collector_ext_gettid_tsd_create_key ();
+-#define collector_thread_t pthread_t            // not using pid_t, since tid is defined as pthread_t in package structures, and other codes assume this type
+-#define statvfs_t  struct statvfs
+-#define __collector_lwp_self() (collector_thread_t)__collector_gettid() // not using pthread_self()
+-#define __collector_thr_self() (collector_thread_t)__collector_gettid() // not using pthread_self()
++typedef pthread_t collector_thread_t;
++#define __collector_lwp_self() ((collector_thread_t) ((unsigned long) __collector_gettid()))
++#define __collector_thr_self() ((collector_thread_t) ((unsigned long) __collector_gettid()))
+ 
+ /* -------  collector_mutex ----------------- */
+ /*
+diff --git a/gprofng/libcollector/linetrace.c b/gprofng/libcollector/linetrace.c
+index 978c5503e2e..a209308c767 100644
+--- a/gprofng/libcollector/linetrace.c
++++ b/gprofng/libcollector/linetrace.c
+@@ -29,6 +29,8 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
++#include <limits.h>
++
+ 
+ #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);
+diff --git a/gprofng/libcollector/memmgr.c b/gprofng/libcollector/memmgr.c
+index 5ada421f3f4..aa13ea77852 100644
+--- a/gprofng/libcollector/memmgr.c
++++ b/gprofng/libcollector/memmgr.c
+@@ -131,7 +131,7 @@ alloc_chunk (unsigned sz, int log)
+   if (log == 1)
+     Tprintf (DBG_LT2, "alloc_chunk mapping %u, rounded up from %u\n", (unsigned int) chunksz, sz);
+   /* mmap64 is only in 32-bits; this call goes to mmap in 64-bits */
+-  ptr = (char*) CALL_UTIL (mmap64)(0, chunksz, PROT_READ | PROT_WRITE,
++  ptr = (char*) CALL_UTIL (mmap64_)(0, chunksz, PROT_READ | PROT_WRITE,
+ 				   MAP_PRIVATE | MAP_ANON, (int) -1, (off64_t) 0);
+   if (ptr == MAP_FAILED)
+     {
+diff --git a/gprofng/libcollector/mmaptrace.c b/gprofng/libcollector/mmaptrace.c
+index ba5c9129f4c..bd299e6f64f 100644
+--- a/gprofng/libcollector/mmaptrace.c
++++ b/gprofng/libcollector/mmaptrace.c
+@@ -441,13 +441,9 @@ checksum_mapname (MapInfo* map)
+ }
+ 
+ 
+-#if (ARCH(Intel) && WSIZE(32)) || ARCH(SPARC)
+-static void*
+-dlopen_searchpath_symver (void*(real_dlopen) (), void* caller_addr, const char* basename, int mode)
+-#else
+ static void*
+-dlopen_searchpath (void* caller_addr, const char* basename, int mode)
+-#endif
++dlopen_searchpath (void*(real_dlopen) (const char *, int),
++		void *caller_addr, const char *basename, int mode)
+ {
+   TprintfT (DBG_LT2, "dlopen_searchpath(%p, %s, %d)\n", caller_addr, basename, mode);
+   Dl_info dl_info;
+@@ -458,7 +454,8 @@ dlopen_searchpath (void* caller_addr, const char* basename, int mode)
+     }
+   TprintfT (DBG_LT2, "dladdr(%p): %p fname=%s\n",
+ 	    caller_addr, dl_info.dli_fbase, dl_info.dli_fname);
+-  int noload = RTLD_BINDING_MASK | RTLD_NOLOAD; //XXXX why RTLD_BINDING_MASK?
++  int noload = RTLD_LAZY | RTLD_NOW | RTLD_NOLOAD;
++  void *caller_hndl = NULL;
+ #define WORKAROUND_RTLD_BUG 1
+ #ifdef WORKAROUND_RTLD_BUG
+   // A dynamic linker dlopen bug can result in corruption/closure of open streams
+@@ -470,29 +467,20 @@ dlopen_searchpath (void* caller_addr, const char* basename, int mode)
+ #endif
+   const char* tmp_path =
+ 	  (dl_info.dli_fbase == (void*) MAINBASE) ? NULL : dl_info.dli_fname;
+-  void* caller_hndl = NULL;
+-#if ((ARCH(Intel) && WSIZE(32)) || ARCH(SPARC))
+-  caller_hndl = (real_dlopen) (tmp_path, noload);
+-#else
+-  caller_hndl = CALL_REAL (dlopen)(tmp_path, noload);
+-#endif
++  caller_hndl = real_dlopen (tmp_path, noload);
+ 
+ #else //XXXX workaround should be removed once linker patches are all available
+ 
+-  void* caller_hndl = NULL;
+-#if (ARCH(Intel) && WSIZE(32) || ARCH(SPARC)
+-  caller_hndl = (real_dlopen) (dl_info.dli_fname, noload);
+-#else
+-  caller_hndl = CALL_REAL (dlopen)(dl_info.dli_fname, noload);
+-#endif
++  caller_hndl = real_dlopen (dl_info.dli_fname, noload);
+ 
+ #endif //XXXX workaround should be removed once linker patches are all available
+ 
+   if (!caller_hndl)
+     {
+       TprintfT (0, "ERROR: dlopen(%s,NOLOAD): %s\n", dl_info.dli_fname, dlerror ());
+-      return 0;
++      return NULL;
+     }
++#if !defined(__MUSL_LIBC)
+   Dl_serinfo _info, *info = &_info;
+   Dl_serpath *path;
+ 
+@@ -546,7 +534,7 @@ dlopen_searchpath (void* caller_addr, const char* basename, int mode)
+       I have already confirmed with our user that the workaround
+       is working with his real application. Additionally,
+       the dlopen_searchpath() function is called only by the
+-      libcorrector init() function when the experiment is started.
++      libcollector init() function when the experiment is started.
+       Therefore, allocating some extra bytes on the stack which
+       is local to this routine is harmless.
+    */
+@@ -575,7 +563,8 @@ dlopen_searchpath (void* caller_addr, const char* basename, int mode)
+       if (ret)
+ 	return ret; // success!
+     }
+-  return 0;
++#endif
++  return NULL;
+ }
+ 
+ static void
+@@ -1550,40 +1539,9 @@ munmap (void *start, size_t length)
+ 
+ 
+ /*------------------------------------------------------------- dlopen */
+-// map interposed symbol versions
+-#if (ARCH(Intel) && WSIZE(32)) || ARCH(SPARC)
+-
+-static void *
+-__collector_dlopen_symver (void*(real_dlopen) (), void *caller, const char *pathname, int mode);
+-
+-SYMVER_ATTRIBUTE (__collector_dlopen_2_1, dlopen@@GLIBC_2.1)
+-void *
+-__collector_dlopen_2_1 (const char *pathname, int mode)
+-{
+-  if (NULL_PTR (dlopen))
+-    init_mmap_intf ();
+-  void *caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
+-  return __collector_dlopen_symver (CALL_REAL (dlopen_2_1), caller, pathname, mode);
+-}
+-
+-SYMVER_ATTRIBUTE (__collector_dlopen_2_0, dlopen@GLIBC_2.0)
+-void *
+-__collector_dlopen_2_0 (const char *pathname, int mode)
+-{
+-  if (NULL_PTR (dlopen))
+-    init_mmap_intf ();
+-  void* caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
+-  return __collector_dlopen_symver (CALL_REAL (dlopen_2_0), caller, pathname, mode);
+-}
+-#endif
+-
+-#if (ARCH(Intel) && WSIZE(32)) || ARCH(SPARC)
+ static void *
+-__collector_dlopen_symver (void*(real_dlopen) (), void *caller, const char *pathname, int mode)
+-#else
+-void *
+-dlopen (const char *pathname, int mode)
+-#endif
++__collector_dlopen_symver (void*(real_dlopen) (const char *, int),
++			   void *caller, const char *pathname, int mode)
+ {
+   const char * real_pathname = pathname;
+   char new_pathname[MAXPATHLEN];
+@@ -1595,10 +1553,6 @@ dlopen (const char *pathname, int mode)
+     origin_offset = 10;
+   if (origin_offset)
+     {
+-#if ! ((ARCH(Intel) && WSIZE(32)) || ARCH(SPARC))
+-      // 'caller' is not passed as an argument
+-      void * caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
+-#endif
+       Dl_info dl_info;
+       if (caller && dladdr (caller, &dl_info) != 0)
+ 	{
+@@ -1619,37 +1573,18 @@ dlopen (const char *pathname, int mode)
+     init_mmap_intf ();
+   TprintfT (DBG_LT2, "libcollector.dlopen(%s,%d) interposing\n",
+ 	    pathname ? pathname : "", mode);
+-  void* ret = NULL;
++  void *ret = NULL;
+ 
+   // set guard for duration of handling dlopen, since want to ensure
+   // new mappings are resolved after the actual dlopen has occurred
+   PUSH_REENTRANCE;
+   hrtime_t hrt = GETRELTIME ();
+ 
+-  if (real_pathname && !__collector_strchr (real_pathname, '/'))
+-    { // got an unqualified name
+-      // get caller and use its searchpath
+-#if ! ((ARCH(Intel) && WSIZE(32)) || ARCH(SPARC))
+-      void* caller = __builtin_return_address (0); // must be called inside dlopen
+-#endif
+-      if (caller)
+-	{
+-#if (ARCH(Intel) && WSIZE(32)) || ARCH(SPARC)
+-	  ret = dlopen_searchpath_symver (real_dlopen, caller, real_pathname, mode);
+-#else
+-	  ret = dlopen_searchpath (caller, real_pathname, mode);
+-#endif
+-	}
+-    }
++  if (caller && real_pathname && !__collector_strchr (real_pathname, '/'))
++    ret = dlopen_searchpath (real_dlopen, caller, real_pathname, mode);
+ 
+   if (!ret)
+-    {
+-#if (ARCH(Intel) && WSIZE(32)) || ARCH(SPARC)
+-      ret = (real_dlopen) (real_pathname, mode);
+-#else
+-      ret = CALL_REAL (dlopen)(real_pathname, mode);
+-#endif
+-    }
++    ret = real_dlopen (real_pathname, mode);
+   TprintfT (DBG_LT2, "libcollector -- dlopen(%s) returning %p\n", pathname, ret);
+ 
+   /* Don't call update if dlopen failed: preserve dlerror() */
+@@ -1660,6 +1595,39 @@ dlopen (const char *pathname, int mode)
+   return ret;
+ }
+ 
++void *
++dlopen (const char *pathname, int mode)
++{
++  if (NULL_PTR (dlopen))
++    init_mmap_intf ();
++  void* caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
++  return __collector_dlopen_symver (CALL_REAL (dlopen), caller, pathname, mode);
++}
++
++#if !defined(__MUSL_LIBC) && ((ARCH(Intel) && WSIZE(32)) || ARCH(SPARC))
++// map interposed symbol versions
++
++SYMVER_ATTRIBUTE (__collector_dlopen_2_1, dlopen@@GLIBC_2.1)
++void *
++__collector_dlopen_2_1 (const char *pathname, int mode)
++{
++  if (NULL_PTR (dlopen_2_1))
++    init_mmap_intf ();
++  void *caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
++  return __collector_dlopen_symver (CALL_REAL (dlopen_2_1), caller, pathname, mode);
++}
++
++SYMVER_ATTRIBUTE (__collector_dlopen_2_0, dlopen@GLIBC_2.0)
++void *
++__collector_dlopen_2_0 (const char *pathname, int mode)
++{
++  if (NULL_PTR (dlopen_2_0))
++    init_mmap_intf ();
++  void* caller = __builtin_return_address (0); // must be called inside dlopen first layer interpostion
++  return __collector_dlopen_symver (CALL_REAL (dlopen_2_0), caller, pathname, mode);
++}
++#endif
++
+ /*------------------------------------------------------------- dlclose */
+ int
+ dlclose (void *handle)
+diff --git a/gprofng/libcollector/profile.c b/gprofng/libcollector/profile.c
+index 996d3f09198..ee9fb7d3b0c 100644
+--- a/gprofng/libcollector/profile.c
++++ b/gprofng/libcollector/profile.c
+@@ -268,7 +268,7 @@ __collector_ext_profile_handler (siginfo_t *info, ucontext_t *context)
+       /* assume this case is rare, and accept overhead of creating dummy_uc */
+       TprintfT (0, "collector_profile_handler: ERROR: got NULL context!\n");
+       context = &uctxmem;
+-      getcontext (context);     /* initialize dummy context */
++      CALL_UTIL (getcontext) (context);     /* initialize dummy context */
+       SETFUNCTIONCONTEXT (context, &__collector_lost_profile_context);
+     }
+   ClockPacket pckt;
+diff --git a/gprofng/libcollector/synctrace.c b/gprofng/libcollector/synctrace.c
+index 492ef9993f7..d48aeaa2d2d 100644
+--- a/gprofng/libcollector/synctrace.c
++++ b/gprofng/libcollector/synctrace.c
+@@ -32,10 +32,9 @@
+ #include <pthread.h>
+ 
+ #include "gp-defs.h"
+-#include "collector_module.h"
++#include "collector.h"
+ #include "gp-experiment.h"
+ #include "data_pckts.h"
+-#include "i18n.h"
+ #include "tsd.h"
+ #include "cc_libcollector.h"
+ 
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index f8e11823c81..009b5ab8456 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -232,7 +232,7 @@ memory_error_func (int status ATTRIBUTE_UNUSED, bfd_vma addr ATTRIBUTE_UNUSED,
+ 
+ #elif ARCH(Aarch64)
+ #define FILL_CONTEXT(context) \
+-    { getcontext(context);  \
++    { CALL_UTIL (getcontext) (context);  \
+       context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \
+     }
+ 
+diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc
+index c797724af07..98aae9714ac 100644
+--- a/gprofng/src/Experiment.cc
++++ b/gprofng/src/Experiment.cc
+@@ -6466,7 +6466,7 @@ int
+ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_msg)
+ {
+   errno = 0;
+-  int fd_w = open64 (aname, O_WRONLY | O_CREAT | O_EXCL, 0644);
++  int fd_w = ::open64 (aname, O_WRONLY | O_CREAT | O_EXCL, 0644);
+   if (fd_w == -1)
+     {
+       if (errno == EEXIST)
+@@ -6484,7 +6484,7 @@ Experiment::copy_file_to_archive (const char *name, const char *aname, int hide_
+       return 1;
+     }
+ 
+-  int fd_r = open64 (name, O_RDONLY);
++  int fd_r = ::open64 (name, O_RDONLY);
+   if (fd_r == -1)
+     {
+       fprintf (stderr, GTXT ("er_archive: unable to open `%s': %s\n"),
+diff --git a/gprofng/src/Print.cc b/gprofng/src/Print.cc
+index d415d591e1e..03932530956 100644
+--- a/gprofng/src/Print.cc
++++ b/gprofng/src/Print.cc
+@@ -2209,14 +2209,14 @@ print_anno_file (char *name, const char *sel, const char *srcFile,
+ 	    {
+ 	      fitem = func->getDefSrc ();
+ 	      found = (func->line_first > 0)
+-		      && strcmp (basename (srcFile),
+-				 basename (fitem->get_name ())) == 0;
++		      && strcmp (get_basename (srcFile),
++				 get_basename (fitem->get_name ())) == 0;
+ 	    }
+ 	  else
+ 	    {
+ 	      Vec_loop (SourceFile*, sources, index, fitem)
+ 	      {
+-		if (strcmp (basename (srcFile), basename (fitem->get_name ())) == 0)
++		if (strcmp (get_basename (srcFile), get_basename (fitem->get_name ())) == 0)
+ 		  {
+ 		    found = true;
+ 		    break;
+diff --git a/gprofng/src/collector_module.h b/gprofng/src/collector_module.h
+index f608dab5831..6cf53d5b27f 100644
+--- a/gprofng/src/collector_module.h
++++ b/gprofng/src/collector_module.h
+@@ -25,6 +25,7 @@
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <ucontext.h>
+ #include <dirent.h>
+ 
+ #include "gp-defs.h"
+@@ -55,6 +56,7 @@ typedef struct CollectorUtilFuncs
+   int (*fprintf)(FILE *stream, const char *format, ...);
+   void (*free)(void *ptr);
+   int (*fstat)(int fd, struct stat *buf);
++  int (*getcontext)(ucontext_t *ucp);
+   int (*getcpuid)();
+   char *(*getcwd)(char *buf, size_t size);
+   char *(*getenv)(const char *name);
+@@ -66,7 +68,7 @@ typedef struct CollectorUtilFuncs
+   int (*mkdir)();
+   time_t (*mktime)(struct tm *timeptr);
+   void *(*mmap)(void *, size_t, int, int, int, off_t);
+-  void *(*mmap64)();
++  void *(*mmap64_)();
+   int (*munmap)();
+   int (*open)(const char *, int, ...);
+   int (*open_bare)(const char *, int, ...);
+@@ -75,7 +77,7 @@ typedef struct CollectorUtilFuncs
+   FILE *(*popen)(const char *command, const char *mode);
+   int (*putenv)(char *string);
+   ssize_t (*pwrite)();
+-  ssize_t (*pwrite64)();
++  ssize_t (*pwrite64_)();
+   ssize_t (*read)();
+   int (*setenv)(const char *name, const char *value, int overwrite);
+   int (*sigfillset)(sigset_t *set);
diff --git a/srcpkgs/binutils/patches/fix-libcollector-without-java.patch b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
new file mode 100644
index 000000000000..54384875f358
--- /dev/null
+++ b/srcpkgs/binutils/patches/fix-libcollector-without-java.patch
@@ -0,0 +1,53 @@
+From 49ddd814ac1071af7c4f45d5f8398b91862f2c7f Mon Sep 17 00:00:00 2001
+From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
+Date: Wed, 17 Aug 2022 19:55:23 -0700
+Subject: [PATCH] gprofng: fix bug 29479 Collection fails when built without
+ java support
+
+gprofng/ChangeLog
+2022-08-17  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+	PR gprofng/29479
+	* libcollector/collector.c: Add #if defined(GPROFNG_JAVA_PROFILING) for
+	java specific code.
+	* libcollector/unwind.c: Likewise.
+---
+ gprofng/libcollector/collector.c | 2 ++
+ gprofng/libcollector/unwind.c    | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c
+index 93c9d3330de5..ceff2c1caccb 100644
+--- a/gprofng/libcollector/collector.c
++++ b/gprofng/libcollector/collector.c
+@@ -913,8 +913,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or
+   __collector_ext_unwind_key_init (1, NULL);
+ 
+   /* start java attach if suitable */
++#if defined(GPROFNG_JAVA_PROFILING)
+   if (exp_origin == SP_ORIGIN_DBX_ATTACH)
+     __collector_jprofile_start_attach ();
++#endif
+   start_sec_time = CALL_UTIL (time)(NULL);
+   __collector_start_time = collector_interface.getHiResTime ();
+   TprintfT (DBG_LT0, "\t__collector_open_experiment; resetting start_time\n");
+diff --git a/gprofng/libcollector/unwind.c b/gprofng/libcollector/unwind.c
+index 119243788020..f8e11823c81e 100644
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -557,6 +557,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+   int size = max_frame_size;
+ 
+ #define MIN(a,b) ((a)<(b)?(a):(b))
++#if defined(GPROFNG_JAVA_PROFILING)
+   /* get Java info */
+   if (__collector_java_mode && __collector_java_asyncgetcalltrace_loaded && context && !pseudo_context)
+     {
+@@ -569,6 +570,7 @@ __collector_get_frame_info (hrtime_t ts, int mode, void *arg)
+ 	  size -= sz;
+ 	}
+     }
++#endif
+ 
+   /* get native stack */
+   if (context)
diff --git a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
index 5de937f4fcce..1c208dd8955c 100644
--- a/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
+++ b/srcpkgs/binutils/patches/ppc64-revert-gnu-attributes.patch
@@ -1,39 +1,24 @@
-From b1faf99f3e546df2cd302bb1ad36a2078224fe8b Mon Sep 17 00:00:00 2001
+From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
 From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Fri, 30 Oct 2020 16:59:48 -0600
+Date: Tue, 21 Sep 2021 14:53:13 +0000
 Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
  libraries"
 
+This revert is needed to avoid wrongly tagging objects with the incompatible
+IBM long double ABI, which is not supported by musl and will result in
+linking errors if used.
+
 This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
 ---
- bfd/ChangeLog     | 6 ------
- bfd/elf32-tic6x.c | 3 ---
- ld/ChangeLog      | 6 ------
- ld/ldlang.c       | 9 ++++-----
- 4 files changed, 4 insertions(+), 20 deletions(-)
+ bfd/elf32-tic6x.c |  3 ---
+ ld/ldlang.c       | 10 ++++------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
 
-diff --git a/bfd/ChangeLog b/bfd/ChangeLog
-index 9fac12538a..b5461494e8 100644
---- a/bfd/ChangeLog
-+++ b/bfd/ChangeLog
-@@ -1422,12 +1422,6 @@
- 	accessing root.u.def of symbols.  Also check root.u.def.section
- 	is non-NULL.  Reverse tests so as to make the logic positive.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
--	Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	PR 25882
 diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
-index b8b916bfd3..91bb6a10b1 100644
+index 5754f3cb860..3ad1d612749 100644
 --- a/bfd/elf32-tic6x.c
 +++ b/bfd/elf32-tic6x.c
-@@ -3748,9 +3748,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
+@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
  
  	case Tag_ABI_PIC:
  	case Tag_ABI_PID:
@@ -43,36 +28,20 @@ index b8b916bfd3..91bb6a10b1 100644
  	  if (out_attr[i].i > in_attr[i].i)
  	    out_attr[i].i = in_attr[i].i;
  	  break;
-diff --git a/ld/ChangeLog b/ld/ChangeLog
-index 4eec7d2977..b93452f70c 100644
---- a/ld/ChangeLog
-+++ b/ld/ChangeLog
-@@ -1319,12 +1319,6 @@
- 	* testsuite/ld-aarch64/farcall-group.d: New test driver.
- 	* testsuite/ld-aarch64/aarch64-elf.exp: Run the new test.
- 
--2020-05-01  Alan Modra  <amodra@gmail.com>
--
--	PR 25882
--	* ldlang.c (lang_check): Call bfd_merge_private_bfd_data for
--	shared libraries.
--
- 2020-05-01  Alan Modra  <amodra@gmail.com>
- 
- 	* po/BLD-POTFILES.in: Regenerate.
 diff --git a/ld/ldlang.c b/ld/ldlang.c
-index 9977195074..173d8ec349 100644
+index 37b64c89ee1..f13beaef9d9 100644
 --- a/ld/ldlang.c
 +++ b/ld/ldlang.c
-@@ -6972,12 +6972,11 @@ lang_check (void)
+@@ -7071,13 +7071,11 @@ lang_check (void)
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (link_info.output_bfd));
  	}
 -
 -      /* If the input bfd has no contents, it shouldn't set the
 -	 private data of the output bfd.  */
--      else if ((input_bfd->flags & DYNAMIC) != 0
--	       || bfd_count_sections (input_bfd) != 0)
+-      else if (!file->flags.just_syms
+-	       && ((input_bfd->flags & DYNAMIC) != 0
+-		   || bfd_count_sections (input_bfd) != 0))
 +      else if (bfd_count_sections (input_bfd))
  	{
 +	  /* If the input bfd has no contents, it shouldn't set the
@@ -82,5 +51,4 @@ index 9977195074..173d8ec349 100644
  
  	  /* If we aren't supposed to warn about mismatched input
 -- 
-2.29.2
-
+2.33.0
diff --git a/srcpkgs/binutils/template b/srcpkgs/binutils/template
index 6270f8618c87..256e627135b0 100644
--- a/srcpkgs/binutils/template
+++ b/srcpkgs/binutils/template
@@ -1,19 +1,20 @@
 # Template file for 'binutils'
 pkgname=binutils
-version=2.35.1
-revision=4
+version=2.39
+revision=1
 bootstrap=yes
+hostmakedepends="pkg-config"
 makedepends="zlib-devel"
 short_desc="GNU binary utilities"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/binutils/"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.xz"
-checksum=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
+checksum=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
 
 subpackages="binutils-doc"
 if [ "$CHROOT_READY" ]; then
-	hostmakedepends="flex perl texinfo"
+	hostmakedepends+=" flex perl texinfo"
 	makedepends+=" elfutils-devel"
 	checkdepends="bc"
 	depends="binutils-doc"
@@ -44,6 +45,12 @@ do_configure() {
 		conf+=" --host=${XBPS_CROSS_TRIPLET} --with-build-sysroot=${XBPS_CROSS_BASE}"
 	fi
 
+	# gprofng currently only supports x86 and aarch64.
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64*|i386*|aarch64*) conf+=" --enable-gprofng" ;;
+		*) conf+=" --disable-gprofng" ;;
+	esac
+
 	case "$XBPS_TARGET_MACHINE" in
 		ppc*)
 			conf+=" --enable-secureplt"
@@ -76,13 +83,15 @@ do_configure() {
 		--libdir=/usr/lib \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
+		--sysconfdir=/etc \
 		--disable-werror \
-		--disable-shared \
 		--disable-nls \
+		--enable-shared \
 		--enable-threads \
 		--enable-plugins \
 		--enable-relro \
 		--enable-gold \
+		--enable-new-dtags \
 		--enable-deterministic-archives \
 		--enable-64-bit-bfd \
 		--enable-ld=default \
@@ -142,7 +151,8 @@ binutils-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
+		vmove "usr/lib/libbfd.so"
+		vmove "usr/lib/libopcodes.so"
 	}
 }
 

From b42a30920c89e9c84932d55417c423c33503add9 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 04:09:00 -0700
Subject: [PATCH 3/4] gdb: resolve conflict with binutils 2.39

---
 srcpkgs/gdb/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index ff7c9d9a5911..5970402eb27e 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,7 +1,7 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=12.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
@@ -48,7 +48,8 @@ vopt_conflict debuginfod static
 
 post_install() {
 	# resolve conflicts with binutils
-	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+	rm -rf ${DESTDIR}/usr/{include,lib}
+	rm -rf ${DESTDIR}/usr/share/info/{bfd,ctf-spec}.info*
 }
 
 gdb-common_package() {

From c2197721ecbea7c0dc8ed3d916f4e1acc3557826 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Fri, 16 Sep 2022 15:54:51 -0700
Subject: [PATCH 4/4] build-style/void-cross: update flags for binutils 2.39

---
 common/build-style/void-cross.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/build-style/void-cross.sh b/common/build-style/void-cross.sh
index 92f03f8130f5..41b396fcb875 100644
--- a/common/build-style/void-cross.sh
+++ b/common/build-style/void-cross.sh
@@ -53,6 +53,7 @@ _void_cross_build_binutils() {
 		--sbindir=/usr/bin \
 		--libdir=/usr/lib \
 		--libexecdir=/usr/lib \
+		--sysconfdir=/etc \
 		--target=${tgt} \
 		--with-sysroot=/usr/${tgt} \
 		--disable-nls \
@@ -60,8 +61,10 @@ _void_cross_build_binutils() {
 		--disable-multilib \
 		--disable-werror \
 		--disable-gold \
+		--disable-gprofng \
 		--enable-relro \
 		--enable-plugins \
+		--enable-new-dtags \
 		--enable-64-bit-bfd \
 		--enable-deterministic-archives \
 		--enable-default-hash-style=gnu \
@@ -625,6 +628,9 @@ do_install() {
 	# then remove it because it conflicts with libquadmath package
 	rm -rf ${DESTDIR}/${sysroot}/usr/lib/libquadmath.*
 
+	# Remove libdep linker plugin because it conflicts with system binutils
+	rm -f ${DESTDIR}/usr/lib/bfd-plugins/libdep*
+
 	# Remove leftover symlinks
 	rm -f ${DESTDIR}/usr/lib${XBPS_TARGET_WORDSIZE}
 	rm -f ${DESTDIR}/lib*

  parent reply	other threads:[~2022-09-25  1:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 10:59 [PR PATCH] Binutils oreo639
2022-09-16 11:09 ` [PR PATCH] [Updated] binutils: update to 2.39 oreo639
2022-09-16 11:17 ` oreo639
2022-09-16 13:28 ` oreo639
2022-09-16 17:46 ` dkwo
2022-09-16 22:44 ` oreo639
2022-09-17  4:09 ` [PR PATCH] [Updated] " oreo639
2022-09-17  4:11 ` oreo639
2022-09-17  4:36 ` oreo639
2022-09-17  5:09 ` oreo639
2022-09-17 11:44 ` dkwo
2022-09-17 11:53 ` dkwo
2022-09-17 12:05 ` paper42
2022-09-18 22:19 ` [PR PATCH] [Updated] " oreo639
2022-09-18 22:37 ` oreo639
2022-09-18 22:39 ` oreo639
2022-09-18 22:59 ` oreo639
2022-09-19  0:27 ` oreo639
2022-09-25  1:12 ` oreo639
2022-09-25  1:20 ` oreo639 [this message]
2022-09-25  1:43 ` oreo639
2022-09-25  1:43 ` oreo639
2022-09-25  1:44 ` oreo639
2022-10-03  2:52 ` oreo639
2022-10-03  2:53 ` oreo639
2022-12-17  6:11 ` [PR PATCH] [Closed]: " oreo639
2022-12-17  6:11 ` oreo639

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220925012052.XgymUwdl721jBVutZkMRrGydSXsDnnpClrU0hiN6EbA@z \
    --to=oreo639@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).