binutils: update to 2.41

This commit is contained in:
coolsnowwolf 2024-01-11 11:30:49 +08:00
parent 321f1572f4
commit 229e5e43f2
2 changed files with 98 additions and 5 deletions

View File

@ -8,16 +8,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=binutils
PKG_VERSION:=2.38
PKG_VERSION:=2.41
PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/binutils
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_VERSION:=$(PKG_VERSION)
PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
PKG_HASH:=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450
PKG_FIXUP:=patch-libtool
PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe
PKG_REMOVE_FILES:=libtool.m4
PKG_INSTALL:=1
@ -25,7 +25,7 @@ PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-3.0+
PKG_CPE_ID:=cpe:/a:gnu:binutils
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_FLAGS:=no-mips16
include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/package.mk
@ -87,7 +87,11 @@ CONFIGURE_ARGS += \
--enable-shared \
--enable-install-libiberty \
--enable-install-libbfd \
--enable-install-libctf
--enable-install-libctf \
--with-system-zlib \
--without-zstd \
--without-msgpack \
--disable-gprofng
define Build/Install
$(call Build/Install/Default)
@ -105,6 +109,7 @@ endef
define Package/libbfd/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsframe*.so* $(1)/usr/lib/
endef
define Package/libctf/install

View File

@ -0,0 +1,88 @@
Fix this compile error:
----------------------
./../common/cpuid.c:27:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__get_cpuid'
27 | __get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax,
| ^~~~~~~~~~~
----------------------
and this error:
----------------------
unwind.c: In function '__collector_ext_return_address':
unwind.c:236:34: error: '__u64' undeclared (first use in this function)
236 | context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \
| ^~~~~
unwind.c:490:3: note: in expansion of macro 'FILL_CONTEXT'
490 | FILL_CONTEXT ((&context));
----------------------
--- a/gprofng/common/cpuid.c
+++ b/gprofng/common/cpuid.c
@@ -23,7 +23,7 @@
#elif defined(__aarch64__)
#define ATTRIBUTE_UNUSED __attribute__((unused))
-static inline uint_t __attribute_const__
+static inline uint_t __attribute__((__const__))
__get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax,
unsigned int *ebx ATTRIBUTE_UNUSED,
unsigned int *ecx ATTRIBUTE_UNUSED, unsigned int *edx ATTRIBUTE_UNUSED)
--- a/gprofng/libcollector/unwind.c
+++ b/gprofng/libcollector/unwind.c
@@ -233,7 +233,7 @@ memory_error_func (int status ATTRIBUTE_
#elif ARCH(Aarch64)
#define FILL_CONTEXT(context) \
{ CALL_UTIL (getcontext) (context); \
- context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \
+ context->uc_mcontext.sp = (uint64_t) __builtin_frame_address(0); \
}
#endif /* ARCH() */
@@ -4579,11 +4579,11 @@ stack_unwind (char *buf, int size, void
if (buf && bptr && eptr && context && size + mode > 0)
getByteInstruction ((unsigned char *) eptr);
int ind = 0;
- __u64 *lbuf = (void *) buf;
- int lsize = size / sizeof (__u64);
- __u64 pc = context->uc_mcontext.pc;
- __u64 sp = context->uc_mcontext.sp;
- __u64 stack_base;
+ uint64_t *lbuf = (void *) buf;
+ int lsize = size / sizeof (uint64_t);
+ uint64_t pc = context->uc_mcontext.pc;
+ uint64_t sp = context->uc_mcontext.sp;
+ uint64_t stack_base;
unsigned long tbgn = 0;
unsigned long tend = 0;
@@ -4594,7 +4594,7 @@ stack_unwind (char *buf, int size, void
{
stack_base = sp + 0x100000;
if (stack_base < sp) // overflow
- stack_base = (__u64) -1;
+ stack_base = (uint64_t) -1;
}
DprintfT (SP_DUMP_UNWIND,
"unwind.c:%d stack_unwind %2d pc=0x%llx sp=0x%llx stack_base=0x%llx\n",
@@ -4625,17 +4625,17 @@ stack_unwind (char *buf, int size, void
__LINE__, (unsigned long) sp);
break;
}
- pc = ((__u64 *) sp)[1];
- __u64 old_sp = sp;
- sp = ((__u64 *) sp)[0];
+ pc = ((uint64_t *) sp)[1];
+ uint64_t old_sp = sp;
+ sp = ((uint64_t *) sp)[0];
if (sp < old_sp)
break;
}
if (ind >= lsize)
{
ind = lsize - 1;
- lbuf[ind++] = (__u64) SP_TRUNC_STACK_MARKER;
+ lbuf[ind++] = (uint64_t) SP_TRUNC_STACK_MARKER;
}
- return ind * sizeof (__u64);
+ return ind * sizeof (uint64_t);
}
#endif /* ARCH() */