From 10db1e6f4f547fd35d9cf0023fb8c77a876dcf21 Mon Sep 17 00:00:00 2001 From: Serge Camille Date: Sun, 8 Oct 2023 14:22:55 +0200 Subject: [PATCH 1/4] Use matching lld version and adjust tcb span tuple struct definitions The hope is that building with clang-7 gets faster. --- .github/workflows/main.yml | 4 +++- engine/lib/tcb/span.hpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bc294311f9..79c7be8706c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,10 +87,12 @@ jobs: - compiler: clang++-7 os: ubuntu-20.04 packages: clang-7 lld-7 + linker: lld-7 - compiler: clang++-15 os: ubuntu-22.04 packages: clang-15 lld-15 enable_file_prefix_map: true + linker: lld-15 exclude: - compiler: clang++-7 cppVersion: 20 @@ -119,7 +121,7 @@ jobs: -DCMAKE_CXX_FLAGS="-Og ${{ matrix.enable_file_prefix_map && format('-ffile-prefix-map={0}/=/', runner.workspace) || ''}} -fno-omit-frame-pointer -fsanitize=address,undefined -fsanitize-undefined-strip-path-components=$UBSAN_STRIP_COUNT" - -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -fsanitize=address,undefined" + -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=${{ matrix.linker }} -fsanitize=address,undefined" -DCMAKE_CXX_STANDARD=${{ matrix.cppVersion }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache diff --git a/engine/lib/tcb/span.hpp b/engine/lib/tcb/span.hpp index ab629e41dcb..5faf77ae4bf 100644 --- a/engine/lib/tcb/span.hpp +++ b/engine/lib/tcb/span.hpp @@ -609,15 +609,15 @@ constexpr auto get(span s) -> decltype(s[N]) namespace std { template -class tuple_size> +struct tuple_size> : public integral_constant {}; template -class tuple_size>; // not defined template -class tuple_element> { +struct tuple_element> { public: static_assert(Extent != TCB_SPAN_NAMESPACE_NAME::dynamic_extent && I < Extent, From 2e5b4eba55914cba77b21e3ddc582556090fb243 Mon Sep 17 00:00:00 2001 From: Serge Camille Date: Sun, 8 Oct 2023 15:19:49 +0200 Subject: [PATCH 2/4] Try using content mode for ccache --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79c7be8706c..ef50c296159 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,6 +130,7 @@ jobs: CCACHE_BASEDIR: ${{ runner.workspace }} CCACHE_DIR: ${{ runner.workspace }}/.ccache CCACHE_MAXSIZE: 256M # full build consumes around ~124, ~2x that to be safe + CCACHE_COMPILERCHECK: content run: | ccache -z ninja -C '${{ runner.workspace }}/b/ninja' From 19bdfc8d6c058359db4196cfbe6a2f5dc59274db Mon Sep 17 00:00:00 2001 From: Serge Camille Date: Sun, 8 Oct 2023 16:01:54 +0200 Subject: [PATCH 3/4] Revert "Try using content mode for ccache" This reverts commit 2e5b4eba55914cba77b21e3ddc582556090fb243. --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef50c296159..79c7be8706c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -130,7 +130,6 @@ jobs: CCACHE_BASEDIR: ${{ runner.workspace }} CCACHE_DIR: ${{ runner.workspace }}/.ccache CCACHE_MAXSIZE: 256M # full build consumes around ~124, ~2x that to be safe - CCACHE_COMPILERCHECK: content run: | ccache -z ninja -C '${{ runner.workspace }}/b/ninja' From c2636fac9c611bc9db462b5dda6aaf0e77ae9f43 Mon Sep 17 00:00:00 2001 From: Serge Camille Date: Sun, 8 Oct 2023 16:03:39 +0200 Subject: [PATCH 4/4] At least use -fdebug-prefix-map --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79c7be8706c..7317ebaee61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,6 +119,7 @@ jobs: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_CXX_FLAGS="-Og ${{ matrix.enable_file_prefix_map && format('-ffile-prefix-map={0}/=/', runner.workspace) || ''}} + ${{ format('-fdebug-prefix-map={0}/=/', runner.workspace) || ''}} -fno-omit-frame-pointer -fsanitize=address,undefined -fsanitize-undefined-strip-path-components=$UBSAN_STRIP_COUNT" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=${{ matrix.linker }} -fsanitize=address,undefined"