Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2] Share gcc work directories
Date: Sat, 11 Jun 2011 08:57:48 +0100	[thread overview]
Message-ID: <1307779069.15712.229.camel@rex> (raw)
In-Reply-To: <5725a484a4e11d5893b7fdedfe8dad8e7ff33019.1307774199.git.liezhi.yang@windriver.com>

On Sat, 2011-06-11 at 15:19 +0800, Robert Yang wrote:
> This patched is derived from Richard, make gcc use the shared source
> directory during the different building:
> 
> 1) Make gcc-cross, gcc-cross-initial, gcc-cross-intermediate and
>    gcc-runtime share the same source directory.
> 
> 2) The source directory is ${TMPDIR}/work-shared/gcc-${PV}, for example:
>    tmp/work-shared/gcc-4.6.0
> 
> 3) gcc uses sed and creates config files against ${S} which means the
>    directory should not be shared. Change the way to make it work.
> 
> 4) Fix do_clean to clean the shared source directory and stamps
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/recipes-devtools/gcc/gcc-common.inc           |   32 ++++++++++++++++++-
>  meta/recipes-devtools/gcc/gcc-configure-common.inc |   10 +++++-
>  2 files changed, 39 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
> index a3fa234..7bf036c 100644
> --- a/meta/recipes-devtools/gcc/gcc-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-common.inc
> @@ -37,10 +37,38 @@ ${GNU_MIRROR}/gcc/	http://gcc.get-software.com/releases/ \n \
>  #
>  gcclibdir = "${libdir}/gcc"
>  BINV = "${PV}"
> -S = "${WORKDIR}/gcc-${PV}"
> -B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
> +#S = "${WORKDIR}/gcc-${PV}"
> +S = "${TMPDIR}/work-shared/gcc-${PV}/gcc-${PV}"
> +B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
> +
> +# SS means Shared Stamps directory
> +SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}"
> +do_fetch[stamp-base] = "${SS}"
> +do_unpack[stamp-base] = "${SS}"
> +do_patch[stamp-base] = "${SS}"
> +
> +# SW means Shared Work directory
> +SW = "${TMPDIR}/work-shared/gcc-${PV}"
> +WORKDIR_task-unpack = "${SW}"
> +WORKDIR_task-patch = "${SW}"
>  
>  target_includedir ?= "${includedir}"
>  target_libdir ?= "${libdir}"
>  target_base_libdir ?= "${base_libdir}"
>  target_prefix ?= "${prefix}"
> +
> +CLEANFUNCS += "workshared_clean"
> +# The do_clean should be exclusive since share ${S}
> +do_clean[lockfiles] = "${TMPDIR}/stamps/work-shared/gcc-${PV}.clean.lock"
> +
> +python workshared_clean () {
> +	"""clear the source directory"""
> +	dir = bb.data.expand("${SW}", d)
> +	bb.note("Removing " + dir)
> +	oe.path.remove(dir)
> +
> +	"""clear the the stamps in work-shared"""
> +	dir = "%s.*" % bb.data.expand(d.getVarFlag('do_fetch', 'stamp-base', True), d)
> +	bb.note("Removing " + dir)
> +	oe.path.remove(dir)
> +}
> diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> index f7b5836..c32242d 100644
> --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> @@ -87,7 +87,15 @@ do_configure () {
>  	export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
>  	(cd ${S} && gnu-configize) || die "failure running gnu-configize"
>  	
> -	# teach gcc to find correct target includedir when checking libc ssp support
> +	# teach gcc to find correct target includedir when checking libc ssp support,
> +	# save the files before hack them, so that we can always hack the fresh one.
> +	for i in configure.ac Makefile.in defaults.h configure; do
> +		[ ! -f ${S}/gcc/$i.orig ] && cp ${S}/gcc/$i ${S}/gcc/$i.orig
> +		cp ${S}/gcc/$i.orig ${S}/gcc/$i
> +	done
> +	# Make sure that ${S}/configure is newer than ${S}/gcc/configure to prevent
> +	# auto run autoconf.
> +	touch ${S}/configure
>  	sed -i 's:^\([ 	]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure.ac
>  	sed -i 's:^\([ 	]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure
>  

If I run something like a meta-toolchain build at the same time as a
target toolchain build, this isn't going to work. It will also break
when we start doing multilib builds with multiple toolchains as multiple
builds will use ${S} at once.

I think we're going to need to be able to influence these things we
currently set directly either from the configure commandline, or from
config files in ${B} instead of ${S}.

Cheers,

Richard




      reply	other threads:[~2011-06-11  8:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1307774199.git.liezhi.yang@windriver.com>
2011-06-11  7:19 ` [PATCH 1/2] bitbake: share source directory Robert Yang
2011-06-11  7:19 ` [PATCH 2/2] Share gcc work directories Robert Yang
2011-06-11  7:57   ` Richard Purdie [this message]

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=1307779069.15712.229.camel@rex \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox