mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

sccache fails to compile Qt: hash collision between precompiled headers and object files #1851

Closed jimis closed 1 month ago

jimis commented 1 year ago

Simplest way to reproduce the issue (EDIT as of 2024-10-04)

  $ touch empty.c
  $ gcc              -c -o out1 empty.c
  $ gcc  -x c-header -c -o out2 empty.c
  $ file out1 out2
  out1: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
  out2: GCC precompiled header (version 014) for C

The two files are different. But if we feed these compilations to sccache, they lead to the same result:

  $ sccache gcc              -c -o out3 empty.c
  $ sccache gcc  -x c-header -c -o out4 empty.c
  $ file out3 out4
  out3: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
  out4: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

Old Summary

$ sccache --version
sccache 0.5.4

The problem manifests as this error message during linking:

src/corelib/CMakeFiles/Core.dir/global/archdetect.cpp.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

The reason is that archdetect.cpp.o and a few other files, have been mis-compiled to contain precompiled headers instead of object code:

$ md5sum ./src/corelib/CMakeFiles/Core.dir/tools/qrefcount.cpp.o ./src/corelib/CMakeFiles/Core.dir/global/archdetect.cpp.o ./src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o ./src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch
7191dea52ae41f322943e6b088b539aa  ./src/corelib/CMakeFiles/Core.dir/tools/qrefcount.cpp.o
7191dea52ae41f322943e6b088b539aa  ./src/corelib/CMakeFiles/Core.dir/global/archdetect.cpp.o
7191dea52ae41f322943e6b088b539aa  ./src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o
7191dea52ae41f322943e6b088b539aa  ./src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch    # NOTE: this file is correct

Digging into the problem

Command lines generated by ninja on the client

cmake_pch.hxx.gch

[420/2442] sccache /usr/bin/g++ -DBACKTRACE_HEADER=\"execinfo.h\" -DCore_EXPORTS -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_AS_CONST -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include -I/home/qt/work/qt/qtbase_build/include -I/home/qt/work/qt/qtbase_build/include/QtCore -I/home/qt/work/qt/qtbase/src/corelib -I/home/qt/work/qt/qtbase_build/src/corelib -I/home/qt/work/qt/qtbase_build/src/corelib/global -I/home/qt/work/qt/qtbase_build/src/corelib/kernel -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src -I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0 -I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd -I/home/qt/work/qt/qtbase_build/src/corelib/.rcc -I/home/qt/work/qt/qtbase/mkspecs/linux-g++ -I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -g -DNDEBUG -O3 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wsuggest-override -fcf-protection=full -std=c++17 -Winvalid-pch -x c++-header -include /home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch -MF src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch.d -o src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch -c /home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.cxx

qpointer.cpp.o

[496/2442] sccache /usr/bin/g++ -DBACKTRACE_HEADER=\"execinfo.h\" -DCore_EXPORTS -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_AS_CONST -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include -I/home/qt/work/qt/qtbase_build/include -I/home/qt/work/qt/qtbase_build/include/QtCore -I/home/qt/work/qt/qtbase/src/corelib -I/home/qt/work/qt/qtbase_build/src/corelib -I/home/qt/work/qt/qtbase_build/src/corelib/global -I/home/qt/work/qt/qtbase_build/src/corelib/kernel -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src -I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0 -I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion -I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd -I/home/qt/work/qt/qtbase_build/src/corelib/.rcc -I/home/qt/work/qt/qtbase/mkspecs/linux-g++ -I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -g -DNDEBUG -O3 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wsuggest-override -fcf-protection=full -std=c++17 -Winvalid-pch -include /home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o -MF src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o.d -o src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o -c /home/qt/work/qt/qtbase/src/corelib/kernel/qpointer.cpp

Trace logs on the (local) server

cmake_pch.hxx.gch

[2023-08-01T12:21:53Z DEBUG sccache::server] handle_client: compile
[2023-08-01T12:21:53Z TRACE sccache::server] compiler_info
[2023-08-01T12:21:53Z TRACE sccache::server] compiler_info cache hit
[2023-08-01T12:21:53Z DEBUG sccache::server] check_compiler: Supported compiler
[2023-08-01T12:21:53Z DEBUG sccache::server] parse_arguments: Ok: ["-DBACKTRACE_HEADER=\"execinfo.h\"", "-DCore_EXPORTS", "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"", "-DPCRE2_CODE_UNIT_WIDTH=16", "-DQT_ASCII_CAST_WARNINGS", "-DQT_BUILDING_QT", "-DQT_BUILD_CORE_LIB", "-DQT_DEPRECATED_WARNINGS", "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000", "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH", "-DQT_LEAN_HEADERS=1", "-DQT_MOC_COMPAT", "-DQT_NO_AS_CONST", "-DQT_NO_CAST_TO_ASCII", "-DQT_NO_CONTEXTLESS_CONNECT", "-DQT_NO_DEBUG", "-DQT_NO_FOREACH", "-DQT_NO_JAVA_STYLE_ITERATORS", "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT", "-DQT_NO_QEXCHANGE", "-DQT_NO_USING_NAMESPACE", "-DQT_TYPESAFE_FLAGS", "-DQT_USE_QSTRINGBUILDER", "-DQT_WARN_DEPRECATED_UP_TO=0x070000", "-D_LARGEFILE64_SOURCE", "-D_LARGEFILE_SOURCE", "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include", "-I/home/qt/work/qt/qtbase_build/include", "-I/home/qt/work/qt/qtbase_build/include/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib/global", "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd", "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc", "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++", "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src", "-isystem", "/usr/include/glib-2.0", "-isystem", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "-g", "-DNDEBUG", "-O3", "-fPIC", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wall", "-Wextra", "-Wsuggest-override", "-fcf-protection=full", "-std=c++17", "-Winvalid-pch", "-x", "c++-header", "-include", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx", "-MD", "-MT", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch", "-MF", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch.d", "-o", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch", "-c", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.cxx"]
[2023-08-01T12:21:53Z TRACE tokio_util::codec::framed_impl] flushing framed transport
[2023-08-01T12:21:53Z TRACE tokio_util::codec::framed_impl] writing; remaining=12
[2023-08-01T12:21:53Z TRACE tokio_util::codec::framed_impl] framed transport flushed
[2023-08-01T12:21:53Z DEBUG sccache::compiler::compiler] [cmake_pch.hxx.gch]: get_cached_or_compile: ["-DBACKTRACE_HEADER=\"execinfo.h\"", "-DCore_EXPORTS", "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"", "-DPCRE2_CODE_UNIT_WIDTH=16", "-DQT_ASCII_CAST_WARNINGS", "-DQT_BUILDING_QT", "-DQT_BUILD_CORE_LIB", "-DQT_DEPRECATED_WARNINGS", "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000", "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH", "-DQT_LEAN_HEADERS=1", "-DQT_MOC_COMPAT", "-DQT_NO_AS_CONST", "-DQT_NO_CAST_TO_ASCII", "-DQT_NO_CONTEXTLESS_CONNECT", "-DQT_NO_DEBUG", "-DQT_NO_FOREACH", "-DQT_NO_JAVA_STYLE_ITERATORS", "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT", "-DQT_NO_QEXCHANGE", "-DQT_NO_USING_NAMESPACE", "-DQT_TYPESAFE_FLAGS", "-DQT_USE_QSTRINGBUILDER", "-DQT_WARN_DEPRECATED_UP_TO=0x070000", "-D_LARGEFILE64_SOURCE", "-D_LARGEFILE_SOURCE", "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include", "-I/home/qt/work/qt/qtbase_build/include", "-I/home/qt/work/qt/qtbase_build/include/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib/global", "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd", "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc", "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++", "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src", "-isystem", "/usr/include/glib-2.0", "-isystem", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "-g", "-DNDEBUG", "-O3", "-fPIC", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wall", "-Wextra", "-Wsuggest-override", "-fcf-protection=full", "-std=c++17", "-Winvalid-pch", "-x", "c++-header", "-include", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx", "-MD", "-MT", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch", "-MF", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch.d", "-o", "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch", "-c", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.cxx"]
[2023-08-01T12:21:53Z TRACE sccache::compiler::gcc] preprocess
[2023-08-01T12:21:53Z DEBUG sccache::compiler::gcc] arch args before rewrite: []
[2023-08-01T12:21:53Z DEBUG sccache::compiler::gcc] cmd after -arch rewrite: Some(cd "/home/qt/work/qt/qtbase_build" && ANDROID_API_VERSION="android-33" ANDROID_EMULATOR_RUNNER="/home/qt/android_emulator_launcher.sh" ANDROID_NDK_HOST="linux-x86_64" ANDROID_NDK_ROOT_DEFAULT="/opt/android/android-ndk-r25b" ANDROID_NDK_ROOT_LATEST="/opt/android/android-ndk-r25b" ANDROID_SDK_ROOT="/opt/android/sdk" BREAKPAD_SOURCE_DIR="/home/qt/breakpad" CONAN_REVISIONS_ENABLED="1" CONAN_V2_MODE="1" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" FBXSDK="/opt/fbx" FFMPEG_DIR="/usr/local/FFmpeg-n6.0" HOME="/home/qt" LANG="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_ALL="en_US.UTF8" LC_IDENTIFICATION="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LLVM_DYNAMIC_LIBS_100="/usr/local/libclang-dynlibs-10.0" LLVM_INSTALL_DIR="/usr/local/libclang-15.0.0" LOGNAME="qt" MOTD_SHOWN="pam" MQTT_TEST_BROKER_LOCATION="/opt/paho_broker/interoperability/startbroker.py" OLDPWD="/home/qt" OPENSSL_ANDROID_HOME_DEFAULT="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" OPENSSL_ANDROID_HOME_LATEST="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" PAPERSIZE="letter" PATH="/opt/cmake-3.24.2/bin:/home/qt/.local/bin:/home/qt/sccache_wrapper:/usr/local/sccache:/opt/node-v18.16.0-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" QEMUARM64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-" QEMUARM64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-cortexa57-poky-linux" QEMUARM64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARM64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/cortexa57-poky-linux" QEMUARMV7_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-" QEMUARMV7_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-armv7vet2hf-neon-poky-linux-gnueabi" QEMUARMV7_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARMV7_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/armv7vet2hf-neon-poky-linux-gnueabi" QEMUMIPS64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/mips64-poky-linux/mips64-poky-linux-" QEMUMIPS64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-mips64r2-poky-linux" QEMUMIPS64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUMIPS64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/mips64r2-poky-linux" QEMU_SET_ENV="QT_WAYLAND_DISABLE_WINDOWDECORATION=1" QNX_710="/opt/qnx710" QNX_QEMU="/home/qt/QNX" QNX_QEMU_IPADDR="172.31.1.10" QNX_QEMU_LD_LIBRARY_PATH="/proc/boot:/system/lib:/system/lib/dll:/home/qt/work/install/target/lib" QNX_QEMU_SSH="root@172.31.1.10" SCCACHE_IDLE_TIMEOUT="0" SCCACHE_IGNORE_SERVER_IO_ERROR="1" SCCACHE_LOG="trace" SHELL="/bin/bash" SHLVL="2" SSH_CLIENT="10.9.70.65 50596 22" SSH_CONNECTION="10.9.70.65 50596 10.215.244.133 22" SSH_TTY="/dev/pts/0" TERM="xterm-256color" USER="qt" XDG_DATA_DIRS="/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop" XDG_RUNTIME_DIR="/run/user/1000" XDG_SESSION_CLASS="user" XDG_SESSION_ID="3" XDG_SESSION_TYPE="tty" _="/usr/local/sccache/sccache" absl_ROOT="/home/qt/install-grpc-1.50.1" gRPC_ROOT="/home/qt/install-grpc-1.50.1" "/usr/bin/g++" "-x" "c++-header" "-E" "-P" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.cxx" "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include" "-I/home/qt/work/qt/qtbase_build/include" "-I/home/qt/work/qt/qtbase_build/include/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib/global" "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd" "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc" "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++" "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src" "-isystem" "/usr/include/glib-2.0" "-isystem" "/usr/lib/x86_64-linux-gnu/glib-2.0/include" "-include" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx" "-MD" "-MF" "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch.d" "-MT" "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch" "-DBACKTRACE_HEADER=\"execinfo.h\"" "-DCore_EXPORTS" "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"" "-DPCRE2_CODE_UNIT_WIDTH=16" "-DQT_ASCII_CAST_WARNINGS" "-DQT_BUILDING_QT" "-DQT_BUILD_CORE_LIB" "-DQT_DEPRECATED_WARNINGS" "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000" "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH" "-DQT_LEAN_HEADERS=1" "-DQT_MOC_COMPAT" "-DQT_NO_AS_CONST" "-DQT_NO_CAST_TO_ASCII" "-DQT_NO_CONTEXTLESS_CONNECT" "-DQT_NO_DEBUG" "-DQT_NO_FOREACH" "-DQT_NO_JAVA_STYLE_ITERATORS" "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT" "-DQT_NO_QEXCHANGE" "-DQT_NO_USING_NAMESPACE" "-DQT_TYPESAFE_FLAGS" "-DQT_USE_QSTRINGBUILDER" "-DQT_WARN_DEPRECATED_UP_TO=0x070000" "-D_LARGEFILE64_SOURCE" "-D_LARGEFILE_SOURCE" "-g" "-DNDEBUG" "-O3" "-fPIC" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wall" "-Wextra" "-Wsuggest-override" "-fcf-protection=full" "-std=c++17" "-Winvalid-pch")
[2023-08-01T12:21:53Z TRACE sccache::compiler::gcc] preprocess: Some(cd "/home/qt/work/qt/qtbase_build" && ANDROID_API_VERSION="android-33" ANDROID_EMULATOR_RUNNER="/home/qt/android_emulator_launcher.sh" ANDROID_NDK_HOST="linux-x86_64" ANDROID_NDK_ROOT_DEFAULT="/opt/android/android-ndk-r25b" ANDROID_NDK_ROOT_LATEST="/opt/android/android-ndk-r25b" ANDROID_SDK_ROOT="/opt/android/sdk" BREAKPAD_SOURCE_DIR="/home/qt/breakpad" CONAN_REVISIONS_ENABLED="1" CONAN_V2_MODE="1" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" FBXSDK="/opt/fbx" FFMPEG_DIR="/usr/local/FFmpeg-n6.0" HOME="/home/qt" LANG="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_ALL="en_US.UTF8" LC_IDENTIFICATION="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LLVM_DYNAMIC_LIBS_100="/usr/local/libclang-dynlibs-10.0" LLVM_INSTALL_DIR="/usr/local/libclang-15.0.0" LOGNAME="qt" MOTD_SHOWN="pam" MQTT_TEST_BROKER_LOCATION="/opt/paho_broker/interoperability/startbroker.py" OLDPWD="/home/qt" OPENSSL_ANDROID_HOME_DEFAULT="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" OPENSSL_ANDROID_HOME_LATEST="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" PAPERSIZE="letter" PATH="/opt/cmake-3.24.2/bin:/home/qt/.local/bin:/home/qt/sccache_wrapper:/usr/local/sccache:/opt/node-v18.16.0-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" QEMUARM64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-" QEMUARM64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-cortexa57-poky-linux" QEMUARM64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARM64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/cortexa57-poky-linux" QEMUARMV7_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-" QEMUARMV7_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-armv7vet2hf-neon-poky-linux-gnueabi" QEMUARMV7_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARMV7_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/armv7vet2hf-neon-poky-linux-gnueabi" QEMUMIPS64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/mips64-poky-linux/mips64-poky-linux-" QEMUMIPS64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-mips64r2-poky-linux" QEMUMIPS64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUMIPS64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/mips64r2-poky-linux" QEMU_SET_ENV="QT_WAYLAND_DISABLE_WINDOWDECORATION=1" QNX_710="/opt/qnx710" QNX_QEMU="/home/qt/QNX" QNX_QEMU_IPADDR="172.31.1.10" QNX_QEMU_LD_LIBRARY_PATH="/proc/boot:/system/lib:/system/lib/dll:/home/qt/work/install/target/lib" QNX_QEMU_SSH="root@172.31.1.10" SCCACHE_IDLE_TIMEOUT="0" SCCACHE_IGNORE_SERVER_IO_ERROR="1" SCCACHE_LOG="trace" SHELL="/bin/bash" SHLVL="2" SSH_CLIENT="10.9.70.65 50596 22" SSH_CONNECTION="10.9.70.65 50596 10.215.244.133 22" SSH_TTY="/dev/pts/0" TERM="xterm-256color" USER="qt" XDG_DATA_DIRS="/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop" XDG_RUNTIME_DIR="/run/user/1000" XDG_SESSION_CLASS="user" XDG_SESSION_ID="3" XDG_SESSION_TYPE="tty" _="/usr/local/sccache/sccache" absl_ROOT="/home/qt/install-grpc-1.50.1" gRPC_ROOT="/home/qt/install-grpc-1.50.1" "/usr/bin/g++" "-x" "c++-header" "-E" "-P" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.cxx" "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include" "-I/home/qt/work/qt/qtbase_build/include" "-I/home/qt/work/qt/qtbase_build/include/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib/global" "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd" "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc" "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++" "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src" "-isystem" "/usr/include/glib-2.0" "-isystem" "/usr/lib/x86_64-linux-gnu/glib-2.0/include" "-include" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx" "-MD" "-MF" "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch.d" "-MT" "src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx.gch" "-DBACKTRACE_HEADER=\"execinfo.h\"" "-DCore_EXPORTS" "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"" "-DPCRE2_CODE_UNIT_WIDTH=16" "-DQT_ASCII_CAST_WARNINGS" "-DQT_BUILDING_QT" "-DQT_BUILD_CORE_LIB" "-DQT_DEPRECATED_WARNINGS" "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000" "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH" "-DQT_LEAN_HEADERS=1" "-DQT_MOC_COMPAT" "-DQT_NO_AS_CONST" "-DQT_NO_CAST_TO_ASCII" "-DQT_NO_CONTEXTLESS_CONNECT" "-DQT_NO_DEBUG" "-DQT_NO_FOREACH" "-DQT_NO_JAVA_STYLE_ITERATORS" "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT" "-DQT_NO_QEXCHANGE" "-DQT_NO_USING_NAMESPACE" "-DQT_TYPESAFE_FLAGS" "-DQT_USE_QSTRINGBUILDER" "-DQT_WARN_DEPRECATED_UP_TO=0x070000" "-D_LARGEFILE64_SOURCE" "-D_LARGEFILE_SOURCE" "-g" "-DNDEBUG" "-O3" "-fPIC" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wall" "-Wextra" "-Wsuggest-override" "-fcf-protection=full" "-std=c++17" "-Winvalid-pch")
[2023-08-01T12:21:53Z TRACE mio::poll] registering event source with poller: token=Token(33554434), interests=READABLE | WRITABLE
[2023-08-01T12:21:53Z TRACE mio::poll] registering event source with poller: token=Token(33554435), interests=READABLE | WRITABLE
[2023-08-01T12:21:54Z TRACE mio::poll] deregistering event source from poller
[2023-08-01T12:21:54Z TRACE mio::poll] deregistering event source from poller
[2023-08-01T12:21:54Z TRACE sccache::util] Hashed 0 files in 0.000 s
[2023-08-01T12:21:54Z TRACE sccache::compiler::c] [cmake_pch.hxx.gch]: Preprocessor output is 3028432 bytes
[2023-08-01T12:21:54Z DEBUG sccache::compiler::compiler] [cmake_pch.hxx.gch]: generate_hash_key took 0.109 s
[2023-08-01T12:21:54Z TRACE sccache::compiler::compiler] [cmake_pch.hxx.gch]: Hash key: 586fe72d0dc68bf36a7995cb57fa05356f76548d750f215589f97c25dc733883
[2023-08-01T12:21:54Z TRACE sccache::cache::disk] DiskCache::get(586fe72d0dc68bf36a7995cb57fa05356f76548d750f215589f97c25dc733883)
[2023-08-01T12:21:54Z DEBUG sccache::compiler::compiler] [cmake_pch.hxx.gch]: Cache hit in 0.000 s

qpointer.cpp.o

[2023-08-01T12:18:44Z DEBUG sccache::server] handle_client: compile
[2023-08-01T12:18:44Z TRACE sccache::server] compiler_info
[2023-08-01T12:18:44Z TRACE sccache::server] compiler_info cache miss
[...]  # Omitting the check_compiler stuff
[2023-08-01T12:18:44Z DEBUG sccache::server] check_compiler: Supported compiler
[2023-08-01T12:18:44Z DEBUG sccache::server] parse_arguments: Ok: ["-DBACKTRACE_HEADER=\"execinfo.h\"", "-DCore_EXPORTS", "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"", "-DPCRE2_CODE_UNIT_WIDTH=16", "-DQT_ASCII_CAST_WARNINGS", "-DQT_BUILDING_QT", "-DQT_BUILD_CORE_LIB", "-DQT_DEPRECATED_WARNINGS", "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000", "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH", "-DQT_LEAN_HEADERS=1", "-DQT_MOC_COMPAT", "-DQT_NO_AS_CONST", "-DQT_NO_CAST_TO_ASCII", "-DQT_NO_CONTEXTLESS_CONNECT", "-DQT_NO_DEBUG", "-DQT_NO_FOREACH", "-DQT_NO_JAVA_STYLE_ITERATORS", "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT", "-DQT_NO_QEXCHANGE", "-DQT_NO_USING_NAMESPACE", "-DQT_TYPESAFE_FLAGS", "-DQT_USE_QSTRINGBUILDER", "-DQT_WARN_DEPRECATED_UP_TO=0x070000", "-D_LARGEFILE64_SOURCE", "-D_LARGEFILE_SOURCE", "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include", "-I/home/qt/work/qt/qtbase_build/include", "-I/home/qt/work/qt/qtbase_build/include/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib/global", "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd", "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc", "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++", "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src", "-isystem", "/usr/include/glib-2.0", "-isystem", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "-g", "-DNDEBUG", "-O3", "-fPIC", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wall", "-Wextra", "-Wsuggest-override", "-fcf-protection=full", "-std=c++17", "-Winvalid-pch", "-include", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx", "-MD", "-MT", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o", "-MF", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o.d", "-o", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o", "-c", "/home/qt/work/qt/qtbase/src/corelib/kernel/qpointer.cpp"]
[2023-08-01T12:18:44Z TRACE tokio_util::codec::framed_impl] flushing framed transport
[2023-08-01T12:18:44Z TRACE tokio_util::codec::framed_impl] writing; remaining=12
[2023-08-01T12:18:44Z TRACE tokio_util::codec::framed_impl] framed transport flushed
[2023-08-01T12:18:44Z DEBUG sccache::compiler::compiler] [qpointer.cpp.o]: get_cached_or_compile: ["-DBACKTRACE_HEADER=\"execinfo.h\"", "-DCore_EXPORTS", "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"", "-DPCRE2_CODE_UNIT_WIDTH=16", "-DQT_ASCII_CAST_WARNINGS", "-DQT_BUILDING_QT", "-DQT_BUILD_CORE_LIB", "-DQT_DEPRECATED_WARNINGS", "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000", "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH", "-DQT_LEAN_HEADERS=1", "-DQT_MOC_COMPAT", "-DQT_NO_AS_CONST", "-DQT_NO_CAST_TO_ASCII", "-DQT_NO_CONTEXTLESS_CONNECT", "-DQT_NO_DEBUG", "-DQT_NO_FOREACH", "-DQT_NO_JAVA_STYLE_ITERATORS", "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT", "-DQT_NO_QEXCHANGE", "-DQT_NO_USING_NAMESPACE", "-DQT_TYPESAFE_FLAGS", "-DQT_USE_QSTRINGBUILDER", "-DQT_WARN_DEPRECATED_UP_TO=0x070000", "-D_LARGEFILE64_SOURCE", "-D_LARGEFILE_SOURCE", "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include", "-I/home/qt/work/qt/qtbase_build/include", "-I/home/qt/work/qt/qtbase_build/include/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib", "-I/home/qt/work/qt/qtbase_build/src/corelib/global", "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0", "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion", "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd", "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc", "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++", "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src", "-isystem", "/usr/include/glib-2.0", "-isystem", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "-g", "-DNDEBUG", "-O3", "-fPIC", "-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wall", "-Wextra", "-Wsuggest-override", "-fcf-protection=full", "-std=c++17", "-Winvalid-pch", "-include", "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx", "-MD", "-MT", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o", "-MF", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o.d", "-o", "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o", "-c", "/home/qt/work/qt/qtbase/src/corelib/kernel/qpointer.cpp"]
[2023-08-01T12:18:44Z TRACE sccache::compiler::gcc] preprocess
[2023-08-01T12:18:44Z DEBUG sccache::compiler::gcc] arch args before rewrite: []
[2023-08-01T12:18:44Z DEBUG sccache::compiler::gcc] cmd after -arch rewrite: Some(cd "/home/qt/work/qt/qtbase_build" && ANDROID_API_VERSION="android-33" ANDROID_EMULATOR_RUNNER="/home/qt/android_emulator_launcher.sh" ANDROID_NDK_HOST="linux-x86_64" ANDROID_NDK_ROOT_DEFAULT="/opt/android/android-ndk-r25b" ANDROID_NDK_ROOT_LATEST="/opt/android/android-ndk-r25b" ANDROID_SDK_ROOT="/opt/android/sdk" BREAKPAD_SOURCE_DIR="/home/qt/breakpad" CONAN_REVISIONS_ENABLED="1" CONAN_V2_MODE="1" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" FBXSDK="/opt/fbx" FFMPEG_DIR="/usr/local/FFmpeg-n6.0" HOME="/home/qt" LANG="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_ALL="en_US.UTF8" LC_IDENTIFICATION="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LLVM_DYNAMIC_LIBS_100="/usr/local/libclang-dynlibs-10.0" LLVM_INSTALL_DIR="/usr/local/libclang-15.0.0" LOGNAME="qt" MOTD_SHOWN="pam" MQTT_TEST_BROKER_LOCATION="/opt/paho_broker/interoperability/startbroker.py" OLDPWD="/home/qt" OPENSSL_ANDROID_HOME_DEFAULT="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" OPENSSL_ANDROID_HOME_LATEST="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" PAPERSIZE="letter" PATH="/opt/cmake-3.24.2/bin:/home/qt/.local/bin:/home/qt/sccache_wrapper:/usr/local/sccache:/opt/node-v18.16.0-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" QEMUARM64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-" QEMUARM64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-cortexa57-poky-linux" QEMUARM64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARM64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/cortexa57-poky-linux" QEMUARMV7_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-" QEMUARMV7_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-armv7vet2hf-neon-poky-linux-gnueabi" QEMUARMV7_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARMV7_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/armv7vet2hf-neon-poky-linux-gnueabi" QEMUMIPS64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/mips64-poky-linux/mips64-poky-linux-" QEMUMIPS64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-mips64r2-poky-linux" QEMUMIPS64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUMIPS64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/mips64r2-poky-linux" QEMU_SET_ENV="QT_WAYLAND_DISABLE_WINDOWDECORATION=1" QNX_710="/opt/qnx710" QNX_QEMU="/home/qt/QNX" QNX_QEMU_IPADDR="172.31.1.10" QNX_QEMU_LD_LIBRARY_PATH="/proc/boot:/system/lib:/system/lib/dll:/home/qt/work/install/target/lib" QNX_QEMU_SSH="root@172.31.1.10" SCCACHE_IDLE_TIMEOUT="0" SCCACHE_IGNORE_SERVER_IO_ERROR="1" SCCACHE_LOG="trace" SHELL="/bin/bash" SHLVL="2" SSH_CLIENT="10.9.70.65 50596 22" SSH_CONNECTION="10.9.70.65 50596 10.215.244.133 22" SSH_TTY="/dev/pts/0" TERM="xterm-256color" USER="qt" XDG_DATA_DIRS="/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop" XDG_RUNTIME_DIR="/run/user/1000" XDG_SESSION_CLASS="user" XDG_SESSION_ID="3" XDG_SESSION_TYPE="tty" _="/usr/local/sccache/sccache" absl_ROOT="/home/qt/install-grpc-1.50.1" gRPC_ROOT="/home/qt/install-grpc-1.50.1" "/usr/bin/g++" "-x" "c++" "-E" "-P" "/home/qt/work/qt/qtbase/src/corelib/kernel/qpointer.cpp" "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include" "-I/home/qt/work/qt/qtbase_build/include" "-I/home/qt/work/qt/qtbase_build/include/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib/global" "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd" "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc" "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++" "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src" "-isystem" "/usr/include/glib-2.0" "-isystem" "/usr/lib/x86_64-linux-gnu/glib-2.0/include" "-include" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx" "-MD" "-MF" "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o.d" "-MT" "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o" "-DBACKTRACE_HEADER=\"execinfo.h\"" "-DCore_EXPORTS" "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"" "-DPCRE2_CODE_UNIT_WIDTH=16" "-DQT_ASCII_CAST_WARNINGS" "-DQT_BUILDING_QT" "-DQT_BUILD_CORE_LIB" "-DQT_DEPRECATED_WARNINGS" "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000" "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH" "-DQT_LEAN_HEADERS=1" "-DQT_MOC_COMPAT" "-DQT_NO_AS_CONST" "-DQT_NO_CAST_TO_ASCII" "-DQT_NO_CONTEXTLESS_CONNECT" "-DQT_NO_DEBUG" "-DQT_NO_FOREACH" "-DQT_NO_JAVA_STYLE_ITERATORS" "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT" "-DQT_NO_QEXCHANGE" "-DQT_NO_USING_NAMESPACE" "-DQT_TYPESAFE_FLAGS" "-DQT_USE_QSTRINGBUILDER" "-DQT_WARN_DEPRECATED_UP_TO=0x070000" "-D_LARGEFILE64_SOURCE" "-D_LARGEFILE_SOURCE" "-g" "-DNDEBUG" "-O3" "-fPIC" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wall" "-Wextra" "-Wsuggest-override" "-fcf-protection=full" "-std=c++17" "-Winvalid-pch")
[2023-08-01T12:18:44Z TRACE sccache::compiler::gcc] preprocess: Some(cd "/home/qt/work/qt/qtbase_build" && ANDROID_API_VERSION="android-33" ANDROID_EMULATOR_RUNNER="/home/qt/android_emulator_launcher.sh" ANDROID_NDK_HOST="linux-x86_64" ANDROID_NDK_ROOT_DEFAULT="/opt/android/android-ndk-r25b" ANDROID_NDK_ROOT_LATEST="/opt/android/android-ndk-r25b" ANDROID_SDK_ROOT="/opt/android/sdk" BREAKPAD_SOURCE_DIR="/home/qt/breakpad" CONAN_REVISIONS_ENABLED="1" CONAN_V2_MODE="1" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" FBXSDK="/opt/fbx" FFMPEG_DIR="/usr/local/FFmpeg-n6.0" HOME="/home/qt" LANG="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_ALL="en_US.UTF8" LC_IDENTIFICATION="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LLVM_DYNAMIC_LIBS_100="/usr/local/libclang-dynlibs-10.0" LLVM_INSTALL_DIR="/usr/local/libclang-15.0.0" LOGNAME="qt" MOTD_SHOWN="pam" MQTT_TEST_BROKER_LOCATION="/opt/paho_broker/interoperability/startbroker.py" OLDPWD="/home/qt" OPENSSL_ANDROID_HOME_DEFAULT="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" OPENSSL_ANDROID_HOME_LATEST="/home/qt/prebuilt-openssl-3.0.7-for-android-ndk-r25b" PAPERSIZE="letter" PATH="/opt/cmake-3.24.2/bin:/home/qt/.local/bin:/home/qt/sccache_wrapper:/usr/local/sccache:/opt/node-v18.16.0-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" QEMUARM64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-" QEMUARM64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-cortexa57-poky-linux" QEMUARM64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARM64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/cortexa57-poky-linux" QEMUARMV7_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-" QEMUARMV7_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-armv7vet2hf-neon-poky-linux-gnueabi" QEMUARMV7_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUARMV7_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/armv7vet2hf-neon-poky-linux-gnueabi" QEMUMIPS64_TOOLCHAIN_CROSS_COMPILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/bin/mips64-poky-linux/mips64-poky-linux-" QEMUMIPS64_TOOLCHAIN_ENVSETUP="/opt/b2qt/3.2/environment-setup-mips64r2-poky-linux" QEMUMIPS64_TOOLCHAIN_FILE="/opt/b2qt/3.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake" QEMUMIPS64_TOOLCHAIN_SYSROOT="/opt/b2qt/3.2/sysroots/mips64r2-poky-linux" QEMU_SET_ENV="QT_WAYLAND_DISABLE_WINDOWDECORATION=1" QNX_710="/opt/qnx710" QNX_QEMU="/home/qt/QNX" QNX_QEMU_IPADDR="172.31.1.10" QNX_QEMU_LD_LIBRARY_PATH="/proc/boot:/system/lib:/system/lib/dll:/home/qt/work/install/target/lib" QNX_QEMU_SSH="root@172.31.1.10" SCCACHE_IDLE_TIMEOUT="0" SCCACHE_IGNORE_SERVER_IO_ERROR="1" SCCACHE_LOG="trace" SHELL="/bin/bash" SHLVL="2" SSH_CLIENT="10.9.70.65 50596 22" SSH_CONNECTION="10.9.70.65 50596 10.215.244.133 22" SSH_TTY="/dev/pts/0" TERM="xterm-256color" USER="qt" XDG_DATA_DIRS="/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop" XDG_RUNTIME_DIR="/run/user/1000" XDG_SESSION_CLASS="user" XDG_SESSION_ID="3" XDG_SESSION_TYPE="tty" _="/usr/local/sccache/sccache" absl_ROOT="/home/qt/install-grpc-1.50.1" gRPC_ROOT="/home/qt/install-grpc-1.50.1" "/usr/bin/g++" "-x" "c++" "-E" "-P" "/home/qt/work/qt/qtbase/src/corelib/kernel/qpointer.cpp" "-I/home/qt/work/qt/qtbase_build/src/corelib/Core_autogen/include" "-I/home/qt/work/qt/qtbase_build/include" "-I/home/qt/work/qt/qtbase_build/include/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib" "-I/home/qt/work/qt/qtbase_build/src/corelib/global" "-I/home/qt/work/qt/qtbase_build/src/corelib/kernel" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/tinycbor/src" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0" "-I/home/qt/work/qt/qtbase_build/include/QtCore/6.7.0/QtCore" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/double-conversion" "-I/home/qt/work/qt/qtbase/src/corelib/../3rdparty/forkfd" "-I/home/qt/work/qt/qtbase_build/src/corelib/.rcc" "-I/home/qt/work/qt/qtbase/mkspecs/linux-g++" "-I/home/qt/work/qt/qtbase/src/3rdparty/pcre2/src" "-isystem" "/usr/include/glib-2.0" "-isystem" "/usr/lib/x86_64-linux-gnu/glib-2.0/include" "-include" "/home/qt/work/qt/qtbase_build/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx" "-MD" "-MF" "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o.d" "-MT" "src/corelib/CMakeFiles/Core.dir/kernel/qpointer.cpp.o" "-DBACKTRACE_HEADER=\"execinfo.h\"" "-DCore_EXPORTS" "-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\"" "-DPCRE2_CODE_UNIT_WIDTH=16" "-DQT_ASCII_CAST_WARNINGS" "-DQT_BUILDING_QT" "-DQT_BUILD_CORE_LIB" "-DQT_DEPRECATED_WARNINGS" "-DQT_DISABLE_DEPRECATED_UP_TO=0x050000" "-DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH" "-DQT_LEAN_HEADERS=1" "-DQT_MOC_COMPAT" "-DQT_NO_AS_CONST" "-DQT_NO_CAST_TO_ASCII" "-DQT_NO_CONTEXTLESS_CONNECT" "-DQT_NO_DEBUG" "-DQT_NO_FOREACH" "-DQT_NO_JAVA_STYLE_ITERATORS" "-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT" "-DQT_NO_QEXCHANGE" "-DQT_NO_USING_NAMESPACE" "-DQT_TYPESAFE_FLAGS" "-DQT_USE_QSTRINGBUILDER" "-DQT_WARN_DEPRECATED_UP_TO=0x070000" "-D_LARGEFILE64_SOURCE" "-D_LARGEFILE_SOURCE" "-g" "-DNDEBUG" "-O3" "-fPIC" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wall" "-Wextra" "-Wsuggest-override" "-fcf-protection=full" "-std=c++17" "-Winvalid-pch")
[2023-08-01T12:18:44Z TRACE mio::poll] registering event source with poller: token=Token(16777219), interests=READABLE | WRITABLE
[2023-08-01T12:18:44Z TRACE mio::poll] registering event source with poller: token=Token(16777218), interests=READABLE | WRITABLE
[2023-08-01T12:18:45Z TRACE mio::poll] deregistering event source from poller
[2023-08-01T12:18:45Z TRACE mio::poll] deregistering event source from poller
[2023-08-01T12:18:45Z TRACE sccache::util] Hashed 0 files in 0.000 s
[2023-08-01T12:18:45Z TRACE sccache::compiler::c] [qpointer.cpp.o]: Preprocessor output is 3028432 bytes
[2023-08-01T12:18:45Z DEBUG sccache::compiler::compiler] [qpointer.cpp.o]: generate_hash_key took 0.113 s
[2023-08-01T12:18:45Z TRACE sccache::compiler::compiler] [qpointer.cpp.o]: Hash key: 586fe72d0dc68bf36a7995cb57fa05356f76548d750f215589f97c25dc733883
[2023-08-01T12:18:45Z TRACE sccache::cache::disk] DiskCache::get(586fe72d0dc68bf36a7995cb57fa05356f76548d750f215589f97c25dc733883)
[2023-08-01T12:18:45Z DEBUG sccache::compiler::compiler] [qpointer.cpp.o]: Cache hit in 0.002 s

NOTE: The hash key for both is 586fe72d0dc68bf36a7995cb57fa05356f76548d750f215589f97c25dc733883 !!!

My understanding is that both commands compile the same pre-processed source code, but the output format differs.

Xuanwo commented 1 year ago

Interesting. We already included langauge in the hash calculation:

https://github.com/mozilla/sccache/blob/7074753bfc100ee3e22dc730cf71f3750fc42c1d/src/compiler/c.rs#L717-L750

jimis commented 1 year ago

Isn't language the input language? Both input files are C++ code. The different is in the output format.

According to my experiments, it's the parameter -x c++-header that makes GCC generate GCH file.

jimis commented 1 year ago

GCC's logic that determines the output format is a bit complicated, and depends on the extension of the main input file and on the -x option. According to GCC docs:

-x language

Specify explicitly the language for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next -x option.

After experimenting, here is GCC's behaviour, without sccache involved:

~I guess Sccache doesn't take -x into consideration?~ EDIT: scratch that, apparently it does: https://github.com/mozilla/sccache/blob/7074753bfc100ee3e22dc730cf71f3750fc42c1d/src/compiler/gcc.rs#L609-L620

jimis commented 1 year ago

Another thing to note is that all the .cpp files that get mis-compiled are empty i.e. contain only comments (class documentation). And the cmake_pch.hxx.cxx file is also empty, contains only a single comment line.

So here my current theory:

  1. Sccache, for all command lines, does pre-compilation (-E) first, with output to stdout
  2. GCC, for all the offending files, when fed the -E parameter, outputs the same preprocessed source regardless of the -x argument it has on the command line
  3. Sccache follows with a "local compile" step, which is kind of opaque. All I can see in the (local) server logs, for both the PCH generation and the object code generation steps, is:
    [2023-08-01T16:20:57Z TRACE sccache::compiler::gcc] compile
    [2023-08-01T16:20:57Z DEBUG sccache::compiler::compiler] [cmake_pch.hxx.gch]: Compiling locally
  4. The result of "compile" is different based on the -x argument. But sccache stores them under the same hash key.
    • Indeed for each case I cleared the cache and re-run the compilation. The result file was correct. Running the same command with populated cache resulted to a possibly wrong output file, because of the hash collision.
jimis commented 1 month ago

Simplest way to reproduce the issue:

  $ touch empty.c
  $ gcc              -c -o out1 empty.c
  $ gcc  -x c-header -c -o out2 empty.c
  $ file out1 out2
  out1: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
  out2: GCC precompiled header (version 014) for C

The two files are different. But if we feed these compilations to sccache, they lead to the same result:

  $ sccache gcc              -c -o out3 empty.c
  $ sccache gcc  -x c-header -c -o out4 empty.c
  $ file out3 out4
  out3: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
  out4: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

I'm editing the description to avoid misleading people through heaps of debugging info.