bitbake/gcc: Enable a shared common source tree

This patch is a quick proof of concept to show how source code could
be shared between recipes which use ${B} to have a separate build
directory compared to source directory ${S}.

Issues:

a) gcc uses sed and creates config files against ${S} which means
the directory should not be shared. Need to change the way that works.

b) Could be extended to cover eglibc except there is a patch applied
against nativesdk versions which again makes the source incompatible.

c) Need to clean up the layout in work-shared and make a directory level deeper
to ensure patch separation.

d) clean task does not remove stamps

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-03-28 15:09:50 +01:00
parent afd2859836
commit 12b163dbd8
4 changed files with 24 additions and 4 deletions

View File

@ -382,10 +382,10 @@ def stamp_internal(taskname, d, file_name):
taskflagname = taskname.replace("_setscene", "")
if file_name:
stamp = d.stamp[file_name]
stamp = d.stamp_base[file_name].get(taskflagname) or d.stamp[file_name]
extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
else:
stamp = d.getVar('STAMP', True)
stamp = d.getVarFlag(taskflagname, 'stamp-base', True) or d.getVar('STAMP', True)
file_name = d.getVar('BB_FILENAME', True)
extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info', True) or ""

View File

@ -55,6 +55,7 @@ recipe_fields = (
'provides',
'task_deps',
'stamp',
'stamp_base',
'stamp_extrainfo',
'broken',
'not_world',
@ -160,6 +161,7 @@ class RecipeInfo(namedtuple('RecipeInfo', recipe_fields)):
broken = cls.getvar('BROKEN', metadata),
not_world = cls.getvar('EXCLUDE_FROM_WORLD', metadata),
stamp = cls.getvar('STAMP', metadata),
stamp_base = cls.flaglist('stamp-base', tasks, metadata),
stamp_extrainfo = cls.flaglist('stamp-extra-info', tasks, metadata),
packages_dynamic = cls.listvar('PACKAGES_DYNAMIC', metadata),
depends = cls.depvar('DEPENDS', metadata),
@ -579,6 +581,7 @@ class CacheData(object):
self.task_queues = {}
self.task_deps = {}
self.stamp = {}
self.stamp_base = {}
self.stamp_extrainfo = {}
self.preferred = {}
self.tasks = {}
@ -604,6 +607,7 @@ class CacheData(object):
self.pkg_pepvpr[fn] = (info.pe, info.pv, info.pr)
self.pkg_dp[fn] = info.defaultpref
self.stamp[fn] = info.stamp
self.stamp_base[fn] = info.stamp_base
self.stamp_extrainfo[fn] = info.stamp_extrainfo
provides = [info.pn]

View File

@ -105,6 +105,11 @@ class RunQueueScheduler(object):
if self.rq.runq_running[taskid] == 1:
continue
if self.rq.runq_buildable[taskid] == 1:
fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[taskid]]
taskname = self.rqdata.runq_task[taskid]
stamp = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
if stamp in self.rq.build_stamps.values():
continue
return taskid
def next(self):
@ -1010,6 +1015,7 @@ class RunQueueExecute:
self.runq_complete = []
self.build_pids = {}
self.build_pipes = {}
self.build_stamps = {}
self.failed_fnids = []
def runqueue_process_waitpid(self):
@ -1024,6 +1030,7 @@ class RunQueueExecute:
del self.build_pids[result[0]]
self.build_pipes[result[0]].close()
del self.build_pipes[result[0]]
del self.build_stamps[result[0]]
if result[1] != 0:
self.task_fail(task, result[1]>>8)
else:
@ -1312,6 +1319,7 @@ class RunQueueExecuteTasks(RunQueueExecute):
self.build_pids[pid] = task
self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData)
self.build_stamps[pid] = bb.build.stampfile(taskname, self.rqdata.dataCache, fn)
self.runq_running[task] = 1
self.stats.taskActive()
if self.stats.active < self.number_tasks:

View File

@ -37,8 +37,16 @@ ${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}"
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
do_fetch[stamp-base] = "${TMPDIR}/stamps/work-shared/gcc-${PV}"
do_unpack[stamp-base] = "${TMPDIR}/stamps/work-shared/gcc-${PV}"
do_patch[stamp-base] = "${TMPDIR}/stamps/work-shared/gcc-${PV}"
WORKDIR_task-unpack = "${TMPDIR}/work-shared/"
WORKDIR_task-patch = "${TMPDIR}/work-shared/"
target_includedir ?= "${includedir}"
target_libdir ?= "${libdir}"