Bug 12810 - openssl do_compile failed when ccache enabled
Summary: openssl do_compile failed when ccache enabled
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.7
Assignee: Mingli Yu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-06-22 09:52 UTC by Mingli Yu
Modified: 2018-09-26 10:56 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mingli Yu 2018-06-22 09:52:56 UTC
Steps to reproduce:
1, mkdir -p /home/prj/yocto && cd /home/prj/yocto
2, git clone git://git.yoctoproject.org/poky
3, . oe-init-build-env build
4, mkdir -p /home/prj/yocto/SSTATE_1018_US && mkdir -p /home/prj/yocto/CACHE_1018_US
5, update MACHINE ??= "qemux86" to MACHINE ??= "qemux86-64" in conf/local.conf
6, add below lines in to local.conf
SSTATE_DIR = "/home/prj/yocto/SSTATE_1018_US"
INHERIT += "ccache"
CCACHE_DIR = "/home/prj/yocto/CACHE_1018_US"
7, bitbake openssl

ERROR: openssl-1.0.2o-r0 do_compile: oe_runmake failed
ERROR: openssl-1.0.2o-r0 do_compile: Function failed: do_compile (log file is located at /home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/temp/log.do_compile.39540)
ERROR: Logfile of failure stored in: /home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/temp/log.do_compile.39540
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 128 depend
| making depend in crypto...
| make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
| make[1]: Entering directory '/home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/openssl-1.0.2o/crypto'
| ccache: invalid option -- 'D'
| Usage:
|     ccache [options]
|     ccache compiler [compiler options]
|     compiler [compiler options]          (via symbolic link)
| 
| Options:
|     -c, --cleanup         delete old files and recalculate size counters
|                           (normally not needed as this is done automatically)
|     -C, --clear           clear the cache completely (except configuration)
|     -F, --max-files=N     set maximum number of files in cache to N (use 0 for
|                           no limit)
|     -M, --max-size=SIZE   set maximum size of cache to SIZE (use 0 for no
|                           limit); available suffixes: k, M, G, T (decimal) and
|                           Ki, Mi, Gi, Ti (binary); default suffix: G
|     -o, --set-config=K=V  set configuration key K to value V
|     -p, --print-config    print current configuration options
|     -s, --show-stats      show statistics summary
|     -z, --zero-stats      zero statistics counters
| 
|     -h, --help            print this help text
|     -V, --version         print version and copyright information
| 
| See also <https://ccache.samba.org>.
| mv: cannot stat 'Makefile.new': No such file or directory
| Makefile:136: recipe for target 'local_depend' failed
| make[1]: *** [local_depend] Error 1
| make[1]: Leaving directory '/home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/openssl-1.0.2o/crypto'
| Makefile:492: recipe for target 'depend' failed
| make: *** [depend] Error 1
| ERROR: oe_runmake failed
| WARNING: /home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/temp/run.do_compile.39540:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/prj/yocto/build/tmp/work/core2-64-poky-linux/openssl/1.0.2o-r0/temp/log.do_compile.39540)
ERROR: Task (/home/prj/yocto/poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 784 tasks of which 768 didn't need to be rerun and 1 failed.
Comment 1 Ross Burton 2018-06-28 14:44:05 UTC
I've just sent a patch to disable ccache in openssl, which is a workaround instead of a fix but might be the best we can do.
Comment 2 Randy MacLeod 2018-07-27 17:32:33 UTC
Mingli please work on this as a medium priority bug, even after the 2.6 release would be okay with me since it's a build optimization that few people use.

Note that openssl-1.1 also has problems with ccache in some cases and has disabled it or clang-3.6:

$ cd .../openssl/openssl.git 
$ git log -1 --stat 4b8574461b92ea64ef048335f942995a09025331
commit 4b8574461b92ea64ef048335f942995a09025331
Author: Emilia Kasper <emilia@openssl.org>
Date:   Sat Mar 12 17:18:25 2016 +0100

    Workaround for false -Warray-bounds in Travis
    
    ccache + clang produces a false strcmp warning, see
    https://llvm.org/bugs/show_bug.cgi?id=20144
    
    Since this only happens with ccache and --strict-warnings, and
    only with certain versions of glibc / clang, disabling
    ccache is a reasonable short-term workaround.
    
    Reviewed-by: Richard Levitte <levitte@openssl.org>

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rmacleod@fidler openssl/openssl.git $ git tag --contains 4b8574461b92ea64ef048335f942995a09025331 | head -1
OpenSSL_1_1_0
Comment 3 Robert Yang 2018-08-01 06:52:08 UTC
Hi Randy,

Since Ross has workarounded the issue, it doesn't break anything now, and seldom ones use ccache, so I think that we can hold on the bug until upstream fixes it.
Comment 4 Ross Burton 2018-09-26 10:56:02 UTC
Merged in oe-core 8f9ceebb197dba10f2d08449de2dd64584de06bb