From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [RFC][PATCH] meta-toolchain: make SDK relocatable by using $SDK_PATH var in env setup script
Date: Thu, 04 Feb 2010 12:22:34 -0500 [thread overview]
Message-ID: <20100204172234.GA5641@denix.org> (raw)
In-Reply-To: <1265302671.25338.57.camel@conroy-linux>
On Thu, Feb 04, 2010 at 11:57:51AM -0500, Chris Conroy wrote:
> On Wed, 2010-02-03 at 20:43 -0500, Denys Dmytriyenko wrote:
> > Do not hard-code SDK location into all the libtool's .la files and other
> > libtool, pkg-config and opkg service variables and aliases. Use $SDK_PATH
> > environment variable instead, which is set once in the main environment-setup
> > script, allowing easy SDK relocation by adjusting a single variable.
> >
> > Signed-off-by: Denys Dmytriyenko <denis@denix.org>
> > ---
> > recipes/meta/meta-toolchain.bb | 25 ++++++++++++++-----------
> > 1 files changed, 14 insertions(+), 11 deletions(-)
> >
> > diff --git a/recipes/meta/meta-toolchain.bb b/recipes/meta/meta-toolchain.bb
> > index a8c27ec..2855fde 100644
> > --- a/recipes/meta/meta-toolchain.bb
> > +++ b/recipes/meta/meta-toolchain.bb
> > @@ -119,10 +119,10 @@ do_populate_sdk() {
> >
> > # Fix or remove broken .la files
> > for i in `find ${SDK_OUTPUT}/${SDKPATH}/${TARGET_SYS} -name \*.la`; do
> > - sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
> > - -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
> > - -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1${SDKPATH}/${TARGET_SYS}${base_libdir},g" \
> > - -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1${SDKPATH}/${TARGET_SYS}${libdir},g" \
> > + sed -i -e "/^dependency_libs=/s,\([[:space:]']\)${base_libdir},\1\$SDK_PATH/\$TARGET_SYS${base_libdir},g" \
> > + -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1\$SDK_PATH/\$TARGET_SYS${libdir},g" \
> > + -e "/^dependency_libs=/s,\-\([LR]\)${base_libdir},-\1\$SDK_PATH/\$TARGET_SYS${base_libdir},g" \
> > + -e "/^dependency_libs=/s,\-\([LR]\)${libdir},-\1\$SDK_PATH/\$TARGET_SYS${libdir},g" \
> > -e 's/^installed=yes$/installed=no/' $i
> > done
> > rm -f ${SDK_OUTPUT}/${SDKPATH}/lib/*.la
> > @@ -137,13 +137,16 @@ do_populate_sdk() {
> > # Create environment setup script
> > script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
> > touch $script
> > - echo 'export PATH=${SDKPATH}/bin:$PATH' >> $script
> > - echo 'export LIBTOOL_SYSROOT_PATH=${prefix}/${TARGET_SYS}' >> $script
> > - echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKPATH}/${TARGET_SYS}' >> $script
> > - echo 'export PKG_CONFIG_PATH=${SDKPATH}/${TARGET_SYS}${libdir}/pkgconfig' >> $script
> > - echo 'export CONFIG_SITE=${SDKPATH}/site-config' >> $script
> > - echo "alias opkg='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${sysconfdir}/opkg-sdk.conf -o ${SDKPATH}'" >> $script
> > - echo "alias opkg-target='LD_LIBRARY_PATH=${SDKPATH}/lib ${SDKPATH}/bin/opkg-cl -f ${SDKPATH}/${TARGET_SYS}${sysconfdir}/opkg.conf -o ${SDKPATH}/${TARGET_SYS}'" >> $script
> > + echo 'export SDK_PATH=${SDKPATH}' >> $script
> > + echo 'export TARGET_SYS=${TARGET_SYS}' >> $script
> > + echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
> > + echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
> > + echo 'export LIBTOOL_SYSROOT_PATH=$SDK_PATH/$TARGET_SYS' >> $script
> > + echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
> > + echo 'export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
> > + echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
> > + echo "alias opkg='LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDK_PATH/${sysconfdir}/opkg-sdk.conf -o $SDK_PATH'" >> $script
> > + echo "alias opkg-target='LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDK_PATH/$TARGET_SYS${sysconfdir}/opkg.conf -o $SDK_PATH/$TARGET_SYS'" >> $script
> >
> > # Add version information
> > versionfile=${SDK_OUTPUT}/${SDKPATH}/version
>
> The fact that both SDK_PATH and SDKPATH exist and apparently mean
> different things seems very wrong to me. IMHO one should be removed or
First of all, they are the same. Check conf/bitbake.conf:
SDKPATH = "${SDK_PATH}"
Second, ask RP why he introduced SDKPATH, when we had SDK_PATH for years (my
guess - that's what is used in Poky, so makes porting changes easier):
7c2bd627 (Richard Purdie 2009-11-12 11:51:18 +0000 342) SDKPATH = "${SDK_PATH}"
> renamed since having them both will be a source of confusion.
>
> It should probably be ${SDK_PATH} instead of $SDK_PATH in your changes.
You missed the whole point of the patch. It really should be $SDK_PATH
> Does this really make the SDK relocatable? I thought there were still
> major issues with relocating GCC.
GCC built from OE may still have relocation problems - haven't checked lately.
But it doesn't mean that's the only use case scenario... There is also
external toolchain option, as well as building SDK without the toolchain.
Both of those cases were tested with the above change for several months now.
--
Denys
next prev parent reply other threads:[~2010-02-04 17:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 1:43 [RFC][PATCH] meta-toolchain: make SDK relocatable by using $SDK_PATH var in env setup script Denys Dmytriyenko
2010-02-04 16:57 ` Chris Conroy
2010-02-04 17:22 ` Denys Dmytriyenko [this message]
2010-02-04 17:57 ` Tom Rini
2010-02-06 13:04 ` Phil Blundell
2010-02-08 19:00 ` Tom Rini
2010-02-09 20:08 ` Khem Raj
2010-02-09 21:36 ` Tom Rini
2010-02-10 15:50 ` Richard Purdie
2010-02-10 18:45 ` Tom Rini
2010-02-10 18:54 ` Phil Blundell
2010-02-04 18:42 ` Chris Conroy
2010-02-04 19:07 ` Denys Dmytriyenko
2010-02-08 23:31 ` Richard Purdie
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=20100204172234.GA5641@denix.org \
--to=denis@denix.org \
--cc=openembedded-devel@lists.openembedded.org \
/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.