Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv2 0/3] fix icecc support
@ 2016-03-22 23:52 Alex Franco
  2016-03-22 23:52 ` [PATCHv2 1/3] icecc.bbclass: add icc_is_allarch inherit check Alex Franco
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alex Franco @ 2016-03-22 23:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: joshua.g.lock, aschultz, benjamin.esquivel

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)

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(-)

-- 
2.7.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCHv2 1/3] icecc.bbclass: add icc_is_allarch inherit check
  2016-03-22 23:52 [PATCHv2 0/3] fix icecc support Alex Franco
@ 2016-03-22 23:52 ` Alex Franco
  2016-03-22 23:52 ` [PATCHv2 2/3] icecc.bbclass: expand package arch Alex Franco
  2016-03-22 23:52 ` [PATCHv2 3/3] icecc.bbclass: replace icc with icecc Alex Franco
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Franco @ 2016-03-22 23:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: joshua.g.lock, aschultz, benjamin.esquivel

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]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
 meta/classes/icecc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 61b8bb1..75d0e5d 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -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 \
-- 
2.7.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCHv2 2/3] icecc.bbclass: expand package arch
  2016-03-22 23:52 [PATCHv2 0/3] fix icecc support Alex Franco
  2016-03-22 23:52 ` [PATCHv2 1/3] icecc.bbclass: add icc_is_allarch inherit check Alex Franco
@ 2016-03-22 23:52 ` Alex Franco
  2016-03-23 11:53   ` Burton, Ross
  2016-03-22 23:52 ` [PATCHv2 3/3] icecc.bbclass: replace icc with icecc Alex Franco
  2 siblings, 1 reply; 5+ messages in thread
From: Alex Franco @ 2016-03-22 23:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: joshua.g.lock, aschultz, benjamin.esquivel

If PACKAGE_ARCH contains variables (with ${) then expand it
this might be necessary if the value of PACKAGE_ARCH, which
is checked against in this test, should for any reason not
contain a value, but one or more variables

[YOCTO #8934]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
 meta/classes/icecc.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 75d0e5d..6632f5b 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -138,7 +138,10 @@ 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)
+    package_arch = d.getVar("PACKAGE_ARCH", False)
+    if '${' in package_arch:
+        package_arch = d.expand(package_arch)
+    return package_arch == "all" or bb.data.inherits_class('allarch', d)
 
 def icc_is_kernel(bb, d):
     return \
-- 
2.7.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCHv2 3/3] icecc.bbclass: replace icc with icecc
  2016-03-22 23:52 [PATCHv2 0/3] fix icecc support Alex Franco
  2016-03-22 23:52 ` [PATCHv2 1/3] icecc.bbclass: add icc_is_allarch inherit check Alex Franco
  2016-03-22 23:52 ` [PATCHv2 2/3] icecc.bbclass: expand package arch Alex Franco
@ 2016-03-22 23:52 ` Alex Franco
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Franco @ 2016-03-22 23:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: joshua.g.lock, aschultz, benjamin.esquivel

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]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
 meta/classes/icecc.bbclass | 56 +++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 6632f5b..78bc117 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -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,32 +137,32 @@ def use_icc(bb,d):
 
     return "yes"
 
-def icc_is_allarch(bb, d):
+def icecc_is_allarch(bb, d):
     package_arch = d.getVar("PACKAGE_ARCH", False)
     if '${' in package_arch:
         package_arch = d.expand(package_arch)
     return package_arch == "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")
@@ -172,7 +172,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
@@ -181,29 +181,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}')
@@ -212,17 +212,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 ""
@@ -249,27 +249,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
-- 
2.7.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 2/3] icecc.bbclass: expand package arch
  2016-03-22 23:52 ` [PATCHv2 2/3] icecc.bbclass: expand package arch Alex Franco
@ 2016-03-23 11:53   ` Burton, Ross
  0 siblings, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2016-03-23 11:53 UTC (permalink / raw)
  To: Alex Franco; +Cc: Joshua G Lock, Benjamin Esquivel, Andreas Schultz, OE-core

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

On 22 March 2016 at 23:52, Alex Franco <alejandro.franco@linux.intel.com>
wrote:

> +    package_arch = d.getVar("PACKAGE_ARCH", False)
> +    if '${' in package_arch:
> +        package_arch = d.expand(package_arch)
>

Just pass True to getVar().

Ross

[-- Attachment #2: Type: text/html, Size: 709 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-23 11:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 23:52 [PATCHv2 0/3] fix icecc support Alex Franco
2016-03-22 23:52 ` [PATCHv2 1/3] icecc.bbclass: add icc_is_allarch inherit check Alex Franco
2016-03-22 23:52 ` [PATCHv2 2/3] icecc.bbclass: expand package arch Alex Franco
2016-03-23 11:53   ` Burton, Ross
2016-03-22 23:52 ` [PATCHv2 3/3] icecc.bbclass: replace icc with icecc Alex Franco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox