toolchain-buildroot: create a relocatable one
PATCH 1/1 toolchain-buildroot: create a relocatable one
From: Tal Zilcer <[email protected]>
This adds ability so that pre built buildroot toolchain and GDB can be used by others in different computers without the need to build them again.
Note: the toolchain/GDB is still depended on native libraries.
--- package/expat/expat.mk | 4 ++++ package/gmp/gmp.mk | 4 ++++ package/mpc/mpc.mk | 4 ++++ package/mpfr/mpfr.mk | 4 ++++ toolchain/toolchain-buildroot/Config.in | 8 ++++++++ 5 files changed, 24 insertions(+), 0 deletions(-)
package/expat/expat.mk +4 -0
@@ -13,5 +13,9 @@ EXPAT_DEPENDENCIES = host-pkgconf EXPAT_LICENSE = MIT EXPAT_LICENSE_FILES = COPYING +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_STATIC),y) +HOST_EXPAT_CONF_OPT = --disable-shared +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
package/gmp/gmp.mk +4 -0
@@ -12,5 +12,9 @@ GMP_LICENSE = LGPLv3+ GMP_LICENSE_FILES = COPYING.LESSERv3 GMP_DEPENDENCIES = host-m4 +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_STATIC),y) +HOST_GMP_CONF_OPT = --disable-shared +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
package/mpc/mpc.mk +4 -0
@@ -11,5 +11,9 @@ MPC_LICENSE_FILES = COPYING.LESSER MPC_INSTALL_STAGING = YES MPC_DEPENDENCIES = gmp mpfr +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_STATIC),y) +HOST_MPC_CONF_OPT = --disable-shared +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
package/mpfr/mpfr.mk +4 -0
@@ -13,5 +13,9 @@ MPFR_INSTALL_STAGING = YES MPFR_DEPENDENCIES = gmp MPFR_MAKE_OPT = RANLIB=$(TARGET_RANLIB) +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_STATIC),y) +HOST_MPFR_CONF_OPT = --disable-shared +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))
toolchain/toolchain-buildroot/Config.in +8 -0
@@ -18,6 +18,14 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR If you're not sure, just leave the default "buildroot" value. +config BR2_TOOLCHAIN_BUILDROOT_STATIC + bool "static toolchain" + help + This option builds toolchain and gdb with static libraries + of mpc,mpfr,gmp, and expat. + It enable one to copy toolchain around to different directory + and even to another machine. Now toolchain is relocatable, enjoy. + source "package/linux-headers/Config.in.host" choice
Signature · 1 line
1.7.1
PATCH 1/1 toolchain-buildroot: create a relocatable one
Dear Noam Camus,
Quoted 9 lines · Noam Camus
From: Tal Zilcer <[email protected]>
This adds ability so that pre built buildroot toolchain and GDB can be used by others in different computers without the need to build them again.
Note: the toolchain/GDB is still depended on native libraries.
Signed-off-by Tal Zilcer <[email protected]>Signed-off-by Noam Camus <[email protected]>
Quoted 7 lines
--- package/expat/expat.mk | 4 ++++ package/gmp/gmp.mk | 4 ++++ package/mpc/mpc.mk | 4 ++++ package/mpfr/mpfr.mk | 4 ++++ toolchain/toolchain-buildroot/Config.in | 8 ++++++++ 5 files changed, 24 insertions(+), 0 deletions(-)
Thanks for this proposal. We discussed it during the last Buildroot meeting in D?sseldorf, and the general feeling is that while we acknowledge the current problem, we don't believe your proposal is the right solution.
The problem is that your solution only fixes gcc/gdb, but we generally want the "SDK" (so not only the toolchain itself, but also all other host tools like pkg-config, automake, autoconf, etc.) to be relocatable. We believe that the real solution is to use something like patchelf (https://nixos.org/patchelf.html) to adjust the RPATH of the binaries so that they use something like $ORIGIN/../lib, and therefore find the shared libraries where they are.
We have for now marked your patch as Rejected, but we definitely welcome other patches implementing the RPATH fixup solution.
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com