From: tpetazzoni at uclibc.org <tpetazzoni@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] svn commit: trunk/buildroot/package
Date: Tue, 11 Nov 2008 10:32:31 -0800 (PST) [thread overview]
Message-ID: <20081111183231.E74AC3C989@busybox.net> (raw)
Author: tpetazzoni
Date: 2008-11-11 10:32:31 -0800 (Tue, 11 Nov 2008)
New Revision: 24000
Log:
Fix external toolchain build
This patch is a new version of a patch already sent several times on
the mailing-list, committed and reverted a few times by Daniel Laird,
due to several imperfections. This version is a new try at finding a
solution that works for everybody. Hopefully it'll work :-)
The original problem is that external toolchain builds failed because
packages couldn't find their dependent libraries at configure time and
could not be linked with them. To fix these two problems, two things
are added:
* The TARGET_LDFLAGS variable was exposed as LDFLAGS at ./configure
time thanks to TARGET_CONFIGURE_OPTS. The TARGET_LDFLAGS variable
contains -L options with the path in the STAGING_DIR for the
libraries. It allows ./configure scripts to properly compile the
small test programs testing whether a dependency is properly
installed.
* The TARGET_CFLAGS contains a new -Wl,--rpath-link option for both
$(STAGING_DIR)/lib and $(STAGING_DIR)/usr/lib. It allows library
depending on other libraries to link properly. The TARGET_CFLAGS is
exposed as CFLAGS in TARGET_CONFIGURE_OPTS.
This new version fixes a problem encountered by hartleys
<hartleys@visionengravers.com> when building the kernel. The problem
was that the -Wl,--rpath-link options were added to LDFLAGS, while
there are options for the C compiler, not the ld linker. Moving them
to CFLAGS seems to fix the issue.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Modified:
trunk/buildroot/package/Makefile.in
Changeset:
Modified: trunk/buildroot/package/Makefile.in
===================================================================
--- trunk/buildroot/package/Makefile.in 2008-11-11 11:43:27 UTC (rev 23999)
+++ trunk/buildroot/package/Makefile.in 2008-11-11 18:32:31 UTC (rev 24000)
@@ -38,7 +38,8 @@
#########################################################################
ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \
- -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
+ -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include \
+ -Wl,--rpath-link -Wl,$(STAGING_DIR)/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/usr/lib
TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT)
@@ -89,7 +90,9 @@
# else it's an external toolchain
#########################################################################
else
-TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_EXTERNAL_PATH)/$(TOOLCHAIN_EXTERNAL_PREFIX)/include
+TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \
+ -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_EXTERNAL_PATH)/$(TOOLCHAIN_EXTERNAL_PREFIX)/include \
+ -Wl,--rpath-link -Wl,$(STAGING_DIR)/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/usr/lib
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
endif
@@ -126,7 +129,8 @@
#"))
#TOOL_BUILD_DIR=$(BASE_DIR)/$(TOPDIR_PREFIX)toolchain_build_$(TOOLCHAIN_EXTERNAL_PREFIX)
TOOL_BUILD_DIR=$(BASE_DIR)/$(TOPDIR_PREFIX)toolchain_build_$(ARCH)$(COND_ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)
-TARGET_PATH="$(STAGING_DIR)/bin:$(TOOL_BUILD_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
+# Make sure that STAGING_DIR/usr/bin is in path for freetype-config etc.
+TARGET_PATH="$(STAGING_DIR)/usr/bin:$(STAGING_DIR)/bin:$(TOOL_BUILD_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
#IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(TOOLCHAIN_EXTERNAL_PREFIX)$(ROOTFS_SUFFIX)
IMAGE:=$(BINARIES_DIR)/$(BR2_ROOTFS_PREFIX).$(ARCH)$(COND_ARCH_FPU_SUFFIX)$(ROOTFS_SUFFIX)
@@ -196,7 +200,9 @@
TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
AR="$(TARGET_AR)" \
AS="$(TARGET_AS)" \
- LD="$(TARGET_LD) $(TARGET_LDFLAGS)" \
+ LD="$(TARGET_LD)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
NM="$(TARGET_NM)" \
CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
GCC="$(TARGET_CC) $(TARGET_CFLAGS)" \
next reply other threads:[~2008-11-11 18:32 UTC|newest]
Thread overview: 180+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-11 18:32 tpetazzoni at uclibc.org [this message]
2008-11-11 18:46 ` [Buildroot] svn commit: trunk/buildroot/package danieljlaird at hotmail.com
2008-11-11 19:10 ` Thomas Petazzoni
2008-11-11 20:52 ` danieljlaird at hotmail.com
2008-11-12 1:09 ` hartleys
2008-11-12 7:55 ` Thomas Petazzoni
2008-11-12 14:14 ` Arnar Mar Sig
2008-11-15 6:06 ` Roberto A. Foglietta
2008-11-15 9:22 ` danieljlaird at hotmail.com
2008-11-15 9:28 ` danieljlaird at hotmail.com
2008-11-15 9:40 ` Roberto A. Foglietta
2008-11-17 11:53 ` Daniel Laird
2008-11-18 3:26 ` Weber, Bernd
2008-11-15 21:20 ` Peter Korsgaard
2008-11-16 9:14 ` Roberto A. Foglietta
2008-11-21 14:51 ` Peter Korsgaard
2008-11-20 14:56 ` Roberto A. Foglietta
2008-11-20 19:13 ` danieljlaird at hotmail.com
2008-11-22 14:04 ` Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2009-03-02 7:59 jacmet at uclibc.org
2009-02-13 9:18 jacmet at uclibc.org
2009-02-04 12:57 jacmet at uclibc.org
2009-02-02 0:39 hamish at uclibc.org
2009-02-02 6:25 ` Peter Korsgaard
2009-02-02 23:22 ` Hamish Moffatt
2009-02-01 16:10 ulf at uclibc.org
2009-01-28 6:32 jacmet at uclibc.org
2009-01-16 12:30 jacmet at uclibc.org
2009-01-13 0:46 hamish at uclibc.org
2009-01-11 20:13 ulf at uclibc.org
2009-01-05 15:23 jacmet at uclibc.org
2008-12-30 19:15 jacmet at uclibc.org
2008-12-29 15:22 jacmet at uclibc.org
2008-12-28 22:28 jacmet at uclibc.org
2008-12-15 22:07 tpetazzoni at uclibc.org
2008-12-15 22:42 ` Thomas Petazzoni
2008-12-16 0:37 ` Hamish Moffatt
2008-12-11 0:33 jacmet at uclibc.org
2008-12-08 8:08 egtvedt at uclibc.org
2008-11-21 14:51 jacmet at uclibc.org
2008-11-07 8:56 jacmet at uclibc.org
2008-11-07 8:15 laird at uclibc.org
2008-11-06 12:54 laird at uclibc.org
2008-11-06 15:54 ` hartleys
2008-11-06 16:39 ` Thomas Petazzoni
2008-11-06 17:44 ` danieljlaird at hotmail.com
2008-11-06 18:11 ` hartleys
2008-11-06 21:01 ` danieljlaird at hotmail.com
2008-11-06 22:20 ` Thomas Petazzoni
2008-10-22 15:28 laird at uclibc.org
2008-10-22 12:47 laird at uclibc.org
2008-10-22 15:01 ` Thomas Petazzoni
2008-10-20 11:32 jacmet at uclibc.org
2008-10-07 17:08 wberrier at uclibc.org
2008-10-07 23:17 ` Hamish Moffatt
2008-10-06 19:20 wberrier at uclibc.org
2008-09-19 14:43 laird at uclibc.org
2008-09-19 13:37 laird at uclibc.org
2008-09-14 19:19 jacmet at uclibc.org
2008-09-14 19:19 jacmet at uclibc.org
2008-09-04 2:34 hamish at uclibc.org
2008-09-04 1:19 hamish at uclibc.org
2008-09-04 1:05 hamish at uclibc.org
2008-08-29 12:04 laird at uclibc.org
2008-08-22 14:24 jacmet at uclibc.org
2008-08-22 14:24 jacmet at uclibc.org
2008-08-22 14:01 jacmet at uclibc.org
2008-08-16 11:59 jacmet at uclibc.org
2008-08-04 19:08 jacmet at uclibc.org
2008-08-04 19:08 jacmet at uclibc.org
2008-08-04 19:08 jacmet at uclibc.org
2008-08-04 19:07 jacmet at uclibc.org
2008-08-04 19:07 jacmet at uclibc.org
2008-08-04 19:07 jacmet at uclibc.org
2008-07-11 13:44 jacmet at uclibc.org
2008-07-10 8:17 jacmet at uclibc.org
2008-07-07 5:08 jacmet at uclibc.org
2008-07-06 6:23 ulf at uclibc.org
2008-07-07 5:06 ` Peter Korsgaard
2008-07-04 3:49 correa at uclibc.org
2008-07-02 8:58 jacmet at uclibc.org
2008-07-01 13:30 jacmet at uclibc.org
2008-07-01 12:04 jacmet at uclibc.org
2008-06-26 11:43 jacmet at uclibc.org
2008-06-24 18:35 jacmet at uclibc.org
2008-06-24 13:26 jacmet at uclibc.org
2008-06-14 21:01 jacmet at uclibc.org
2008-05-31 7:27 jacmet at uclibc.org
2008-04-19 20:44 jacmet at uclibc.org
2008-04-12 9:44 nkukard at uclibc.org
2008-04-01 10:30 jacmet at uclibc.org
2008-03-28 23:13 jacmet at uclibc.org
2008-03-28 10:40 jacmet at uclibc.org
2008-03-28 10:39 jacmet at uclibc.org
2008-03-28 10:39 jacmet at uclibc.org
2008-03-11 18:15 ninevoltz at uclibc.org
2008-03-11 19:12 ` Peter Korsgaard
2008-03-07 16:54 ninevoltz at uclibc.org
2008-03-07 20:32 ` Peter Korsgaard
2008-03-07 23:55 ` Hamish Moffatt
2008-03-10 10:40 ` Ivan Kuten
2008-03-10 23:50 ` Hamish Moffatt
2008-03-06 18:40 ninevoltz at uclibc.org
2008-03-06 18:39 ninevoltz at uclibc.org
2008-02-24 21:35 jacmet at uclibc.org
2008-02-24 23:03 ` Hamish Moffatt
2008-02-24 21:34 jacmet at uclibc.org
2008-02-24 20:17 jacmet at uclibc.org
2008-01-10 9:29 ulf at uclibc.org
2008-01-10 10:42 ` Hamish Moffatt
2008-01-10 11:04 ` Ulf Samuelsson
2008-01-10 13:45 ` Hamish Moffatt
2008-01-12 12:52 ` Ulf Samuelsson
2007-10-30 20:05 ulf at uclibc.org
2007-10-30 10:31 ulf at uclibc.org
2007-10-26 17:50 vanokuten at uclibc.org
2007-10-29 0:42 ` Hamish Moffatt
2007-10-30 20:00 ` Ulf Samuelsson
2007-10-18 7:40 ulf at uclibc.org
2007-10-18 5:56 ulf at uclibc.org
2007-09-29 14:27 aldot at uclibc.org
2007-09-29 10:05 aldot at uclibc.org
2007-09-28 22:15 aldot at uclibc.org
2007-09-28 19:49 ulf at uclibc.org
2007-09-27 21:58 aldot at uclibc.org
2007-09-20 18:28 aldot at uclibc.org
2007-09-20 17:27 aldot at uclibc.org
2007-09-20 11:14 aldot at uclibc.org
2007-09-20 11:08 aldot at uclibc.org
2007-09-12 4:40 ulf at uclibc.org
2007-09-01 17:32 aldot at uclibc.org
2007-08-28 8:14 aldot at uclibc.org
2007-08-24 14:18 aldot at uclibc.org
2007-08-22 16:56 aldot at uclibc.org
2007-08-22 16:44 aldot at uclibc.org
2007-08-22 16:28 aldot at uclibc.org
2007-08-22 16:21 aldot at uclibc.org
2007-08-22 16:19 aldot at uclibc.org
2007-08-22 16:08 aldot at uclibc.org
2007-08-22 16:02 aldot at uclibc.org
2007-08-22 15:59 aldot at uclibc.org
2007-08-22 15:52 aldot at uclibc.org
2007-08-14 6:18 ulf at uclibc.org
2007-08-06 19:41 ulf at uclibc.org
2007-07-31 15:10 aldot at uclibc.org
2007-07-27 12:47 aldot at uclibc.org
2007-07-23 12:03 aldot at uclibc.org
2007-07-23 12:01 ulf at uclibc.org
2007-07-23 11:37 aldot at uclibc.org
2007-07-22 20:09 sjhill at uclibc.org
2007-07-22 23:00 ` Ulf Samuelsson
2007-07-20 11:36 ulf at uclibc.org
2007-07-17 12:09 ulf at uclibc.org
2007-07-17 0:24 sjhill at uclibc.org
2007-07-12 15:32 ulf at uclibc.org
2007-07-02 8:58 aldot at uclibc.org
2007-06-26 14:02 aldot at uclibc.org
2007-05-07 4:01 sjhill at uclibc.org
2007-03-20 17:58 aldot at uclibc.org
2007-02-16 9:32 aldot at uclibc.org
2007-01-30 17:33 aldot at uclibc.org
2007-01-30 8:35 aldot at uclibc.org
2007-01-22 19:33 aldot at uclibc.org
2007-01-22 12:27 aldot at uclibc.org
2007-01-21 16:08 aldot at uclibc.org
2007-01-17 12:31 aldot at uclibc.org
2007-01-17 12:28 aldot at uclibc.org
2007-01-17 12:27 aldot at uclibc.org
2007-01-17 12:04 aldot at uclibc.org
2007-01-17 11:34 aldot at uclibc.org
2007-01-15 22:37 andersen at uclibc.org
2007-01-15 16:01 aldot at uclibc.org
2007-01-14 22:18 andersen at uclibc.org
2007-01-14 1:04 sjhill at uclibc.org
2006-12-15 14:37 aldot at uclibc.org
2006-12-08 12:45 aldot at uclibc.org
2006-10-01 18:34 aldot at uclibc.org
2006-09-30 21:08 aldot at uclibc.org
2006-08-29 16:41 aldot at uclibc.org
2006-08-24 19:35 aldot at uclibc.org
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=20081111183231.E74AC3C989@busybox.net \
--to=tpetazzoni@uclibc.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox