Same issue here with Travis CI and Ubuntu 18.04.
strace -f -E LD_DEBUG=all build-wrapper-linux-x86-64 --out-dir bw-output make
[pid 6310] getpid() = 6310
[pid 6310] writev(2, [{iov_base=" 6310:\t", iov_len=12}, {iov_base="\n", iov_len=1}, {iov_base=" 6310:\t", iov_len=12}, {iov_base="file=", iov_len=5}, {iov_base="/home/travis/.sonar/cache/87f753"..., iov_len=112}, {iov_base=" [", iov_len=2}, {iov_base="0", iov_len=1}, {iov_base="]; needed by ", iov_len=14}, {iov_base="build-wrapper-linux-x86-64", iov_len=26}, {iov_base=" [", iov_len=2}, {iov_base="0", iov_len=1}, {iov_base="]\n", iov_len=2}], 12 6310: 6310: file=/home/travis/.sonar/cache/87f7532f0609a32b83c77be7ae487f14/build-wrapper-linux-x86/libinterceptor-${PLATFORM}.so [0]; needed by build-wrapper-linux-x86-64 [0]) = 190
[pid 6310] readlink("/proc/self/exe", "/home/travis/.sonar/cache/87f753"..., 4096) = 109
[pid 6310] openat(AT_FDCWD, "/home/travis/.sonar/cache/87f7532f0609a32b83c77be7ae487f14/build-wrapper-linux-x86/libinterceptor-haswell.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 6310] writev(2, [{iov_base="ERROR: ld.so: object '", iov_len=22}, {iov_base="/home/travis/.sonar/cache/87f753"..., iov_len=112}, {iov_base="' from ", iov_len=7}, {iov_base="LD_PRELOAD", iov_len=10}, {iov_base=" cannot be preloaded (", iov_len=22}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base="): ignored.\n", iov_len=12}], 7ERROR: ld.so: object '/home/travis/.sonar/cache/87f7532f0609a32b83c77be7ae487f14/build-wrapper-linux-x86/libinterceptor-${PLATFORM}.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.) = 215
[pid 6310] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
Fixed with hackround in .travis.yml
script:
- INTERCEPTOR_LIB=`find ${TRAVIS_HOME} -name libinterceptor-x86_64.so`
- INTERCEPTOR_LINK=`sed "s/x86_64/haswell/g"<<<"$INTERCEPTOR_LIB"`
- ln -s $INTERCEPTOR_LIB $INTERCEPTOR_LINK