* [PATCH] icecc: base fix for cross and native builds
@ 2009-02-12 14:27 Roman I Khimov
2009-02-12 15:24 ` Koen Kooi
2009-02-12 15:28 ` Leon Woestenberg
0 siblings, 2 replies; 10+ messages in thread
From: Roman I Khimov @ 2009-02-12 14:27 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 4062 bytes --]
Hello all.
There are severe problems with icecc builds currently in OE. Cross-compiler
tarball created wrong, PATH set incorrectly, etc.
So, here is a patch that fixes some basic things, like:
1) ICECC_ENV_EXEC variable expansion. Currently you can only use absolute
path here, something like "${TOP}/create-icecc-env.sh" won't work.
2) PATH is set wrong for cross-compiler, the problem is that ${ICECC_PATH}
is expanded at script-producing stage, so as a result you have
export PATH=/usr/bin/icecc$PATH
in script, which is just plain wrong.
3) Cross-compiler tarball created is not working, at least with 4.3.3 GCC
version when 'create-icecc-env.sh' script tries to find cc1 and cc1plus
it gets nothing meaningful, like:
$ ./tmp/cross/i686/i686-linux/bin/gcc -print-prog-name=cc1
cc1
$ ./tmp/cross/i686/i686-linux/bin/gcc -print-prog-name=cc1plus
cc1plus
Compare that to
$ ./tmp/cross/i686/bin/i686-linux-gcc -print-prog-name=cc1
/path-to-oe-top/tmp/cross/i686/libexec/gcc/i686-linux/4.3.3/cc1
$ ./tmp/cross/i686/bin/i686-linux-gcc -print-prog-name=cc1plus
/path-to-oe-top/tmp/cross/i686/libexec/gcc/i686-linux/4.3.3/cc1plus
This patch fixes this problems and one can use icecc with it, albeit there are
some problems left, 'icecc-create-env' is not working as create-icecc-env.sh
provider and there is a problem with parallel task execution (as in
BB_NUMBER_THREADS) if several tasks get ready to run, try to find icecc
tarball, not find that, and then every task tries to create the tarball which
leads to all sorts of corruption in resulting tarball.
--- a/classes/icecc.bbclass 2009-01-23 15:05:33.116226578 +0300
+++ b/classes/icecc.bbclass 2009-02-10 15:17:02.891420616 +0300
@@ -83,13 +83,15 @@ def create_cross_env(bb,d):
#check if user has specified a specific icecc-create-env script
#if not use the OE provided one
- cr_env_script = bb.data.getVar('ICECC_ENV_EXEC', d) or bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env"
+ cr_env_script = bb.data.expand('${ICECC_ENV_EXEC}', d)
+ if cr_env_script == "${ICECC_ENV_EXEC}":
+ cr_env_script = bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env"
#call the modified create-env script
result=os.popen("%s %s %s %s %s %s" %(cr_env_script,
"--silent",
- os.path.join(ice_dir,target_sys,'bin','gcc'),
- os.path.join(ice_dir,target_sys,'bin','g++'),
- os.path.join(ice_dir,target_sys,'bin','as'),
+ os.path.join(ice_dir, 'bin', "%s-gcc" % target_sys),
+ os.path.join(ice_dir, 'bin', "%s-g++" % target_sys),
+ os.path.join(ice_dir, 'bin', "%s-as" % target_sys),
os.path.join(ice_dir,"ice",cross_name) ) )
return tar_file
@@ -121,7 +123,9 @@ def create_native_env(bb,d):
#check if user has specified a specific icecc-create-env script
#if not use the OE provided one
- cr_env_script = bb.data.getVar('ICECC_ENV_EXEC', d) or bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env"
+ cr_env_script = bb.data.expand('${ICECC_ENV_EXEC}', d)
+ if cr_env_script == "${ICECC_ENV_EXEC}":
+ cr_env_script = bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env"
result=os.popen("%s %s %s %s %s %s" %(cr_env_script,
"--silent",
os.popen("%s gcc" % "which").read()[:-1],
@@ -290,9 +294,9 @@ def check_for_kernel(bb,d):
set_icecc_env() {
- ICECC_PATH=${@icc_path(bb,d)}
- if test x${ICECC_PATH} != x; then
- export PATH=${ICECC_PATH}$PATH
+ ICE_PATH=${@icc_path(bb,d)}
+ if test x${ICE_PATH} != x; then
+ export PATH=${ICE_PATH}$PATH
export CCACHE_PATH=$PATH
#check if we are building a kernel and select gcc-cross-kernel
if [ "${@check_for_kernel(bb,d)}" = "yes" ]; then
--
Roman
http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 204 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-12 14:27 [PATCH] icecc: base fix for cross and native builds Roman I Khimov
@ 2009-02-12 15:24 ` Koen Kooi
2009-02-12 16:00 ` Roman I Khimov
2009-02-12 15:28 ` Leon Woestenberg
1 sibling, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2009-02-12 15:24 UTC (permalink / raw)
To: openembedded-devel
On 12-02-09 15:27, Roman I Khimov wrote:
> Hello all.
>
> There are severe problems with icecc builds currently in OE. Cross-compiler
> tarball created wrong, PATH set incorrectly, etc.
>
> So, here is a patch that fixes some basic things, like:
> 1) ICECC_ENV_EXEC variable expansion. Currently you can only use absolute
> path here, something like "${TOP}/create-icecc-env.sh" won't work.
${TOP} is dangerous to use, IIRC openssl uses it in its buildsystem, so
people that have TOP set (hi Raster & Steve) see all kind of weird failures.
regards,
Koen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-12 14:27 [PATCH] icecc: base fix for cross and native builds Roman I Khimov
2009-02-12 15:24 ` Koen Kooi
@ 2009-02-12 15:28 ` Leon Woestenberg
2009-02-12 16:36 ` Koen Kooi
1 sibling, 1 reply; 10+ messages in thread
From: Leon Woestenberg @ 2009-02-12 15:28 UTC (permalink / raw)
To: openembedded-devel
Hello,
On Thu, Feb 12, 2009 at 3:27 PM, Roman I Khimov <roman@khimov.ru> wrote:
> Hello all.
>
> There are severe problems with icecc builds currently in OE. Cross-compiler
> tarball created wrong, PATH set incorrectly, etc.
>
Excellent!
It's probably a little-used class, but if we get it to work more
robustly, we can make more noise about it.
I will try to do some tests here over the next few weeks with your
patch, time permitting.
Regards,
--
Leon
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-12 15:24 ` Koen Kooi
@ 2009-02-12 16:00 ` Roman I Khimov
0 siblings, 0 replies; 10+ messages in thread
From: Roman I Khimov @ 2009-02-12 16:00 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 902 bytes --]
Koen Kooi:
> On 12-02-09 15:27, Roman I Khimov wrote:
> > Hello all.
> >
> > There are severe problems with icecc builds currently in OE.
> > Cross-compiler tarball created wrong, PATH set incorrectly, etc.
> >
> > So, here is a patch that fixes some basic things, like:
> > 1) ICECC_ENV_EXEC variable expansion. Currently you can only use
> > absolute path here, something like "${TOP}/create-icecc-env.sh" won't
> > work.
>
> ${TOP} is dangerous to use, IIRC openssl uses it in its buildsystem, so
> people that have TOP set (hi Raster & Steve) see all kind of weird
> failures.
I'm not using "${TOP}" anywhere in production, it's just an example, still
it's the case that ${ANY_VARIABLE} in ICECC_ENV_EXEC will breake icecc.
--
Roman
http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 204 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-12 15:28 ` Leon Woestenberg
@ 2009-02-12 16:36 ` Koen Kooi
2009-02-13 6:52 ` Roman I Khimov
0 siblings, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2009-02-12 16:36 UTC (permalink / raw)
To: openembedded-devel
On 12-02-09 16:28, Leon Woestenberg wrote:
> Hello,
>
> On Thu, Feb 12, 2009 at 3:27 PM, Roman I Khimov<roman@khimov.ru> wrote:
>> Hello all.
>>
>> There are severe problems with icecc builds currently in OE. Cross-compiler
>> tarball created wrong, PATH set incorrectly, etc.
>>
> Excellent!
>
> It's probably a little-used class, but if we get it to work more
> robustly, we can make more noise about it.
>
> I will try to do some tests here over the next few weeks with your
> patch, time permitting.
Once icecc works we should have a chat with the suse buildservice
people. PARALLEL_MAKE = "-j256", here we come :)
regards,
Koen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-12 16:36 ` Koen Kooi
@ 2009-02-13 6:52 ` Roman I Khimov
2009-02-13 9:05 ` Koen Kooi
2009-02-13 14:33 ` Roman I Khimov
0 siblings, 2 replies; 10+ messages in thread
From: Roman I Khimov @ 2009-02-13 6:52 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
Koen Kooi:
> On 12-02-09 16:28, Leon Woestenberg wrote:
> > On Thu, Feb 12, 2009 at 3:27 PM, Roman I Khimov<roman@khimov.ru> wrote:
> >> There are severe problems with icecc builds currently in OE.
> >> Cross-compiler tarball created wrong, PATH set incorrectly, etc.
> >
> > Excellent!
> >
> > It's probably a little-used class, but if we get it to work more
> > robustly, we can make more noise about it.
> >
> > I will try to do some tests here over the next few weeks with your
> > patch, time permitting.
>
> Once icecc works we should have a chat with the suse buildservice
> people. PARALLEL_MAKE = "-j256", here we come :)
I'm running it with "-j14" there and combined with bitbake parallel task
execution it just rocks, the only slowdowns are blacklisted packages like
gcc and glibc.
So, if anyone cares enough to commit? ;)
The most severe problem left after this patch is parallel tarball creation,
which I'm not sure how to fix better. An obvious solution is some kind of
file lock but from what I see, the best way to do it is via pathutils
module which is not standard.
Another approach could be just reducing the race window, fixing
create-icecc-env.sh to write to temporary file and then move it to its
place. Maybe that would be enough.
Another approach could be some kind of IPC locks between running threads,
but I don't know enough on how bitbake runs its parallel tasks and whether
it's possible or not.
Another approach could be moving tarball creation to packages and then use
standard dependency features of bitbake, making native things depend on
native tarball and cross on cross. Not sure how to do it in details.
--
Roman
http://roman.khimov.ru
mailto: roman@khimov.ru
gpg --keyserver hkp://subkeys.pgp.net --recv-keys 0xE5E055C3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 204 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-13 6:52 ` Roman I Khimov
@ 2009-02-13 9:05 ` Koen Kooi
2009-02-13 23:38 ` Leon Woestenberg
2009-02-13 14:33 ` Roman I Khimov
1 sibling, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2009-02-13 9:05 UTC (permalink / raw)
To: openembedded-devel
On 13-02-09 07:52, Roman I Khimov wrote:
> Koen Kooi:
>> On 12-02-09 16:28, Leon Woestenberg wrote:
>>> On Thu, Feb 12, 2009 at 3:27 PM, Roman I Khimov<roman@khimov.ru> wrote:
>>>> There are severe problems with icecc builds currently in OE.
>>>> Cross-compiler tarball created wrong, PATH set incorrectly, etc.
>>> Excellent!
>>>
>>> It's probably a little-used class, but if we get it to work more
>>> robustly, we can make more noise about it.
>>>
>>> I will try to do some tests here over the next few weeks with your
>>> patch, time permitting.
>> Once icecc works we should have a chat with the suse buildservice
>> people. PARALLEL_MAKE = "-j256", here we come :)
>
> I'm running it with "-j14" there and combined with bitbake parallel task
> execution it just rocks, the only slowdowns are blacklisted packages like
> gcc and glibc.
>
> So, if anyone cares enough to commit? ;)
AIUI Leon wants to give it a spin first, but you have my +1.
regards,
Koen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-13 6:52 ` Roman I Khimov
2009-02-13 9:05 ` Koen Kooi
@ 2009-02-13 14:33 ` Roman I Khimov
1 sibling, 0 replies; 10+ messages in thread
From: Roman I Khimov @ 2009-02-13 14:33 UTC (permalink / raw)
To: openembedded-devel
Roman I Khimov:
> Another approach could be just reducing the race window, fixing
> create-icecc-env.sh to write to temporary file and then move it to its
> place. Maybe that would be enough.
BTW, this kind of kludge seems to be working, at least for two runs on
dual-core and quad-core machines.
--- a/create-icecc-env.sh
+++ b/create-icecc-env.sh
@@ -181,12 +181,14 @@ else
fi
fi
+TEMPFILE=`tempfile`
cd $tempdir
-tar -czhf "$mydir/$archive_name".tar.gz $target_files || {
+tar -czhf $TEMPFILE $target_files || {
if test -z "$silent"; then
echo "Couldn't create archive"
fi
exit 3
}
cd ..
+mv $TEMPFILE "$mydir/$archive_name".tar.gz
rm -rf $tempdir
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-13 9:05 ` Koen Kooi
@ 2009-02-13 23:38 ` Leon Woestenberg
2009-02-14 9:40 ` Leon Woestenberg
0 siblings, 1 reply; 10+ messages in thread
From: Leon Woestenberg @ 2009-02-13 23:38 UTC (permalink / raw)
To: openembedded-devel; +Cc: openembedded-devel
Hello,
On Fri, Feb 13, 2009 at 10:05 AM, Koen Kooi <k.kooi@student.utwente.nl> wrote:
> On 13-02-09 07:52, Roman I Khimov wrote:
>> So, if anyone cares enough to commit? ;)
>
> AIUI Leon wants to give it a spin first, but you have my +1.
>
Hmm, if it is broken currently, and now fixed and tested by you, +1
for committing it right away.
I can do this tomorrow - but beware...
I'm not getting around to fulfill my own wannado's, didn't get around
to test icecc today.
Well, I just finished installing 'bob' the build server, might as well
deploy icecc on it.
Regards,
--
Leon
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] icecc: base fix for cross and native builds
2009-02-13 23:38 ` Leon Woestenberg
@ 2009-02-14 9:40 ` Leon Woestenberg
0 siblings, 0 replies; 10+ messages in thread
From: Leon Woestenberg @ 2009-02-14 9:40 UTC (permalink / raw)
To: openembedded-devel; +Cc: openembedded-devel
Applied.
--
Leon
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-02-14 9:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12 14:27 [PATCH] icecc: base fix for cross and native builds Roman I Khimov
2009-02-12 15:24 ` Koen Kooi
2009-02-12 16:00 ` Roman I Khimov
2009-02-12 15:28 ` Leon Woestenberg
2009-02-12 16:36 ` Koen Kooi
2009-02-13 6:52 ` Roman I Khimov
2009-02-13 9:05 ` Koen Kooi
2009-02-13 23:38 ` Leon Woestenberg
2009-02-14 9:40 ` Leon Woestenberg
2009-02-13 14:33 ` Roman I Khimov
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.