Skip to content

Commit

Permalink
Merge pull request #1 from adessoSE/dev/fix-linux-ci
Browse files Browse the repository at this point in the history
ci: Fix GCC linux build failures
  • Loading branch information
BurningEnlightenment authored Aug 25, 2023
2 parents 2e83ce4 + 88c4f05 commit b623163
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/cpp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install go (boringSSL build dependency)
if: ${{ !startsWith(matrix.os, 'windows-') }}
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'
- name: Install nasm (boringSSL build dependency)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
sudo apt-get -qq update
sudo apt-get -qq install nasm
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
Expand Down Expand Up @@ -86,6 +97,15 @@ jobs:
sudo apt-get -qq update
sudo apt-get -qq -y install clang-15 clang-tidy-15 clang-format-15
- name: Install go (boringSSL build dependency)
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'
- name: Install nasm (boringSSL build dependency)
run: |
sudo apt-get -qq update
sudo apt-get -qq install nasm
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
Expand Down
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@
"cacheVariables": {
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/tools/toolchains/gcc-12-x64-linux.cmake",
"CMAKE_CXX_FLAGS": "-fconcepts-diagnostics-depth=0 -ftemplate-backtrace-limit=0 -fsanitize=address,leak,undefined -g -fno-omit-frame-pointer",
"CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address,leak,undefined",
"CMAKE_CXX_COMPILER": "g++"
"CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address,leak,undefined"
}
}
],
Expand Down
11 changes: 10 additions & 1 deletion apps/vefs/cli/key-provider/mdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <boost/algorithm/hex.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/json/src.hpp>
#include <boost/predef/os.h>
#include <dplx/cncr/windows-proper.h>
#include <openssl/evp.h>
Expand All @@ -20,6 +19,16 @@
#include "vefs/cli/commandlets/base.hpp"
#include "vefs/cli/utils.hpp"

#if defined(DPLX_COMP_GNUC_AVAILABLE)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
#include <boost/json/src.hpp>
#if defined(DPLX_COMP_GNUC_AVAILABLE)
#pragma GCC diagnostic pop
#endif

namespace vefs
{

Expand Down
10 changes: 10 additions & 0 deletions src/vefs/vfilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <boost/container/small_vector.hpp>
#include <boost/endian/conversion.hpp>

#include <dplx/predef/compiler/gcc.h>

#include <dplx/dp/api.hpp>
#include <dplx/dp/items/emit_core.hpp>
#include <dplx/dp/items/item_size_of_ranges.hpp>
Expand Down Expand Up @@ -116,6 +118,11 @@ class vfilesystem::index_tree_layout
int next_block;
};

#if defined(DPLX_COMP_GNUC_AVAILABLE)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

class tree_input_stream final
: public dplx::dp::legacy::chunked_input_stream_base<tree_input_stream>
{
Expand Down Expand Up @@ -355,6 +362,9 @@ class vfilesystem::index_tree_layout
return as_span(mCurrentSector).subspan(alloc_map_size);
}
};
#if defined(DPLX_COMP_GNUC_AVAILABLE)
#pragma GCC diagnostic pop
#endif

public:
index_tree_layout(tree_type &indexTree,
Expand Down
4 changes: 2 additions & 2 deletions tools/toolchains/clang-15-x64-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER clang-15)
set(CMAKE_CXX_COMPILER clang++-15)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 17 CACHE STRING "default C standard target")
set(CMAKE_CXX_STANDARD 20 CACHE STRING "default C++ standard target")

set(CMAKE_CXX_FLAGS_INIT "-fsized-deallocation")
4 changes: 2 additions & 2 deletions tools/toolchains/clang-x64-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 17 CACHE STRING "default C standard target")
set(CMAKE_CXX_STANDARD 20 CACHE STRING "default C++ standard target")

set(CMAKE_CXX_FLAGS_INIT "-fsized-deallocation")
8 changes: 4 additions & 4 deletions tools/toolchains/gcc-12-x64-linux.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_PROCESSOR AMD64)

set(CMAKE_C_COMPILER gcc-12)
set(CMAKE_CXX_COMPILER g++-12)
set(CMAKE_C_COMPILER "gcc-12" CACHE STRING "C compiler")
set(CMAKE_CXX_COMPILER "g++-12" CACHE STRING "C++ compiler")

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 17 CACHE STRING "default C standard target")
set(CMAKE_CXX_STANDARD 20 CACHE STRING "default C++ standard target")
4 changes: 4 additions & 0 deletions tools/triplets/x64-linux-clang-15.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/clang-15-x64-linux.cmake")

if (PORT STREQUAL "boringssl")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_STANDARD=17")
endif()
4 changes: 4 additions & 0 deletions tools/triplets/x64-linux-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/clang-x64-linux.cmake")

if (PORT STREQUAL "boringssl")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_STANDARD=17")
endif()

0 comments on commit b623163

Please sign in to comment.