Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
148
package/devel/binutils/Makefile
Normal file
148
package/devel/binutils/Makefile
Normal file
@@ -0,0 +1,148 @@
|
||||
#
|
||||
# Copyright (C) 2006-2013 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=binutils
|
||||
PKG_VERSION:=2.42
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=@GNU/binutils
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_VERSION:=$(PKG_VERSION)
|
||||
PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800
|
||||
|
||||
PKG_FIXUP:=patch-libtool
|
||||
PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe
|
||||
PKG_REMOVE_FILES:=libtool.m4
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=GPL-3.0+
|
||||
PKG_CPE_ID:=cpe:/a:gnu:binutils
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libbfd
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libbfd
|
||||
DEPENDS:=+zlib $(INTL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/libctf
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libctf
|
||||
DEPENDS:=+libbfd
|
||||
endef
|
||||
|
||||
define Package/libopcodes
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libopcodes
|
||||
DEPENDS:=+libbfd
|
||||
endef
|
||||
|
||||
define Package/binutils
|
||||
SECTION:=devel
|
||||
CATEGORY:=Development
|
||||
TITLE:=binutils
|
||||
DEPENDS:=+objdump +ar
|
||||
ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
|
||||
endef
|
||||
|
||||
define Package/objdump
|
||||
SECTION:=devel
|
||||
CATEGORY:=Development
|
||||
TITLE:=objdump
|
||||
DEPENDS:=+libopcodes +libctf
|
||||
endef
|
||||
|
||||
define Package/ar
|
||||
SECTION:=devel
|
||||
CATEGORY:=Development
|
||||
TITLE:=ar
|
||||
DEPENDS:=+zlib +libbfd
|
||||
endef
|
||||
|
||||
define Package/binutils/description
|
||||
The Binutils package contains a linker, an assembler, and other tools for handling object files
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC) -Wno-unused-value
|
||||
|
||||
TARGET_LDFLAGS += $(if $(INTL_FULL),-lintl)
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--host=$(REAL_GNU_TARGET_NAME) \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--enable-shared \
|
||||
--enable-install-libiberty \
|
||||
--enable-install-libbfd \
|
||||
--enable-install-libctf \
|
||||
--with-system-zlib \
|
||||
--without-zstd \
|
||||
--without-msgpack \
|
||||
--disable-gprofng
|
||||
|
||||
define Build/Install
|
||||
$(call Build/Install/Default)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
|
||||
target_header_dir=libiberty \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
MULTIOSDIR="" \
|
||||
install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
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
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libopcodes/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/objdump/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/ar/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/binutils/install
|
||||
$(INSTALL_DIR) $(1)/usr $(1)/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
|
||||
mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
|
||||
rm -f $(1)/usr/bin/objdump
|
||||
rm -f $(1)/usr/bin/ar
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbfd))
|
||||
$(eval $(call BuildPackage,libctf))
|
||||
$(eval $(call BuildPackage,libopcodes))
|
||||
$(eval $(call BuildPackage,binutils))
|
||||
$(eval $(call BuildPackage,objdump))
|
||||
$(eval $(call BuildPackage,ar))
|
||||
@@ -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
|
||||
@@ -237,7 +237,7 @@ typedef uint64_t __u64;
|
||||
|
||||
#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() */
|
||||
@@ -4583,11 +4583,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;
|
||||
|
||||
@@ -4598,7 +4598,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",
|
||||
@@ -4629,17 +4629,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() */
|
||||
Reference in New Issue
Block a user