Skip to contentSkip to conversation

fix icecc support

PATCH New Alex Franco 1 participant 4 messages Mar 24, 2016

lore
Share & tools
lore
#0 lore raw

v3 cover fix icecc support

The commits related to this fix are provided in order of importance.

1/3 - the actual fix, it adds a check for the
inheritance of allarch in icecc.bbclass

2/3 - optional, makes it so that PACKAGE_ARCH is
expanded ib icc_is_allarch, as it may contain
unexpanded variables

3/3 - optional, replace icc with icecc to avoid
confusing the Icecream compiler (icecc) with the Intel C compiler (icc)

Changes since v2: use of getVar(VAR, True) for expansion Changes since v1: inheritance check instead of disabling

note: an additional related documentation patch is
being sent to the documentation mailing list

Alex Franco (4):
icecc.bbclass: add icc_is_allarch inherit check
icecc.bbclass: expand package arch
icecc.bbclass: replace icc with icecc

 documentation/ref-manual/ref-classes.xml |  2 +-
 meta/classes/icecc.bbclass               | 61 +++++++++++++++++---------------
 2 files changed, 33 insertions(+), 30 deletions(-)
Signature · 1 line
2.7.3
#1 lore raw

PATCH v3 1/3 icecc.bbclass: add icc_is_allarch inherit check

Additional check for inheritance of allarch.bbclass, for when checking that PACKAGE_ARCH == "all" is not enough to be sure a recipe is "allarch"; e.g. nativesdk-buildtools type recipes

[YOCTO #8934]

---
 meta/classes/icecc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/icecc.bbclass +1 -1
index 61b8bb1..75d0e5d 100644
@@ -138,7 +138,7 @@ def use_icc(bb,d):
     return "yes"
 
 def icc_is_allarch(bb, d):
-    return d.getVar("PACKAGE_ARCH", False) == "all"
+    return d.getVar("PACKAGE_ARCH", False) == "all" or bb.data.inherits_class('allarch', d)
 
 def icc_is_kernel(bb, d):
     return \
Signature · 1 line
2.7.3
#2 lore raw

PATCH v3 2/3 icecc.bbclass: expand package arch

In reply to Alex Franco

Expanding PACKAGE_ARCH might be necessary as it is being checked against to determine if this is allarch

[YOCTO #8934]

---
 meta/classes/icecc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/icecc.bbclass +1 -1
index 75d0e5d..b4f1be5 100644
@@ -138,7 +138,7 @@ def use_icc(bb,d):
     return "yes"
 
 def icc_is_allarch(bb, d):
-    return d.getVar("PACKAGE_ARCH", False) == "all" or bb.data.inherits_class('allarch', d)
+    return d.getVar("PACKAGE_ARCH", True) == "all" or bb.data.inherits_class('allarch', d)
 
 def icc_is_kernel(bb, d):
     return \
Signature · 1 line
2.7.3
#3 lore raw

PATCH v3 3/3 icecc.bbclass: replace icc with icecc

In reply to Alex Franco

Make this class more clear and consistent, and avoid confusion with the Intel C compiler (icc); the changes affect function names, and calls to those functions

[YOCTO #8934]

---
 meta/classes/icecc.bbclass | 56 +++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 28 deletions(-)
meta/classes/icecc.bbclass +28 -28
index b4f1be5..e1c06c4 100644
@@ -63,7 +63,7 @@ def create_path(compilers, bb, d):
     Create Symlinks for the icecc in the staging directory
     """
     staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
-    if icc_is_kernel(bb, d):
+    if icecc_is_kernel(bb, d):
         staging += "-kernel"
 
     #check if the icecc path is set by the user
@@ -90,13 +90,13 @@ def create_path(compilers, bb, d):
 
     return staging
 
-def use_icc(bb,d):
+def use_icecc(bb,d):
     if d.getVar('ICECC_DISABLED', False) == "1":
         # don't even try it, when explicitly disabled
         return "no"
 
     # allarch recipes don't use compiler
-    if icc_is_allarch(bb, d):
+    if icecc_is_allarch(bb, d):
         return "no"
 
     pn = d.getVar('PN', True)
@@ -137,29 +137,29 @@ def use_icc(bb,d):
 
     return "yes"
 
-def icc_is_allarch(bb, d):
+def icecc_is_allarch(bb, d):
     return d.getVar("PACKAGE_ARCH", True) == "all" or bb.data.inherits_class('allarch', d)
 
-def icc_is_kernel(bb, d):
+def icecc_is_kernel(bb, d):
     return \
         bb.data.inherits_class("kernel", d);
 
-def icc_is_native(bb, d):
+def icecc_is_native(bb, d):
     return \
         bb.data.inherits_class("cross", d) or \
         bb.data.inherits_class("native", d);
 
 # Don't pollute allarch signatures with TARGET_FPU
-icc_version[vardepsexclude] += "TARGET_FPU"
-def icc_version(bb, d):
-    if use_icc(bb, d) == "no":
+icecc_version[vardepsexclude] += "TARGET_FPU"
+def icecc_version(bb, d):
+    if use_icecc(bb, d) == "no":
         return ""
 
     parallel = d.getVar('ICECC_PARALLEL_MAKE', False) or ""
     if not d.getVar('PARALLEL_MAKE', False) == "" and parallel:
         d.setVar("PARALLEL_MAKE", parallel)
 
-    if icc_is_native(bb, d):
+    if icecc_is_native(bb, d):
         archive_name = "local-host-env"
     elif d.expand('${HOST_PREFIX}') == "":
         bb.fatal(d.expand("${PN}"), " NULL prefix")
@@ -169,7 +169,7 @@ def icc_version(bb, d):
         target_sys = d.expand('${TARGET_SYS}')
         float = d.getVar('TARGET_FPU', False) or "hard"
         archive_name = prefix + distro + "-"        + target_sys + "-" + float
-        if icc_is_kernel(bb, d):
+        if icecc_is_kernel(bb, d):
             archive_name += "-kernel"
 
     import socket
@@ -178,29 +178,29 @@ def icc_version(bb, d):
 
     return tar_file
 
-def icc_path(bb,d):
-    if use_icc(bb, d) == "no":
+def icecc_path(bb,d):
+    if use_icecc(bb, d) == "no":
         # don't create unnecessary directories when icecc is disabled
         return
 
-    if icc_is_kernel(bb, d):
+    if icecc_is_kernel(bb, d):
         return create_path( [get_cross_kernel_cc(bb,d), ], bb, d)
 
     else:
         prefix = d.expand('${HOST_PREFIX}')
         return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
 
-def icc_get_external_tool(bb, d, tool):
+def icecc_get_external_tool(bb, d, tool):
     external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
     target_prefix = d.expand('${TARGET_PREFIX}')
     return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
 
 # Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
-icc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
-def icc_get_tool(bb, d, tool):
-    if icc_is_native(bb, d):
+icecc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
+def icecc_get_tool(bb, d, tool):
+    if icecc_is_native(bb, d):
         return bb.utils.which(os.getenv("PATH"), tool)
-    elif icc_is_kernel(bb, d):
+    elif icecc_is_kernel(bb, d):
         return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d))
     else:
         ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
@@ -209,17 +209,17 @@ def icc_get_tool(bb, d, tool):
         if os.path.isfile(tool_bin):
             return tool_bin
         else:
-            external_tool_bin = icc_get_external_tool(bb, d, tool)
+            external_tool_bin = icecc_get_external_tool(bb, d, tool)
             if os.path.isfile(external_tool_bin):
                 return external_tool_bin
             else:
                 return ""
 
-def icc_get_and_check_tool(bb, d, tool):
+def icecc_get_and_check_tool(bb, d, tool):
     # Check that g++ or gcc is not a symbolic link to icecc binary in
     # PATH or icecc-create-env script will silently create an invalid
     # compiler environment package.
-    t = icc_get_tool(bb, d, tool)
+    t = icecc_get_tool(bb, d, tool)
     if t and os.popen("readlink -f %s" % t).read()[:-1] == get_icecc(d):
         bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d)))
         return ""
@@ -246,27 +246,27 @@ def set_icecc_env():
     return
 
 set_icecc_env() {
-    if [ "${@use_icc(bb, d)}" = "no" ]
+    if [ "${@use_icecc(bb, d)}" = "no" ]
     then
         return
     fi
-    ICECC_VERSION="${@icc_version(bb, d)}"
+    ICECC_VERSION="${@icecc_version(bb, d)}"
     if [ "x${ICECC_VERSION}" = "x" ]
     then
         bbwarn "Cannot use icecc: could not get ICECC_VERSION"
         return
     fi
 
-    ICE_PATH="${@icc_path(bb, d)}"
+    ICE_PATH="${@icecc_path(bb, d)}"
     if [ "x${ICE_PATH}" = "x" ]
     then
         bbwarn "Cannot use icecc: could not get ICE_PATH"
         return
     fi
 
-    ICECC_CC="${@icc_get_and_check_tool(bb, d, "gcc")}"
-    ICECC_CXX="${@icc_get_and_check_tool(bb, d, "g++")}"
-    # cannot use icc_get_and_check_tool here because it assumes as without target_sys prefix
+    ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
+    ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
+    # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix
     ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
     if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
     then
Signature · 1 line
2.7.3