Skip to contentSkip to conversation

binutils: install libiberty for host build

PATCH New aduskett at gmail.com 5 participants 16 messages Feb 6, 2019 – Mar 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

From: Adam Duskett <[email protected]>

Add --enable-install-libiberty to HOST_BINUTILS_CONF_OPTS to allow prelink-cross to build properly.

---
Changes v1 -> v7:
- Add patch to series.

Changes v7 -> v10:
- None

 package/binutils/binutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/binutils/binutils.mk +1 -0
index 4531b8d9c8..388e2192b4 100644
@@ -84,6 +84,7 @@ HOST_BINUTILS_CONF_OPTS = \
 	--target=$(GNU_TARGET_NAME) \
 	--disable-shared \
 	--enable-static \
+	--enable-install-libiberty \
 	--with-sysroot=$(STAGING_DIR) \
 	--enable-poison-system-directories \
 	$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
Signature · 1 line
2.20.1
#1 lore raw

PATCH v10 2/6 prelink-cross: new package

From: Adam Duskett <[email protected]>

Prelink-cross emulates a runtime linker for a given sysroot. This is necessary to allow gobject-introspection to build it's typelib files during cross-compiling.

---
Changes v1 -> v7:
- Add patch to series.

Changes v7 -> v8:
- None

Changes v8 -> v9:
- Add the package to the DEVELOPERS file under my name.
- Bump version to a853a5d715d84eec93aa68e8f2df26b7d860f5b2
- Add host-elfutils as a dependency.

Changes v9 -> v10:
- None

 DEVELOPERS                               |  1 +
 package/Config.in.host                   |  1 +
 package/prelink-cross/Config.in.host     |  9 +++++++++
 package/prelink-cross/prelink-cross.hash |  3 +++
 package/prelink-cross/prelink-cross.mk   | 15 +++++++++++++++
 5 files changed, 29 insertions(+)
 create mode 100644 package/prelink-cross/Config.in.host
 create mode 100644 package/prelink-cross/prelink-cross.hash
 create mode 100644 package/prelink-cross/prelink-cross.mk
DEVELOPERS +1 -0
index 59e1f32ba9..ab55415d0e 100644
@@ -51,6 +51,7 @@ F:	package/libsemanage/
 F:	package/libsepol/
 F:	package/nginx-naxsi/
 F:	package/policycoreutils/
+F:	package/prelink-cross/
 F:	package/python-flask-sqlalchemy/
 F:	package/python-mutagen/
 F:	package/python-pip/
package/Config.in.host +1 -0
index 3b75f23dd7..d38d9f4139 100644
@@ -44,6 +44,7 @@ menu "Host utilities"
 	source "package/parted/Config.in.host"
 	source "package/patchelf/Config.in.host"
 	source "package/pkgconf/Config.in.host"
+	source "package/prelink-cross/Config.in.host"
 	source "package/pru-software-support/Config.in.host"
 	source "package/pwgen/Config.in.host"
 	source "package/python-cython/Config.in.host"
package/prelink-cross/Config.in.host new file +9 -0
new file mode 100644
index 0000000000..0c54f6a8c4
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_HOST_PRELINK_CROSS
+	bool "host prelink-cross"
+	help
+	  The prelink package contains a utility which modifies
+	  ELF shared libraries and executables, so that far fewer
+	  relocations need to be resolved at runtime and thus
+	  programs come up faster.
+
+	  https://wiki.yoctoproject.org/wiki/Cross-Prelink
package/prelink-cross/prelink-cross.hash new file +3 -0
new file mode 100644
index 0000000000..3ac33ac3d0
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  cb3f5d833cd74b7e90e38465c9c948b0f4138c017509cb91e391b0931063429e  prelink-cross-a853a5d715d84eec93aa68e8f2df26b7d860f5b2.tar.gz
+sha256  b8a2f73f743dc1a51aff23f1aacbca4b868564db52496fa3c0caba755bfd1eaf  COPYING
package/prelink-cross/prelink-cross.mk new file +15 -0
new file mode 100644
index 0000000000..ab7a967f95
@@ -0,0 +1,15 @@
+################################################################################
+#
+# host-prelink-cross
+#
+################################################################################
+
+HOST_PRELINK_CROSS_VERSION = a853a5d715d84eec93aa68e8f2df26b7d860f5b2
+HOST_PRELINK_CROSS_SITE = git://git.yoctoproject.org/prelink-cross
+HOST_PRELINK_CROSS_SITE_METHOD = git
+HOST_PRELINK_CROSS_LICENSE = GPL-2.0
+HOST_PRELINK_CROSS_LICENSE_FILES = COPYING
+HOST_PRELINK_CROSS_AUTORECONF = YES
+HOST_PRELINK_CROSS_DEPENDENCIES = host-binutils host-elfutils
+
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#2 lore raw

PATCH v10 2/6 prelink-cross: new package

Hello,

Quoted 10 lines · On Wed, 6 Feb 2019 04:15:27 -0500 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Prelink-cross emulates a runtime linker for a given sysroot. This is necessary to allow gobject-introspection to build it's typelib files during cross-compiling.

---
Changes v1 -> v7:
- Add patch to series.

The visible Config.in.host is not needed, for now, this package is just used as a build dependency of gobject-introspection. So I've dropped the visible Config.in.host option, and applied.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v10 3/6 package/qemu: drop host kernel version check

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

There is no clean way to check if a program will actually run using host-qemu, making this check too restrictive.

---
Changes v1 -> v10:
- Add this patch to the series.

 package/qemu/qemu.mk | 22 ----------------------
 1 file changed, 22 deletions(-)
package/qemu/qemu.mk +0 -22
index 30cd5972ef..4ce8c129ea 100644
@@ -226,28 +226,6 @@ ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
 $(error "qemu-user can only be used on Linux hosts")
 endif
 
-# kernel version as major*256 + minor
-HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
-
-#
-# The principle of qemu-user is that it emulates the instructions of
-# the target architecture when running the binary, and then when this
-# binary does a system call, it converts this system call into a
-# system call on the host machine. This mechanism makes an assumption:
-# that the target binary will not do system calls that do not exist on
-# the host. This basically requires that the target binary should be
-# built with kernel headers that are older or the same as the kernel
-# version running on the host machine.
-#
-
-ifeq ($(BR_BUILDING),y)
-ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
-$(error "Refusing to build qemu-user: target Linux version newer than host's.")
-endif
-endif # BR_BUILDING
-
 else # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
 HOST_QEMU_OPTS += --disable-linux-user
 endif # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
Signature · 1 line
2.20.1
#4 lore raw

PATCH v10 4/6 gobject-introspection: new package

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

GObject introspection is a middleware layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.

There's an XML format called GIR used by GObject-Introspection. The purpose of it is to provide a standard structure to access the complete available API that a library or other unit of code exports. It is meant to be language agnostic using namespaces to separate core, language or library specific functionality.

Cross-compiling gobject-introspection is not an easy task. The main issue is that in the process of creating the XML files, gobject-introspection must first run and scan the binary, which, if the binary is cross-compiled, would not typically be possible from the host system.

Because of this limitation, several wrappers are used to call instead first out qemu which will then run the native scanner to create the binaries.

There are seven total patches and four different wrapper files needed to successfully cross-compile and run this package, many of them are from open-embedded, but two of them are of my own doing.

1) Revert a previous, incomplete attempt at adding cross-compiling support.

2) Add support for the various wrappers. (See patch for details.)

3) Add an option to use a binary wrapper; this patch will force giscanner to use a wrapper executable to run binaries it's producing, instead of attempting to run them from the host.

4) Add an option to use an LDD wrapper, again, useful for cross-compiled environments.

5) Overwrite python includes during the initial configure stage.

6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)

7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the environment for the package to correctly link against the passed on paths.

---
Changes v1 -> v2:
- Fixed wrappers
- Added 0007-giscanner-add-a-lib-dirs-envvar-option.patch
- Added 0008-add-Float128.patch

Changes v2 -> v3:
- Removed Linux kernel dependency (baruch)
- Changed $(LINUX_VERSION) to $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) (baruch)
- Changed @LINUX_VERSION@ in g-ir-scanner-qemuwrapper.in to @TOOLCHAIN_HEADERS_VERSION@ to match the above variable change.
- Added BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET in Config.in with only BR2_arm selected for now.
- Removed BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS in favor of the above change.
- Added two new lines in the base Makefile which removes any remaining .gir or .rnc files from the target filing system, as these are not needed for runtime, only compile time.

Changes v3 -> v4:
- Removed RFC tag.
- Added 0007-Add-rpath-links-to-ccompiler.patch
- Removed config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch as it is not Yocto specific.
- Added the _GIR_EXTRA_LIBS_PATH to pkg-autotools.mk. This allows package specific Gir libraries to be passed on to g-ir-scanner-qemuwrapper.
- Fixed a typo in g-ir-scanner-qemuwrapper.in.
- Remove BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET in favor of BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS

Changes v4 -> v5:
- Added a more detailed commit message (Yann)
- Removed $HOST_DIR/bin/qemu- at HOST_QEMU_ARCH@ @HOST_QEMU_CPU_TUNE@ in favor of @QEMU_USER@ (Thanks Yann)

Changes v5 -> v6:
- Update gobject-introspection to 1.56.1
- Remove upstreamed 0008-add-Float128.patch

Changes v6 -> v7:
- Remove the cross-ldd script in favor of the prelink-cross package.
- Install the ldd and qemu wrappers in a post patch hook seperate of the other wrappers.
- Set --enable-introspection-data in the configure options.

Changes v7 -> v8:
- Add "select BR2_PACKAGE_HOST_PRELINK_CROSS" to Config.in

Changes v8 -> v9:
- Create the $(STAGING_DIR)/usr/lib/gio/modules-dummy directory in the GOBJECT_INTROSPECTION_POST_PATCH_HOOKS to prevent qemu from segfaulting when g-ir-scanner-qemuwrapper is ran.
- Remove the $(STAGING_DIR) prefix from gobject-introspection-1.0.pc to prevent pkg-config from appending a second staging_dir to the path of the g-ir-compiler. This prevents packages such a gstreamer1 from trying to call $(STAGING_DIR)/$(STAGING_DIR)/usr/bin/g-ir-compiler, which will break the build.

Changes v9 -> v10:
- Makefile cleanup
- Fix license syntax (Thomas)
- Add libffi as a mandatory dependency (Thomas)
- remove --disalbe-static (Thomas)
- add --with-cairo if the cairo package is selected (Thomas)
- Change PYTHON_INCLUDES to PYTHON_CONFIG in gobject-introspection.mk (Thomas)
- Use | for all sed functions (Thomas)
- Remove GOBJECT_INTROSPECTION_WRAPPERS (Thomas)
- Add GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES target finalize hook. (Thomas)
- Use $(dirname $0) in wrappers instead of $STAGING_DIR (Thomas)
- Remove _GIR_EXTRA_LIBS_PATH in pkg-autotools.mk in favor of a seperate patch. (Thomas)

 DEVELOPERS                                    |   1 +
 package/Config.in                             |   1 +
 ...lete-upstream-attempt-at-cross-compi.patch |  50 +++++
 ...-host-gi-gi-cross-wrapper-gi-ldd-wra.patch | 203 ++++++++++++++++++
 ...canner-add-use-binary-wrapper-option.patch |  52 +++++
 ...scanner-add-a-use-ldd-wrapper-option.patch |  48 +++++
 ...-user-PYTHON_CONFIG-to-find-includes.patch |  31 +++
 ...scanner-add-a-lib-dirs-envvar-option.patch |  74 +++++++
 .../0007-Add-rpath-links-to-ccompiler.patch   |  29 +++
 .../0008-fix-gobject-pc.file.patch            |  41 ++++
 package/gobject-introspection/Config.in       |  30 +++
 .../gobject-introspection/g-ir-compiler.in    |   2 +
 .../g-ir-scanner-lddwrapper.in                |   2 +
 .../g-ir-scanner-qemuwrapper.in               |  17 ++
 package/gobject-introspection/g-ir-scanner.in |   7 +
 .../gobject-introspection.hash                |   4 +
 .../gobject-introspection.mk                  | 107 +++++++++
 17 files changed, 699 insertions(+)
 create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch
 create mode 100644 package/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch
 create mode 100644 package/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch
 create mode 100644 package/gobject-introspection/0005-user-PYTHON_CONFIG-to-find-includes.patch
 create mode 100644 package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch
 create mode 100644 package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch
 create mode 100644 package/gobject-introspection/0008-fix-gobject-pc.file.patch
 create mode 100644 package/gobject-introspection/Config.in
 create mode 100644 package/gobject-introspection/g-ir-compiler.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in
 create mode 100644 package/gobject-introspection/g-ir-scanner.in
 create mode 100644 package/gobject-introspection/gobject-introspection.hash
 create mode 100644 package/gobject-introspection/gobject-introspection.mk
DEVELOPERS +1 -0
index ab55415d0e..745dcfdeca 100644
@@ -34,6 +34,7 @@ F:	package/audit/
 F:	package/busybox/
 F:	package/checkpolicy/
 F:	package/cppdb/
+F:	package/gobject-introspection/
 F:	package/gstreamer1/gstreamer1/
 F:	package/gstreamer1/gstreamer1-mm/
 F:	package/gstreamer1/gst1-plugins-bad/
package/Config.in +1 -0
index 6273ea8197..02adfe0a68 100644
@@ -1645,6 +1645,7 @@ menu "Other"
 	source "package/glibmm/Config.in"
 	source "package/glm/Config.in"
 	source "package/gmp/Config.in"
+	source "package/gobject-introspection/Config.in"
 	source "package/gsl/Config.in"
 	source "package/gtest/Config.in"
 	source "package/jemalloc/Config.in"
package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch new file +50 -0

50 lines not on this page · raw message

package/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch new file +203 -0

203 lines not on this page · raw message

package/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch new file +52 -0

52 lines not on this page · raw message

package/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch new file +48 -0

48 lines not on this page · raw message

package/gobject-introspection/0005-user-PYTHON_CONFIG-to-find-includes.patch new file +31 -0
new file mode 100644
index 0000000000..24802e3248
@@ -0,0 +1,31 @@
+From cfb482d4fe2c42e201bc6277a130c172f765ec75 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Tue, 5 Feb 2019 11:49:27 -0500
+Subject: [PATCH] use PYTHON_CONFIG to find includes
+
+Find the python includes from a passed PYTHON_CONFIG path.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ m4/python.m4 | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/m4/python.m4 b/m4/python.m4
+index ed5559d..cdaa665 100644
+--- a/m4/python.m4
++++ b/m4/python.m4
+@@ -43,7 +43,10 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+ [AC_REQUIRE([AM_PATH_PYTHON])
+ AC_MSG_CHECKING(for headers required to compile python extensions)
+ dnl deduce PYTHON_INCLUDES
+-PYTHON_INCLUDES=`$PYTHON-config --includes`
++if test -z "${PYTHON_CONFIG}" ; then
++   PYTHON_CONFIG=$PYTHON-config
++fi
++PYTHON_INCLUDES=`${PYTHON_CONFIG} --includes`
+ AC_SUBST(PYTHON_INCLUDES)
+ dnl check if the headers exist:
+ save_CPPFLAGS="$CPPFLAGS"
+-- 
+2.20.1
+
package/gobject-introspection/0006-giscanner-add-a-lib-dirs-envvar-option.patch new file +74 -0

74 lines not on this page · raw message

package/gobject-introspection/0007-Add-rpath-links-to-ccompiler.patch new file +29 -0
new file mode 100644
index 0000000000..02fcdbeb25
@@ -0,0 +1,29 @@
+From 72a427bc50daee8f1ded0e9221e53dbbf2a80f08 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <[email protected]>
+Date: Wed, 14 Mar 2018 12:07:10 -0400
+Subject: [PATCH] Add rpath links to ccompiler
+
+This patch allows gobject-introspection to process extra paths passed to the
+compiler via the GIR_EXTRA_LIBS_PATH variable.
+
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ giscanner/ccompiler.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
+index a8bd5b1..51bb9bc 100644
+--- a/giscanner/ccompiler.py
++++ b/giscanner/ccompiler.py
+@@ -163,6 +163,8 @@ class CCompiler(object):
+ 
+         for envvar in runtime_path_envvar:
+             if envvar in os.environ:
++                for envvar_path in os.environ[envvar].split(':'):
++                    args.append("-Wl,-rpath-link," + envvar_path)
+                 os.environ[envvar] = \
+                     os.pathsep.join(runtime_paths + [os.environ[envvar]])
+             else:
+-- 
+2.14.3
+
package/gobject-introspection/0008-fix-gobject-pc.file.patch new file +41 -0

41 lines not on this page · raw message

package/gobject-introspection/Config.in new file +30 -0
new file mode 100644
index 0000000000..333a2bcc37
@@ -0,0 +1,30 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+	bool "gobject-introspection"
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_USE_MMU # python3, libglib2
+	depends on BR2_USE_WCHAR # python3, libglib2 -> gettext
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_HOST_PRELINK_CROSS
+	select BR2_PACKAGE_HOST_QEMU
+	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
+	select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON
+	help
+	  GObject introspection is a middleware layer between C
+	  libraries (using GObject) and language bindings. The C library
+	  can be scanned at compile time and generate a metadata file,
+	  in addition to the actual native C library. Then at runtime,
+	  language bindings can read this metadata and automatically
+	  provide bindings to call into the C library.
+
+	  https://wiki.gnome.org/action/show/Projects/GObjectIntrospection
+
+comment "gobject-introspection needs a glibc toolchain w/ wchar, threads, dynamic library"
+	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
+		BR2_STATIC_LIBS || !BR2_TOOLCHAIN_USES_GLIBC
package/gobject-introspection/g-ir-compiler.in new file +2 -0
new file mode 100644
index 0000000000..579fd53fa4
@@ -0,0 +1,2 @@
+#!/bin/sh
+$(dirname $0)/g-ir-scanner-qemuwrapper $(dirname $0)/g-ir-compiler.real "$@"
package/gobject-introspection/g-ir-scanner-lddwrapper.in new file +2 -0
new file mode 100644
index 0000000000..02f5c2883d
@@ -0,0 +1,2 @@
+#!/bin/sh
+${HOST_DIR}/sbin/prelink-rtld --root=$(dirname $0)/../../ "$@"
package/gobject-introspection/g-ir-scanner-qemuwrapper.in new file +17 -0
new file mode 100644
index 0000000000..b69222d27a
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Pass -r to qemu-user as to trick glibc into not errorings out if the host kernel
+# is older than the target kernel.
+# Use a modules directory which does not exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+GIO_MODULE_DIR=$(dirname $0)/../lib/gio/modules-dummy \
+ at QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
+-L $(dirname $0)/../../ \
+-E LD_LIBRARY_PATH=$GIR_EXTRA_LIBS_PATH:.libs:$(dirname $0)/../lib:$(dirname $0)/../../lib \
+"$@"
+
+if [ $? -ne 0 ]; then
+    echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help."
+    echo '(typically like this: GIR_EXTRA_LIBS_PATH="$(@D)/.libs")'
+    exit 1
+fi
package/gobject-introspection/g-ir-scanner.in new file +7 -0
new file mode 100644
index 0000000000..09530aad56
@@ -0,0 +1,7 @@
+#!/bin/sh
+export GI_SCANNER_DISABLE_CACHE=1
+$HOST_DIR/bin/g-ir-scanner \
+--lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \
+--use-binary-wrapper=$(dirname $0)/g-ir-scanner-qemuwrapper \
+--use-ldd-wrapper=$(dirname $0)/g-ir-scanner-lddwrapper \
+--add-include-path=$(dirname $0)/../share/gir-1.0 "$@"
package/gobject-introspection/gobject-introspection.hash new file +4 -0
new file mode 100644
index 0000000000..6524da8909
@@ -0,0 +1,4 @@
+#From http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.56/gobject-introspection-1.56.1.sha256sum
+sha256 5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b gobject-introspection-1.56.1.tar.xz
+sha256 d245807f90032872d1438d741ed21e2490e1175dc8aa3afa5ddb6c8e529b58e5 COPYING.LGPL
+sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING.GPL
package/gobject-introspection/gobject-introspection.mk new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

PATCH v10 5/6 package/pkg-autotools.mk: Add PKG_GIR_EXTRA_LIBS_PATH variable

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Some packages require passing an extra libs path to gobject-introspection in order to compile their respective typelib files. This allows users to specify a PKG_GIR_EXTRA_LIBS_PATH variable in the respective packages mk file that will then be passed on to the g-ir-scanner, allowing those directory paths to be indexed.

---
Changes v1 -> v10:
- Add this patch to the series.

 package/pkg-autotools.mk | 3 +++
 1 file changed, 3 insertions(+)
package/pkg-autotools.mk +3 -0
index 45de99356f..06021f95c1 100644
@@ -162,6 +162,7 @@ endif
 
 $(2)_CONF_ENV			?=
 $(2)_CONF_OPTS			?=
+$(2)_GIR_EXTRA_LIBS_PATH	?=
 $(2)_MAKE_ENV			?=
 $(2)_MAKE_OPTS			?=
 $(2)_INSTALL_OPTS                ?= install
@@ -239,6 +240,8 @@ endef
 endif
 endif
 
+export GIR_EXTRA_LIBS_PATH=$$($$(PKG)_GIR_EXTRA_LIBS_PATH)
+
 $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 ifeq ($$($(2)_AUTORECONF),YES)
Signature · 1 line
2.20.1
#6 lore raw

PATCH v10 5/6 package/pkg-autotools.mk: Add PKG_GIR_EXTRA_LIBS_PATH variable

Adam, All,

On 2019-02-06 04:15 -0500, aduskett at gmail.com spake thusly:

Quoted 29 lines

From: Adam Duskett <[email protected]>

Some packages require passing an extra libs path to gobject-introspection in order to compile their respective typelib files. This allows users to specify a PKG_GIR_EXTRA_LIBS_PATH variable in the respective packages mk file that will then be passed on to the g-ir-scanner, allowing those directory paths to be indexed.

---
Changes v1 -> v10:
- Add this patch to the series.

 package/pkg-autotools.mk | 3 +++
 1 file changed, 3 insertions(+)
package/pkg-autotools.mk +1 -0
index 45de99356f..06021f95c1 100644
@@ -162,6 +162,7 @@ endif
 
 $(2)_CONF_ENV			?=
 $(2)_CONF_OPTS			?=
+$(2)_GIR_EXTRA_LIBS_PATH	?=
 $(2)_MAKE_ENV			?=
 $(2)_MAKE_OPTS			?=
 $(2)_INSTALL_OPTS                ?= install

package/pkg-autotools.mk endef · line 243

Quoted 4 lines
package/pkg-autotools.mk +1 -0
@@ -239,6 +240,8 @@ endef
 endif
 endif
 
+export GIR_EXTRA_LIBS_PATH=$$($$(PKG)_GIR_EXTRA_LIBS_PATH)

How can this even work?

The value of GIR_EXTRA_LIBS_PATH will be that of the last package parsed, and this is robably not what you really intended.

If a package needs to pass extra environment variables, there is already this (at least for most of our package infras, I believe):

FOO_CONF_ENV
FOO_MAKE_ENV

... which packages can set to add environment variables.

Regards,
Yann E. MORIN.

Quoted 10 lines
package/pkg-autotools.mk +0 -0
 $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 ifeq ($$($(2)_AUTORECONF),YES)
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH v10 5/6 package/pkg-autotools.mk: Add PKG_GIR_EXTRA_LIBS_PATH variable

Adam, All,

On 2019-03-17 09:57 +0100, Yann E. MORIN spake thusly:

Quoted 33 lines

On 2019-02-06 04:15 -0500, aduskett at gmail.com spake thusly:

Quoted 32 lines

From: Adam Duskett <[email protected]>

Some packages require passing an extra libs path to gobject-introspection in order to compile their respective typelib files. This allows users to specify a PKG_GIR_EXTRA_LIBS_PATH variable in the respective packages mk file that will then be passed on to the g-ir-scanner, allowing those directory paths to be indexed.

---
Changes v1 -> v10:
- Add this patch to the series.

 package/pkg-autotools.mk | 3 +++
 1 file changed, 3 insertions(+)
package/pkg-autotools.mk +1 -0
index 45de99356f..06021f95c1 100644
@@ -162,6 +162,7 @@ endif
 
 $(2)_CONF_ENV			?=
 $(2)_CONF_OPTS			?=
+$(2)_GIR_EXTRA_LIBS_PATH	?=
 $(2)_MAKE_ENV			?=
 $(2)_MAKE_OPTS			?=
 $(2)_INSTALL_OPTS                ?= install
@@ -239,6 +240,8 @@ endef
 endif
 endif
 
Quoted 3 lines

package/pkg-autotools.mk endef · line 243

Quoted 1 line
package/pkg-autotools.mk +1 -0
+export GIR_EXTRA_LIBS_PATH=$$($$(PKG)_GIR_EXTRA_LIBS_PATH)

How can this even work?

OK, so as Thomas pointed out, it may indeed work, because of the '$$' expansion that seen to be expanded at the time of build, not at the time the macro is called.

Still, the below explanation still stands.

Regards,
Yann E. MORIN.

Quoted 36 lines

The value of GIR_EXTRA_LIBS_PATH will be that of the last package parsed, and this is robably not what you really intended.

If a package needs to pass extra environment variables, there is already this (at least for most of our package infras, I believe):

FOO_CONF_ENV
FOO_MAKE_ENV

... which packages can set to add environment variables.

Regards,
Yann E. MORIN.

Quoted 10 lines
package/pkg-autotools.mk +0 -0
 $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 ifeq ($$($(2)_AUTORECONF),YES)
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v10 6/6 gstreamer1 packages: add support for introspection

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

Now that there is support for gobject-introspection, add the appropriate configuration options to support compiling against gobject-introspection.

In addition:
- gst1-plugins-base requires a patch to drop a incorrect reference to sdp when compiling the rtsp gir file.

---
Changes v1 -> v4:
- Add patch to series.

Changes v4 -> v5:
- Changed --enable-introspection=yes to --enable-introspection (Yann)
- Changed += GIR_EXTRA_LIBS_PATH="$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs"

    to GSTREAMER1_GIR_EXTRA_LIBS_PATH=$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs

Chagnes v5 -> v6:
- None

Changes v6 -> v7:
- Refresh for changes since v6.

Changes v7 -> v10:
- None

 .../gst1-plugins-bad/gst1-plugins-bad.mk      |  5 ++++
 ...ect-reference-to-gstreamer-sdp-in-Ma.patch | 26 +++++++++++++++++++
 .../gst1-plugins-base/gst1-plugins-base.mk    |  5 ++++
 package/gstreamer1/gstreamer1/gstreamer1.mk   |  6 +++++
 4 files changed, 42 insertions(+)
 create mode 100644 package/gstreamer1/gst1-plugins-base/0001-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +5 -0
index ac39f1e5ce..77795d8c69 100644
@@ -63,6 +63,11 @@ GST1_PLUGINS_BAD_CONF_OPTS += \
 
 GST1_PLUGINS_BAD_DEPENDENCIES = gst1-plugins-base gstreamer1
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BAD_CONF_OPTS += --enable-introspection
+GST1_PLUGINS_BAD_GIR_EXTRA_LIBS_PATH=$(@D)/gst-libs/gst/allocators/.libs
+endif
+
 ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
 # RPI has odd locations for several required headers.
 GST1_PLUGINS_BAD_CONF_ENV += \
package/gstreamer1/gst1-plugins-base/0001-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch new file +26 -0
new file mode 100644
index 0000000000..07d4d8c476
@@ -0,0 +1,26 @@
+From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 26 Oct 2015 17:30:14 +0200
+Subject: [PATCH] rtsp: drop incorrect reference to gstreamer-sdp in Makefile.am
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ gst-libs/gst/rtsp/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
+index 4f6d9f8..0afa370 100644
+--- a/gst-libs/gst/rtsp/Makefile.am
++++ b/gst-libs/gst/rtsp/Makefile.am
+@@ -79,7 +79,6 @@ GstRtsp- at [email protected]: $(INTROSPECTION_SCANNER) libgstrtsp- at GST_API_VERS
+ 		--libtool="$(LIBTOOL)" \
+ 		--pkg gio-2.0 \
+ 		--pkg gstreamer- at GST_API_VERSION@ \
+-		--pkg gstreamer-sdp- at GST_API_VERSION@ \
+ 		--pkg-export gstreamer-rtsp- at GST_API_VERSION@ \
+ 		--add-init-section="$(INTROSPECTION_INIT)" \
+ 		--output $@ \
+-- 
+2.6.2
package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk +5 -0
index fb976f9a94..d788d65495 100644
@@ -25,6 +25,11 @@ GST1_PLUGINS_BASE_CONF_OPTS += \
 
 GST1_PLUGINS_BASE_DEPENDENCIES = gstreamer1
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BASE_CONF_OPTS += --enable-introspection
+GST1_PLUGINS_BASE_GIR_EXTRA_LIBS_PATH=$(@D)/gst-libs/gst/tag/.libs:$(@D)/gst-libs/gst/video/.libs:$(@D)/gst-libs/gst/audio/.libs:$(@D)/gst-libs/gst/rtp/.libs
+endif
+
 # These plugins are listed in the order from ./configure --help
 ifeq ($(BR2_PACKAGE_ORC),y)
 GST1_PLUGINS_BASE_DEPENDENCIES += orc
package/gstreamer1/gstreamer1/gstreamer1.mk +6 -0
index 76a74a0806..ae22a1985a 100644
@@ -32,4 +32,10 @@ GSTREAMER1_DEPENDENCIES = \
 	libglib2 \
 	$(if $(BR2_PACKAGE_LIBUNWIND),libunwind)
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GSTREAMER1_DEPENDENCIES += gobject-introspection
+GSTREAMER1_CONF_OPTS += --enable-introspection
+GSTREAMER1_GIR_EXTRA_LIBS_PATH=$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.20.1
#9 lore raw

PATCH v10 6/6 gstreamer1 packages: add support for introspection

Adam, All,

On 2019-02-06 04:15 -0500, aduskett at gmail.com spake thusly:

Quoted 8 lines

From: Adam Duskett <[email protected]>

Now that there is support for gobject-introspection, add the appropriate configuration options to support compiling against gobject-introspection.

In addition:
- gst1-plugins-base requires a patch to drop a incorrect reference to sdp when compiling the rtsp gir file.

That patch touches Makefile.am, so you need to add:
GST1_PLUGINS_BASE_AUTORECONF = YES

But still, gst1-plugins-base do not build here, with a creepy segfault in qemu:

qemu: uncaught target signal 11 (Segmentation fault) - core dumped
/home/ymorin/dev/buildroot/br-goi/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/g-ir-scanner-qemuwrapper: line 11: 16451 Segmentation fault GIO_MODULE_DIR=$(dirname $0)/../lib/gio/modules-dummy /home/ymorin/dev/buildroot/br-goi/output/host/bin/qemu-arm -r 4.20 -L $(dirname $0)/../../ -E LD_LIBRARY_PATH=$GIR_EXTRA_LIBS_PATH:.libs:$(dirname $0)/../lib:$(dirname $0)/../../lib "$@"
If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help.
(typically like this: GIR_EXTRA_LIBS_PATH="$(@D)/.libs")
Command '['/home/ymorin/dev/buildroot/br-goi/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/g-ir-scanner-qemuwrapper', '/home/ymorin/dev/buildroot/br-goi/output/build/gst1-plugins-base-1.14.4/gst-libs/gst/audio/tmp-introspectqe9drlob/GstAudio-1.0', '--introspect-dump=/home/ymorin/dev/buildroot/br-goi/output/build/gst1-plugins-base-1.14.4/gst-libs/gst/audio/tmp-introspectqe9drlob/functions.txt,/home/ymorin/dev/buildroot/br-goi/output/build/gst1-plugins-base-1.14.4/gst-libs/gst/audio/tmp-introspectqe9drlob/dump.xml']' returned non-zero exit status 1.

Regards,
Yann E. MORIN.

Quoted 112 lines

---
Changes v1 -> v4:
- Add patch to series.

Changes v4 -> v5:
- Changed --enable-introspection=yes to --enable-introspection (Yann)
- Changed += GIR_EXTRA_LIBS_PATH="$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs"

    to GSTREAMER1_GIR_EXTRA_LIBS_PATH=$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs

Chagnes v5 -> v6:
- None

Changes v6 -> v7:
- Refresh for changes since v6.

Changes v7 -> v10:
- None

 .../gst1-plugins-bad/gst1-plugins-bad.mk      |  5 ++++
 ...ect-reference-to-gstreamer-sdp-in-Ma.patch | 26 +++++++++++++++++++
 .../gst1-plugins-base/gst1-plugins-base.mk    |  5 ++++
 package/gstreamer1/gstreamer1/gstreamer1.mk   |  6 +++++
 4 files changed, 42 insertions(+)
 create mode 100644 package/gstreamer1/gst1-plugins-base/0001-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +5 -0
index ac39f1e5ce..77795d8c69 100644
@@ -63,6 +63,11 @@ GST1_PLUGINS_BAD_CONF_OPTS += \
 
 GST1_PLUGINS_BAD_DEPENDENCIES = gst1-plugins-base gstreamer1
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BAD_CONF_OPTS += --enable-introspection
+GST1_PLUGINS_BAD_GIR_EXTRA_LIBS_PATH=$(@D)/gst-libs/gst/allocators/.libs
+endif
+
 ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
 # RPI has odd locations for several required headers.
 GST1_PLUGINS_BAD_CONF_ENV += \
package/gstreamer1/gst1-plugins-base/0001-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch new file +26 -0
new file mode 100644
index 0000000000..07d4d8c476
@@ -0,0 +1,26 @@
+From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 26 Oct 2015 17:30:14 +0200
+Subject: [PATCH] rtsp: drop incorrect reference to gstreamer-sdp in Makefile.am
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ gst-libs/gst/rtsp/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
+index 4f6d9f8..0afa370 100644
+--- a/gst-libs/gst/rtsp/Makefile.am
++++ b/gst-libs/gst/rtsp/Makefile.am
+@@ -79,7 +79,6 @@ GstRtsp- at [email protected]: $(INTROSPECTION_SCANNER) libgstrtsp- at GST_API_VERS
+ 		--libtool="$(LIBTOOL)" \
+ 		--pkg gio-2.0 \
+ 		--pkg gstreamer- at GST_API_VERSION@ \
+-		--pkg gstreamer-sdp- at GST_API_VERSION@ \
+ 		--pkg-export gstreamer-rtsp- at GST_API_VERSION@ \
+ 		--add-init-section="$(INTROSPECTION_INIT)" \
+ 		--output $@ \
+-- 
+2.6.2
package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk +5 -0
index fb976f9a94..d788d65495 100644
@@ -25,6 +25,11 @@ GST1_PLUGINS_BASE_CONF_OPTS += \
 
 GST1_PLUGINS_BASE_DEPENDENCIES = gstreamer1
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BASE_CONF_OPTS += --enable-introspection
+GST1_PLUGINS_BASE_GIR_EXTRA_LIBS_PATH=$(@D)/gst-libs/gst/tag/.libs:$(@D)/gst-libs/gst/video/.libs:$(@D)/gst-libs/gst/audio/.libs:$(@D)/gst-libs/gst/rtp/.libs
+endif
+
 # These plugins are listed in the order from ./configure --help
 ifeq ($(BR2_PACKAGE_ORC),y)
 GST1_PLUGINS_BASE_DEPENDENCIES += orc
package/gstreamer1/gstreamer1/gstreamer1.mk +6 -0
index 76a74a0806..ae22a1985a 100644
@@ -32,4 +32,10 @@ GSTREAMER1_DEPENDENCIES = \
 	libglib2 \
 	$(if $(BR2_PACKAGE_LIBUNWIND),libunwind)
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GSTREAMER1_DEPENDENCIES += gobject-introspection
+GSTREAMER1_CONF_OPTS += --enable-introspection
+GSTREAMER1_GIR_EXTRA_LIBS_PATH=$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs
+endif
+
 $(eval $(autotools-package))
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

In reply to aduskett at gmail.com
Quoted 9 lines · On Wed, 6 Feb 2019 04:15:26 -0500 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Add --enable-install-libiberty to HOST_BINUTILS_CONF_OPTS to allow prelink-cross to build properly.

---
Changes v1 -> v7:
- Add patch to series.

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#11 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

In reply to aduskett at gmail.com
Quoted 22 lines · On Wed, Feb 6, 2019 at 2:15 AM <[email protected]> wrote:

From: Adam Duskett <[email protected]>

Add --enable-install-libiberty to HOST_BINUTILS_CONF_OPTS to allow prelink-cross to build properly.

---
Changes v1 -> v7:
- Add patch to series.

Changes v7 -> v10:
- None

 package/binutils/binutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/binutils/binutils.mk +0 -0
index 4531b8d9c8..388e2192b4 100644

package/binutils/binutils.mk HOST_BINUTILS_CONF_OPTS = \ · line 87

Quoted 4 lines
package/binutils/binutils.mk +1 -0
@@ -84,6 +84,7 @@ HOST_BINUTILS_CONF_OPTS = \
        --target=$(GNU_TARGET_NAME) \
        --disable-shared \
        --enable-static \
+       --enable-install-libiberty \

This appears to break host-gdb due to this incompatible non-pic libiberty.a being in the library search path before the correct pic version:
-L/home/buildroot/buildroot/output/host/lib
-L/home/buildroot/buildroot/output/build/host-gdb-8.2.1/bfd/../libiberty/pic

build error for host-gdb:
/usr/bin/ld: /home/buildroot/buildroot/output/host/lib/libiberty.a(cp-demangle.o):
relocation R_X86_64_PC32 against symbol `cplus_demangle_builtin_types' can not be used when making a shared object; recompile with -fPIC

Deleting the incompatible /home/buildroot/buildroot/output/host/lib/libiberty.a allows host-gdb to build successfully.

Quoted 10 lines
package/binutils/binutils.mk +0 -1
        --with-sysroot=$(STAGING_DIR) \
        --enable-poison-system-directories \
        $(BINUTILS_DISABLE_GDB_CONF_OPTS) \
--

2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#12 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

In reply to aduskett at gmail.com

Adam, All,

On 2019-02-06 04:15 -0500, aduskett at gmail.com spake thusly:

Quoted 6 lines

From: Adam Duskett <[email protected]>

Add --enable-install-libiberty to HOST_BINUTILS_CONF_OPTS to allow prelink-cross to build properly.

So we've had to revert this and the prelink-cross patches, because there are problems we did not forsee.

First, with this very patch: it breaks hiost-gdb, which fails to build because there is an inconsistency with how ti tries to link with libiberty:

http://autobuild.buildroot.org/results/109/1098d6380f12f5bbd6dbc69edb06bd953d1edc3d/build-end.log

/usr/bin/ld: /home/buildroot/autobuild/instance-0/output/host/lib/libiberty.a(cplus-dem.o):
relocation R_X86_64_PC32 against symbol `_sch_istable' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value

To be noted, however, is that the target gdb does build nicely, even though we do build the target binutils with libiberty too.

In any case, this is a regeression that must be addressed.

Second, and more problematic: prelink-crosss depends on host-binutils, but host-binutils is not supposed to be built when using an external toolchain, otherwise our host-binutls' built ar, ld, etc... would collide and conflict with those of the toolchain.

Therefore, we must find a better solution to get that libiberty.

Third, about the qemu version check removal, Thomas and I believe this should be replaced by a 'comment' in the Kconfig, like:

if BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
comment "WARNING! If the kernel headers of your toolchain are" comment "more recent than the kernel on your build machine," comment "qemu-user may work unreliably. or even not at all." endif

Fourth, the FOO_GIR_EXTRA_LIBS_PATH is useless: packages can set it in their FOO_MAKE_ENV (and possibly, FOO_CONF_ENV) instead, as those variables *are* made for packages to pass extra environment variables.

Fifth, the gst1-plugins-base patch touches a Makefile.am so it should require an autoreconf. However, it does not autoreconf nicely, and requires macros from external packages, which is a pain to add. So we could accept a patch that also touches Makefile.in as well. Otherwise, on some systems, the build would try to run automake, and would fail.

So yes, it took that long to eventually have a look, but here we are.

The qemu version check removal and the GIR_EXTRA_LIBS_PATH ar pretty trivial. The gst1-plugins-base patch can be easily fixed.

The libiberty and gdb issue is probably not entirely trivial, but at least he target gdb is in the same situation but builds.

The biggest problem is to get libiberty from host-binutils when using an external toolchain.

Regards,
Yann E. MORIN.

Quoted 29 lines

---
Changes v1 -> v7:
- Add patch to series.

Changes v7 -> v10:
- None

 package/binutils/binutils.mk | 1 +
 1 file changed, 1 insertion(+)
package/binutils/binutils.mk +1 -0
index 4531b8d9c8..388e2192b4 100644
@@ -84,6 +84,7 @@ HOST_BINUTILS_CONF_OPTS = \
 	--target=$(GNU_TARGET_NAME) \
 	--disable-shared \
 	--enable-static \
+	--enable-install-libiberty \
 	--with-sysroot=$(STAGING_DIR) \
 	--enable-poison-system-directories \
 	$(BINUTILS_DISABLE_GDB_CONF_OPTS) \
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#13 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

Quoted 9 lines · Yann E. MORIN

First, with this very patch: it breaks hiost-gdb, which fails to build because there is an inconsistency with how ti tries to link with libiberty:

http://autobuild.buildroot.org/results/109/1098d6380f12f5bbd6dbc69edb06bd953d1edc3d/build-end.log

/usr/bin/ld: /home/buildroot/autobuild/instance-0/output/host/lib/libiberty.a(cplus-dem.o):
relocation R_X86_64_PC32 against symbol `_sch_istable' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value

Maybe this is due to building host-binutils with --disable-shared
--enable-static? Maybe the solution is to just add --enable-shared, i.e. build both shared and static?

That does mean that ld etc. may now link dynamically with the various
libraries, but host tools should now be relocatable thinks to our rpath fixup, so that shouldn't be a problem.

Regards,
Arnout

#14 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

Arnout, All,

On 2019-03-19 19:08 +0100, Arnout Vandecappelle spake thusly:

Quoted 11 lines · Yann E. MORIN
Quoted 9 lines

First, with this very patch: it breaks hiost-gdb, which fails to build because there is an inconsistency with how ti tries to link with libiberty:

http://autobuild.buildroot.org/results/109/1098d6380f12f5bbd6dbc69edb06bd953d1edc3d/build-end.log

/usr/bin/ld: /home/buildroot/autobuild/instance-0/output/host/lib/libiberty.a(cplus-dem.o):
relocation R_X86_64_PC32 against symbol `_sch_istable' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value

Quoted 7 lines

Maybe this is due to building host-binutils with --disable-shared
--enable-static? Maybe the solution is to just add --enable-shared, i.e. build both shared and static?

That does mean that ld etc. may now link dynamically with the various
libraries, but host tools should now be relocatable thinks to our rpath fixup, so that shouldn't be a problem.

Except wqe can't use binutils when we use an external toolchain, at least not in the current state anyway.

So we have to find an anleternative.

I was thinking of two solutions:

- change the existing host-binutils package to only install libiberty (and maybe a few others?) when using an external toolchain, or

- introduce a new virtual package, host-binutils-libs, which package would select when they need binutils libs; that virtual package would then depend on host-binutils for the internal toolchain, or would depend on host-bnutils-libs-for-real-this-time that just builds the libs.

TBH, I'm more inclined to look at the first solution, but it may make the package less maintainable over time. The second solution is maybe cleaner, but as you can seee, finding good neams is still not trivial.

Finally, maybe we can find a middles ground, with host-binutils-libs a real package for external toolchains, and an empty package that just depends on binutils for internal toolchains.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#15 lore raw

PATCH v10 1/6 binutils: install libiberty for host build

Quoted 18 lines · Yann E. MORIN

Arnout, All,

On 2019-03-19 19:08 +0100, Arnout Vandecappelle spake thusly:

Quoted 15 lines · Yann E. MORIN
Quoted 9 lines

First, with this very patch: it breaks hiost-gdb, which fails to build because there is an inconsistency with how ti tries to link with libiberty:

http://autobuild.buildroot.org/results/109/1098d6380f12f5bbd6dbc69edb06bd953d1edc3d/build-end.log

/usr/bin/ld: /home/buildroot/autobuild/instance-0/output/host/lib/libiberty.a(cplus-dem.o):
relocation R_X86_64_PC32 against symbol `_sch_istable' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value

Maybe this is due to building host-binutils with --disable-shared
--enable-static? Maybe the solution is to just add --enable-shared, i.e. build both shared and static?

Quoted 6 lines
Quoted 3 lines

That does mean that ld etc. may now link dynamically with the various
libraries, but host tools should now be relocatable thinks to our rpath fixup, so that shouldn't be a problem.

Except wqe can't use binutils when we use an external toolchain, at least not in the current state anyway.

I was only replying to the build failure, not to all the other issues you
pointed out. But now you force me into it...

Quoted 6 lines

So we have to find an anleternative.

I was thinking of two solutions:

- change the existing host-binutils package to only install libiberty (and maybe a few others?) when using an external toolchain, or

A slightly more verbose but more maintainable variant: introduce
BR2_PACKAGE_HOST_BINUTILS, BR2_PACKAGE_HOST_BINUTILS_FULL and BR2_PACKAGE_HOST_BINUTILS_LIBIBERTY blind options. Select _FULL from toolchain-buildroot and _LIBIBERTY from prelink-cross. Adapt the .mk file to do installation according to these options (similar to the BR2_PACKAGE_BINUTILS_TARGET option).

Quoted 6 lines

- introduce a new virtual package, host-binutils-libs, which package would select when they need binutils libs; that virtual package would then depend on host-binutils for the internal toolchain, or would depend on host-bnutils-libs-for-real-this-time that just builds the libs.

Sounds complicated...

Third option: introduce "libiberty" package that downloads a specific version
of binutils-gdb and only builds the libiberty part.

That said, none of the options are really attractive...

Quoted 7 lines

TBH, I'm more inclined to look at the first solution, but it may make the package less maintainable over time. The second solution is maybe cleaner, but as you can seee, finding good neams is still not trivial.

Finally, maybe we can find a middles ground, with host-binutils-libs a real package for external toolchains, and an empty package that just depends on binutils for internal toolchains.

I definitely don't like linking it directly to whether it's an external
toolchain or not.

Regards,
Arnout