Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Allow Buildroot to update toolchain
@ 2013-09-26 20:12 ANDY KENNEDY
  2013-09-26 20:28 ` Peter Korsgaard
  0 siblings, 1 reply; 11+ messages in thread
From: ANDY KENNEDY @ 2013-09-26 20:12 UTC (permalink / raw)
  To: buildroot

Sometimes it is useful to self contain a toolchain.  To do this, one
must somehow build in the extra libraries needed to make the toolchain
complete.  This patch adjusts Buildroot to, by configuration, modify the
external toolchain while building additional libraries.

Signed-off-by: Andy Kennedy <andy.kennedy@adtran.com>
---
diff -Naur a/package/Makefile.in b/package/Makefile.in
--- a/package/Makefile.in	2013-09-17 06:42:07.000000000 -0500
+++ b/package/Makefile.in	2013-09-26 09:28:26.000000000 -0500
@@ -77,7 +77,9 @@
 endif
 
 STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
+ifneq ($(BR2_TOOLCHAIN_COPY_LIBS_INTO_TOOLCHAIN),y)
 STAGING_DIR    = $(HOST_DIR)/$(STAGING_SUBDIR)
+endif
 
 TARGET_OPTIMIZATION:=$(call qstrip,$(BR2_TARGET_OPTIMIZATION))
 
@@ -161,6 +163,11 @@
 TARGET_CC_NOCCACHE  := $(TARGET_CC)
 TARGET_CXX_NOCCACHE := $(TARGET_CXX)
 
+ifeq ($(BR2_TOOLCHAIN_COPY_LIBS_INTO_TOOLCHAIN),y)
+TARGET_CROSS=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))/bin/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
+STAGING_DIR    := $(shell $(TARGET_CC) --print-sysroot)
+endif
+
 ifeq ($(BR2_CCACHE),y)
 TARGET_CC  := $(CCACHE) $(TARGET_CC)
 TARGET_CXX := $(CCACHE) $(TARGET_CXX)
diff -Naur a/toolchain/helpers.mk b/toolchain/helpers.mk
--- a/toolchain/helpers.mk	2013-09-17 06:42:07.000000000 -0500
+++ b/toolchain/helpers.mk	2013-09-26 11:16:53.000000000 -0500
@@ -81,6 +81,10 @@
  \
 	echo -n
 
+ifeq ($(BR2_TOOLCHAIN_COPY_LIBS_INTO_TOOLCHAIN),y)
+	copy_toolchain_lib_root := echo "Not doing copy toolchain" ; exit ; $(copy_toolchain_lib_root)
+endif
+
 #
 # Copy the full external toolchain sysroot directory to the staging
 # dir. The operation of this function is rendered a little bit
@@ -160,6 +164,9 @@
 	fi ; \
 	find $(STAGING_DIR) -type d | xargs chmod 755
 
+ifeq ($(BR2_TOOLCHAIN_COPY_LIBS_INTO_TOOLCHAIN),y)
+	copy_toolchain_sysroot := echo "Not doing a copy" ; exit ; $(copy_toolchain_sysroot)
+endif
 #
 # Check the availability of a particular glibc feature. This function
 # is used to check toolchain options that are always supported by
diff -Naur a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
--- a/toolchain/toolchain-external/Config.in	2013-09-17 06:42:07.000000000 -0500
+++ b/toolchain/toolchain-external/Config.in	2013-09-25 16:33:48.000000000 -0500
@@ -948,6 +948,15 @@
 	  here, separated by spaces. They will be copied to the
 	  target's /lib directory.
 
+config BR2_TOOLCHAIN_COPY_LIBS_INTO_TOOLCHAIN
+	bool "Copy Libraries from Buildroot into toolchain sysroot"
+	help
+	  Select this option if you want to have Buildroot copy
+	  the generated libraries you have selected into the
+	  External toolchain.  This is useful if you want to make
+	  a fully loaded toolchain (with no external sysroot) for
+	  building standalone applications outside of Buildroot.
+
 endif # BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
 config BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-10-02 22:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 20:12 [Buildroot] [PATCH] Allow Buildroot to update toolchain ANDY KENNEDY
2013-09-26 20:28 ` Peter Korsgaard
2013-09-26 20:34   ` ANDY KENNEDY
2013-09-27  8:05     ` Thomas Petazzoni
2013-09-27 14:56       ` ANDY KENNEDY
2013-09-27 15:08       ` ANDY KENNEDY
2013-09-27 15:41         ` ANDY KENNEDY
2013-09-27 17:54           ` Thomas Petazzoni
2013-09-30 15:40             ` ANDY KENNEDY
2013-10-02 21:27               ` Thomas Petazzoni
2013-10-02 22:11                 ` ANDY KENNEDY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox