diff options
| -rw-r--r-- | meta/classes/icecc.bbclass | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass index e1c06c49cb..a837894150 100644 --- a/meta/classes/icecc.bbclass +++ b/meta/classes/icecc.bbclass | |||
| @@ -47,7 +47,8 @@ def get_cross_kernel_cc(bb,d): | |||
| 47 | 47 | ||
| 48 | # evaluate the expression by the shell if necessary | 48 | # evaluate the expression by the shell if necessary |
| 49 | if '`' in kernel_cc or '$(' in kernel_cc: | 49 | if '`' in kernel_cc or '$(' in kernel_cc: |
| 50 | kernel_cc = os.popen("echo %s" % kernel_cc).read()[:-1] | 50 | import subprocess |
| 51 | kernel_cc = subprocess.check_output("echo %s" % kernel_cc, shell=True).decode("utf-8")[:-1] | ||
| 51 | 52 | ||
| 52 | kernel_cc = d.expand(kernel_cc) | 53 | kernel_cc = d.expand(kernel_cc) |
| 53 | kernel_cc = kernel_cc.replace('ccache', '').strip() | 54 | kernel_cc = kernel_cc.replace('ccache', '').strip() |
| @@ -220,9 +221,14 @@ def icecc_get_and_check_tool(bb, d, tool): | |||
| 220 | # PATH or icecc-create-env script will silently create an invalid | 221 | # PATH or icecc-create-env script will silently create an invalid |
| 221 | # compiler environment package. | 222 | # compiler environment package. |
| 222 | t = icecc_get_tool(bb, d, tool) | 223 | t = icecc_get_tool(bb, d, tool) |
| 223 | if t and os.popen("readlink -f %s" % t).read()[:-1] == get_icecc(d): | 224 | if t: |
| 224 | bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d))) | 225 | import subprocess |
| 225 | return "" | 226 | link_path = subprocess.check_output("readlink -f %s" % t, shell=True).decode("utf-8")[:-1] |
| 227 | if link_path == get_icecc(d): | ||
| 228 | bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d))) | ||
| 229 | return "" | ||
| 230 | else: | ||
| 231 | return t | ||
| 226 | else: | 232 | else: |
| 227 | return t | 233 | return t |
| 228 | 234 | ||
