summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/icecc.bbclass27
1 files changed, 13 insertions, 14 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 94ed4da8c2..cab64f5270 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -61,7 +61,7 @@ def icecc_dep_prepend(d):
61 # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not 61 # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
62 # we need that built is the responsibility of the patch function / class, not 62 # we need that built is the responsibility of the patch function / class, not
63 # the application. 63 # the application.
64 if not d.getVar('INHIBIT_DEFAULT_DEPS', False): 64 if not d.getVar('INHIBIT_DEFAULT_DEPS'):
65 return "icecc-create-env-native" 65 return "icecc-create-env-native"
66 return "" 66 return ""
67 67
@@ -69,21 +69,20 @@ DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
69 69
70get_cross_kernel_cc[vardepsexclude] += "KERNEL_CC" 70get_cross_kernel_cc[vardepsexclude] += "KERNEL_CC"
71def get_cross_kernel_cc(bb,d): 71def get_cross_kernel_cc(bb,d):
72 kernel_cc = d.getVar('KERNEL_CC', False) 72 kernel_cc = d.getVar('KERNEL_CC')
73 73
74 # evaluate the expression by the shell if necessary 74 # evaluate the expression by the shell if necessary
75 if '`' in kernel_cc or '$(' in kernel_cc: 75 if '`' in kernel_cc or '$(' in kernel_cc:
76 import subprocess 76 import subprocess
77 kernel_cc = subprocess.check_output("echo %s" % kernel_cc, shell=True).decode("utf-8")[:-1] 77 kernel_cc = subprocess.check_output("echo %s" % kernel_cc, shell=True).decode("utf-8")[:-1]
78 78
79 kernel_cc = d.expand(kernel_cc)
80 kernel_cc = kernel_cc.replace('ccache', '').strip() 79 kernel_cc = kernel_cc.replace('ccache', '').strip()
81 kernel_cc = kernel_cc.split(' ')[0] 80 kernel_cc = kernel_cc.split(' ')[0]
82 kernel_cc = kernel_cc.strip() 81 kernel_cc = kernel_cc.strip()
83 return kernel_cc 82 return kernel_cc
84 83
85def get_icecc(d): 84def get_icecc(d):
86 return d.getVar('ICECC_PATH', False) or bb.utils.which(os.getenv("PATH"), "icecc") 85 return d.getVar('ICECC_PATH') or bb.utils.which(os.getenv("PATH"), "icecc")
87 86
88def create_path(compilers, bb, d): 87def create_path(compilers, bb, d):
89 """ 88 """
@@ -118,7 +117,7 @@ def create_path(compilers, bb, d):
118 return staging 117 return staging
119 118
120def use_icecc(bb,d): 119def use_icecc(bb,d):
121 if d.getVar('ICECC_DISABLED', False) == "1": 120 if d.getVar('ICECC_DISABLED') == "1":
122 # don't even try it, when explicitly disabled 121 # don't even try it, when explicitly disabled
123 return "no" 122 return "no"
124 123
@@ -132,7 +131,7 @@ def use_icecc(bb,d):
132 pn = d.getVar('PN') 131 pn = d.getVar('PN')
133 132
134 system_class_blacklist = [] 133 system_class_blacklist = []
135 user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL', False) or "none").split() 134 user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL') or "none").split()
136 package_class_blacklist = system_class_blacklist + user_class_blacklist 135 package_class_blacklist = system_class_blacklist + user_class_blacklist
137 136
138 for black in package_class_blacklist: 137 for black in package_class_blacklist:
@@ -149,8 +148,8 @@ def use_icecc(bb,d):
149 # e.g. when there is new version 148 # e.g. when there is new version
150 # building libgcc-initial with icecc fails with CPP sanity check error if host sysroot contains cross gcc built for another target tune/variant 149 # building libgcc-initial with icecc fails with CPP sanity check error if host sysroot contains cross gcc built for another target tune/variant
151 system_package_blacklist = ["libgcc-initial"] 150 system_package_blacklist = ["libgcc-initial"]
152 user_package_blacklist = (d.getVar('ICECC_USER_PACKAGE_BL', False) or "").split() 151 user_package_blacklist = (d.getVar('ICECC_USER_PACKAGE_BL') or "").split()
153 user_package_whitelist = (d.getVar('ICECC_USER_PACKAGE_WL', False) or "").split() 152 user_package_whitelist = (d.getVar('ICECC_USER_PACKAGE_WL') or "").split()
154 package_blacklist = system_package_blacklist + user_package_blacklist 153 package_blacklist = system_package_blacklist + user_package_blacklist
155 154
156 if pn in package_blacklist: 155 if pn in package_blacklist:
@@ -161,7 +160,7 @@ def use_icecc(bb,d):
161 bb.debug(1, "%s: found in whitelist, enable icecc" % pn) 160 bb.debug(1, "%s: found in whitelist, enable icecc" % pn)
162 return "yes" 161 return "yes"
163 162
164 if d.getVar('PARALLEL_MAKE', False) == "": 163 if d.getVar('PARALLEL_MAKE') == "":
165 bb.debug(1, "%s: has empty PARALLEL_MAKE, disable icecc" % pn) 164 bb.debug(1, "%s: has empty PARALLEL_MAKE, disable icecc" % pn)
166 return "no" 165 return "no"
167 166
@@ -191,13 +190,13 @@ def icecc_version(bb, d):
191 if use_icecc(bb, d) == "no": 190 if use_icecc(bb, d) == "no":
192 return "" 191 return ""
193 192
194 parallel = d.getVar('ICECC_PARALLEL_MAKE', False) or "" 193 parallel = d.getVar('ICECC_PARALLEL_MAKE') or ""
195 if not d.getVar('PARALLEL_MAKE', False) == "" and parallel: 194 if not d.getVar('PARALLEL_MAKE') == "" and parallel:
196 d.setVar("PARALLEL_MAKE", parallel) 195 d.setVar("PARALLEL_MAKE", parallel)
197 196
198 # Disable showing the caret in the GCC compiler output if the workaround is 197 # Disable showing the caret in the GCC compiler output if the workaround is
199 # disabled 198 # disabled
200 if d.getVar('ICECC_CARET_WORKAROUND', True) == '0': 199 if d.getVar('ICECC_CARET_WORKAROUND') == '0':
201 d.setVar('ICECC_CFLAGS', '-fno-diagnostics-show-caret') 200 d.setVar('ICECC_CFLAGS', '-fno-diagnostics-show-caret')
202 201
203 if icecc_is_native(bb, d): 202 if icecc_is_native(bb, d):
@@ -208,7 +207,7 @@ def icecc_version(bb, d):
208 prefix = d.expand('${HOST_PREFIX}' ) 207 prefix = d.expand('${HOST_PREFIX}' )
209 distro = d.expand('${DISTRO}') 208 distro = d.expand('${DISTRO}')
210 target_sys = d.expand('${TARGET_SYS}') 209 target_sys = d.expand('${TARGET_SYS}')
211 float = d.getVar('TARGET_FPU', False) or "hard" 210 float = d.getVar('TARGET_FPU') or "hard"
212 archive_name = prefix + distro + "-" + target_sys + "-" + float 211 archive_name = prefix + distro + "-" + target_sys + "-" + float
213 if icecc_is_kernel(bb, d): 212 if icecc_is_kernel(bb, d):
214 archive_name += "-kernel" 213 archive_name += "-kernel"
@@ -217,7 +216,7 @@ def icecc_version(bb, d):
217 ice_dir = icecc_dir(bb, d) 216 ice_dir = icecc_dir(bb, d)
218 tar_file = os.path.join(ice_dir, "{archive}-{version}-@VERSION@-{hostname}.tar.gz".format( 217 tar_file = os.path.join(ice_dir, "{archive}-{version}-@VERSION@-{hostname}.tar.gz".format(
219 archive=archive_name, 218 archive=archive_name,
220 version=d.getVar('ICECC_ENV_VERSION', True), 219 version=d.getVar('ICECC_ENV_VERSION'),
221 hostname=socket.gethostname() 220 hostname=socket.gethostname()
222 )) 221 ))
223 222