From a03b446869c3117c19eb1932cca2bf8dbbb18633 Mon Sep 17 00:00:00 2001 From: oreo639 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 1a4e1ca3d594..b04268908c2e 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="q66 " 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 88b2a1b50a3e952ace1f9d7740e04ed17270ec15 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Fri, 16 Sep 2022 03:44:16 -0700 Subject: [PATCH 2/4] binutils: update to 2.39. --- ...e3f3bd6d460491f8c8d032a7fea88d5ec8ff.patch | 60 ----------------- .../fix-libcollector-without-java.patch | 53 +++++++++++++++ .../patches/ppc64-revert-gnu-attributes.patch | 66 +++++-------------- srcpkgs/binutils/template | 21 ++++-- 4 files changed, 85 insertions(+), 115 deletions(-) delete mode 100644 srcpkgs/binutils/patches/1767e3f3bd6d460491f8c8d032a7fea88d5ec8ff.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" -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/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 +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 + + 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 -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 -- -- 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 - - 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 -- -- PR 25882 -- * ldlang.c (lang_check): Call bfd_merge_private_bfd_data for -- shared libraries. -- - 2020-05-01 Alan Modra - - * 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..71895f2073fd 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 " 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 glibc. + 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,9 +83,10 @@ 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 \ @@ -142,7 +150,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 2124d1876ba49b8aad84231b821085f7d3855b6f Mon Sep 17 00:00:00 2001 From: oreo639 Date: Fri, 16 Sep 2022 03:47:32 -0700 Subject: [PATCH 3/4] kcov: fix build with binutils 2.39 --- .../0001-Fix-build-with-binutils-2.39.patch | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 srcpkgs/kcov/patches/0001-Fix-build-with-binutils-2.39.patch diff --git a/srcpkgs/kcov/patches/0001-Fix-build-with-binutils-2.39.patch b/srcpkgs/kcov/patches/0001-Fix-build-with-binutils-2.39.patch new file mode 100644 index 000000000000..5e666aacefc9 --- /dev/null +++ b/srcpkgs/kcov/patches/0001-Fix-build-with-binutils-2.39.patch @@ -0,0 +1,97 @@ +From fd1a4fd2f02cee49afd74e427e38c61b89154582 Mon Sep 17 00:00:00 2001 +From: oreo639 +Date: Wed, 14 Sep 2022 16:02:17 -0700 +Subject: [PATCH] Fix build with binutils 2.39 + +--- + src/CMakeLists.txt | 20 +++++++++++++++++++- + src/parsers/bfd-disassembler.cc | 23 +++++++++++++++++++++++ + 2 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3b751852..fc396827 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -94,6 +94,7 @@ set (DISASSEMBLER_SRCS + ) + + set (HAS_LIBBFD "0") ++set (HAS_LIBBFD_DISASM_STYLED "0") + + if (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64") + if (LIBBFD_FOUND) +@@ -106,6 +107,23 @@ if (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STR + ${LIBBFD_BFD_LIBRARY} + ${LIBBFD_IBERTY_LIBRARY} + ) ++ include(CheckCSourceCompiles) ++ set(CMAKE_REQUIRED_LIBRARIES ${DISASSEMBLER_LIBRARIES}) ++ check_c_source_compiles(" ++ #define PACKAGE ++ #define PACKAGE_VERSION ++ #include ++ #include ++ ++ int main(int argc, char **argv){ ++ struct disassemble_info info; ++ init_disassemble_info(&info, stdout, NULL, NULL); ++ return 0; ++ } ++ " TEST_LIBBFD_DISASM_STYLED) ++ if (TEST_LIBBFD_DISASM_STYLED) ++ set (HAS_LIBBFD_DISASM_STYLED "1") ++ endif (TEST_LIBBFD_DISASM_STYLED) + endif (LIBBFD_FOUND) + endif (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64") + +@@ -284,7 +302,7 @@ set (KCOV_SYSTEM_MODE_SRCS + + set (KCOV_LIBRARY_PREFIX "/tmp") + +-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -Wall -D_GLIBCXX_USE_NANOSLEEP -DKCOV_LIBRARY_PREFIX=${KCOV_LIBRARY_PREFIX} -DKCOV_HAS_LIBBFD=${HAS_LIBBFD}") ++set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -Wall -D_GLIBCXX_USE_NANOSLEEP -DKCOV_LIBRARY_PREFIX=${KCOV_LIBRARY_PREFIX} -DKCOV_HAS_LIBBFD=${HAS_LIBBFD} -DKCOV_LIBFD_DISASM_STYLED=${HAS_LIBBFD_DISASM_STYLED}") + + include_directories( + include/ +diff --git a/src/parsers/bfd-disassembler.cc b/src/parsers/bfd-disassembler.cc +index 43653ee0..28815961 100644 +--- a/src/parsers/bfd-disassembler.cc ++++ b/src/parsers/bfd-disassembler.cc +@@ -75,7 +75,11 @@ class BfdDisassembler : public IDisassembler + BfdDisassembler() + { + memset(&m_info, 0, sizeof(m_info)); ++#if KCOV_LIBFD_DISASM_STYLED ++ init_disassemble_info(&m_info, (void *)this, BfdDisassembler::opcodesFprintFuncStatic, BfdDisassembler::opcodesFprintStyledFuncStatic); ++#else + init_disassemble_info(&m_info, (void *)this, BfdDisassembler::opcodesFprintFuncStatic); ++#endif + m_disassembler = print_insn_i386; + + m_info.arch = bfd_arch_i386; +@@ -407,6 +411,25 @@ class BfdDisassembler : public IDisassembler + return out; + } + ++#if KCOV_LIBFD_DISASM_STYLED ++ static int opcodesFprintStyledFuncStatic(void *info, enum disassembler_style style, const char *fmt, ...) ++ { ++ (void)style; ++ BfdDisassembler *pThis = (BfdDisassembler *)info; ++ char str[64]; ++ int out; ++ ++ va_list args; ++ va_start (args, fmt); ++ out = vsnprintf( str, sizeof(str) - 1, fmt, args ); ++ va_end (args); ++ ++ pThis->opcodesFprintFunc(str); ++ ++ return out; ++ } ++#endif ++ + typedef std::map SectionCache_t; + typedef std::unordered_map InstructionAddressMap_t; + typedef std::map InstructionOrderedMap_t; From 96296ac044809e49d60ee50f65f076c5f1abf4b2 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Fri, 16 Sep 2022 04:09:00 -0700 Subject: [PATCH 4/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() {