From 59d3829a306ba8b9c9d6198ee99005aa7f9fedcc Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 6 May 2022 07:49:44 +0000 Subject: [PATCH 1/2] binutils-aarch64: update to use binutils package source and version --- packages/devel/binutils-aarch64/package.mk | 13 +++++--- ...uses-of-system-directories-when-link.patch | 32 ------------------- .../binutils-aarch64/patches/nodocs.patch | 11 ------- 3 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 packages/devel/binutils-aarch64/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch delete mode 100644 packages/devel/binutils-aarch64/patches/nodocs.patch diff --git a/packages/devel/binutils-aarch64/package.mk b/packages/devel/binutils-aarch64/package.mk index b854112857..801b107ada 100644 --- a/packages/devel/binutils-aarch64/package.mk +++ b/packages/devel/binutils-aarch64/package.mk @@ -3,13 +3,13 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="binutils-aarch64" -PKG_VERSION="2.37" -PKG_SHA256="820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c" +PKG_VERSION="$(get_pkg_version binutils)" PKG_LICENSE="GPL" -PKG_SITE="https://www.gnu.org/software/binutils/" -PKG_URL="https://ftp.gnu.org/gnu/binutils/binutils-${PKG_VERSION}.tar.xz" +PKG_URL="" PKG_DEPENDS_HOST="toolchain:host" PKG_LONGDESC="A GNU collection of binary utilities for 64-bit ARM." +PKG_DEPENDS_UNPACK+=" binutils" +PKG_PATCH_DIRS+=" $(get_pkg_directory binutils)/patches" PKG_CONFIGURE_OPTS_HOST="--target=aarch64-none-elf \ --with-sysroot=${SYSROOT_PREFIX} \ @@ -28,6 +28,11 @@ PKG_CONFIGURE_OPTS_HOST="--target=aarch64-none-elf \ --enable-lto \ --disable-nls" +unpack() { + mkdir -p ${PKG_BUILD} + tar --strip-components=1 -xf ${SOURCES}/binutils/binutils-${PKG_VERSION}.tar.xz -C ${PKG_BUILD} +} + pre_configure_host() { unset CPPFLAGS unset CFLAGS diff --git a/packages/devel/binutils-aarch64/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch b/packages/devel/binutils-aarch64/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch deleted file mode 100644 index 1619cef941..0000000000 --- a/packages/devel/binutils-aarch64/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch +++ /dev/null @@ -1,32 +0,0 @@ -simplified patch based on -http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch -just detect and skip system directories if used by mistake - -linker output in case of using /usr/lib path: -/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/6.2.0/../../../../x86_64-libreelec-linux-gnu/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation, ignore it - -From 7ab8e318659eb5d9adc758c78d084a95560b93fd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 15 Jan 2016 06:31:09 +0000 -Subject: [PATCH 09/13] warn for uses of system directories when cross linking - ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -103,6 +103,17 @@ ldfile_add_library_path (const char *nam - if (!cmdline && config.only_cmd_line_lib_dirs) - return; - -+ /* skip those directories when linking */ -+ if ((!strncmp (name, "/lib", 4)) || -+ (!strncmp (name, "/usr/lib", 8)) || -+ (!strncmp (name, "/usr/local/lib", 14)) || -+ (!strncmp (name, "/usr/X11R6/lib", 14))) -+ { -+ einfo (_("%P: warning: library search path \"%s\" is unsafe for " -+ "cross-compilation, ignore it\n"), name); -+ return; -+ } -+ - new_dirs = (search_dirs_type *) xmalloc (sizeof (search_dirs_type)); - new_dirs->next = NULL; - new_dirs->cmdline = cmdline; diff --git a/packages/devel/binutils-aarch64/patches/nodocs.patch b/packages/devel/binutils-aarch64/patches/nodocs.patch deleted file mode 100644 index 11bbb87798..0000000000 --- a/packages/devel/binutils-aarch64/patches/nodocs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/binutils/Makefile.in -+++ b/binutils/Makefile.in -@@ -569,7 +569,7 @@ zlibdir = @zlibdir@ - zlibinc = @zlibinc@ - AUTOMAKE_OPTIONS = dejagnu no-dist foreign subdir-objects - ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd --SUBDIRS = doc po -+SUBDIRS = - tooldir = $(exec_prefix)/$(target_alias) - - # Automake 1.10+ disables lex and yacc output file regeneration if From ab6afc055fa686dc58e2ee57c8de42cf5c63dc1b Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 6 May 2022 07:50:38 +0000 Subject: [PATCH 2/2] binutils-or1k: update to use binutils package source and version --- packages/devel/binutils-or1k/package.mk | 13 +++++--- ...uses-of-system-directories-when-link.patch | 32 ------------------- .../devel/binutils-or1k/patches/nodocs.patch | 11 ------- 3 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 packages/devel/binutils-or1k/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch delete mode 100644 packages/devel/binutils-or1k/patches/nodocs.patch diff --git a/packages/devel/binutils-or1k/package.mk b/packages/devel/binutils-or1k/package.mk index e21c67b321..0c6b7657e9 100644 --- a/packages/devel/binutils-or1k/package.mk +++ b/packages/devel/binutils-or1k/package.mk @@ -3,13 +3,13 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="binutils-or1k" -PKG_VERSION="2.37" -PKG_SHA256="820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c" +PKG_VERSION="$(get_pkg_version binutils)" PKG_LICENSE="GPL" -PKG_SITE="https://www.gnu.org/software/binutils/" -PKG_URL="https://ftp.gnu.org/gnu/binutils/binutils-${PKG_VERSION}.tar.xz" +PKG_URL="" PKG_DEPENDS_HOST="toolchain:host" PKG_LONGDESC="A GNU collection of binary utilities for OpenRISC 1000." +PKG_DEPENDS_UNPACK+=" binutils" +PKG_PATCH_DIRS+=" $(get_pkg_directory binutils)/patches" PKG_CONFIGURE_OPTS_HOST="--target=or1k-none-elf \ --with-sysroot=${SYSROOT_PREFIX} \ @@ -28,6 +28,11 @@ PKG_CONFIGURE_OPTS_HOST="--target=or1k-none-elf \ --enable-lto \ --disable-nls" +unpack() { + mkdir -p ${PKG_BUILD} + tar --strip-components=1 -xf ${SOURCES}/binutils/binutils-${PKG_VERSION}.tar.xz -C ${PKG_BUILD} +} + pre_configure_host() { unset CPPFLAGS unset CFLAGS diff --git a/packages/devel/binutils-or1k/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch b/packages/devel/binutils-or1k/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch deleted file mode 100644 index 1619cef941..0000000000 --- a/packages/devel/binutils-or1k/patches/binutils-01-warn-for-uses-of-system-directories-when-link.patch +++ /dev/null @@ -1,32 +0,0 @@ -simplified patch based on -http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch -just detect and skip system directories if used by mistake - -linker output in case of using /usr/lib path: -/data/LibreELEC.tv/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/6.2.0/../../../../x86_64-libreelec-linux-gnu/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation, ignore it - -From 7ab8e318659eb5d9adc758c78d084a95560b93fd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 15 Jan 2016 06:31:09 +0000 -Subject: [PATCH 09/13] warn for uses of system directories when cross linking - ---- a/ld/ldfile.c -+++ b/ld/ldfile.c -@@ -103,6 +103,17 @@ ldfile_add_library_path (const char *nam - if (!cmdline && config.only_cmd_line_lib_dirs) - return; - -+ /* skip those directories when linking */ -+ if ((!strncmp (name, "/lib", 4)) || -+ (!strncmp (name, "/usr/lib", 8)) || -+ (!strncmp (name, "/usr/local/lib", 14)) || -+ (!strncmp (name, "/usr/X11R6/lib", 14))) -+ { -+ einfo (_("%P: warning: library search path \"%s\" is unsafe for " -+ "cross-compilation, ignore it\n"), name); -+ return; -+ } -+ - new_dirs = (search_dirs_type *) xmalloc (sizeof (search_dirs_type)); - new_dirs->next = NULL; - new_dirs->cmdline = cmdline; diff --git a/packages/devel/binutils-or1k/patches/nodocs.patch b/packages/devel/binutils-or1k/patches/nodocs.patch deleted file mode 100644 index 11bbb87798..0000000000 --- a/packages/devel/binutils-or1k/patches/nodocs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/binutils/Makefile.in -+++ b/binutils/Makefile.in -@@ -569,7 +569,7 @@ zlibdir = @zlibdir@ - zlibinc = @zlibinc@ - AUTOMAKE_OPTIONS = dejagnu no-dist foreign subdir-objects - ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd --SUBDIRS = doc po -+SUBDIRS = - tooldir = $(exec_prefix)/$(target_alias) - - # Automake 1.10+ disables lex and yacc output file regeneration if