All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Why is sysroot under i686-buildroot-linux-gnu?
Date: Tue, 7 Jan 2014 14:45:53 +0800	[thread overview]
Message-ID: <20140107144553.15c189a4@skate> (raw)
In-Reply-To: <CAJpxd06=L5uMVHm2ZH2u5iRvB1CbRYQiJcaNfEheeNk-pqWc+w@mail.gmail.com>

Dear Bryce Schober,

On Mon, 6 Jan 2014 10:39:34 -0800, Bryce Schober wrote:

> > > Why does buildroot end up installing the toolchain sysroot under
> > > output/host/usr/i686-buildroot-linux-gnu instead of under
> > > output/host/usr/i686-unknown-linux-gnu?
> >
> > Just because we set the vendor part of the tuple to "Buildroot" to
> > distinguish the Buildroot compiler/sysroot from the one of the original
> > toolchain. There is no strong need for this, it's just a bit nicer.
> 
> Where is this done? In some brief probing of the toolchain makefiles, I
> didn't see it. Also it would be nice if it was an optional behavior, maybe
> I'll submit a patch when I find it...

http://git.buildroot.net/buildroot/tree/package/Makefile.in#n23

> > > This is causing some problems in some of my external makefiles I have
> > > that expect the sysroot dir to match the toolchain tuple...
> >
> > They do: in host/usr/bin/, you have a compiler whose tuple matches the
> > sysroot directory name.
> >
> 
> Yeah, my complaint is that the tuple in the path for the sysroot is
> different than that of the compiler, which makes any external reference to
> the buildroot toolchain more complicated. I have external makefiles that
> use the buildroot toolchain, and now I'll have to keep a $TOOLCHAIN_NAME
> separate from a $SYSROOT_NAME.

Ok, I think I see what you mean. Can you test the following patch and
see if it fixes the problem for you?

diff --git a/package/Makefile.in b/package/Makefile.in
index f5d6289..44cf046 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -138,11 +138,7 @@ TARGET_CFLAGS += -fstack-protector-all
 TARGET_CXXFLAGS += -fstack-protector-all
 endif
 
-ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
-else
-TARGET_CROSS=$(HOST_DIR)/usr/bin/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
-endif
 
 # Quotes are needed for spaces et al in path components.
 TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 1084ee2..cbfc15d 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -589,17 +589,18 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
 	mkdir -p $(HOST_DIR)/usr/bin; cd $(HOST_DIR)/usr/bin; \
 	for i in $(TOOLCHAIN_EXTERNAL_CROSS)*; do \
 		base=$${i##*/}; \
+		tool=$${base##$(TOOLCHAIN_EXTERNAL_PREFIX)-}; \
 		case "$$base" in \
 		*cc|*cc-*|*++|*++-*|*cpp) \
-			ln -sf ext-toolchain-wrapper $$base; \
+			ln -sf ext-toolchain-wrapper $(TARGET_CROSS)$$tool; \
 			;; \
 		*gdb|*gdbtui) \
 			if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
-				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') $(TARGET_CROSS)$$tool ; \
 			fi \
 			;; \
 		*) \
-			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') $(TARGET_CROSS)$$tool; \
 			;; \
 		esac; \
 	done ;

-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-01-07  6:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 23:54 [Buildroot] Why is sysroot under i686-buildroot-linux-gnu? Bryce Schober
2014-01-04 21:28 ` Thomas Petazzoni
2014-01-06 18:39   ` Bryce Schober
2014-01-07  6:45     ` Thomas Petazzoni [this message]
2014-01-07 20:43       ` Bryce Schober
2014-01-07 22:04         ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140107144553.15c189a4@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.