All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.