From 38f5a0ba1768469f848eb88b8d634e40e6e63dbb Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 18 Aug 2020 12:07:55 +0200 Subject: Port to Debian 10. --- build_settings.cmake | 8 +++++++- default_build_settings.cmake | 7 +++++++ .../storage/persistence/filestorage/filestorhandlerimpl.cpp | 2 ++ vespalib/src/vespa/vespalib/testkit/test_master.hpp | 9 +++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/build_settings.cmake b/build_settings.cmake index d7dd26f5ee7..6f6df3de883 100644 --- a/build_settings.cmake +++ b/build_settings.cmake @@ -66,8 +66,14 @@ else() set(VESPA_STDCXX_FS_LIB "stdc++fs") endif() +if(VESPA_OS_DISTRO_COMBINED STREQUAL "debian 10") + set(VESPA_XXHASH_DEFINE "-DXXH_NO_INLINE_ALL") +else() + set(VESPA_XXHASH_DEFINE "-DXXH_INLINE_ALL") +endif() + # C and C++ compiler flags -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} -DXXH_INLINE_ALL -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -fno-omit-frame-pointer ${C_WARN_OPTS} -fPIC ${VESPA_CXX_ABI_FLAGS} ${VESPA_XXHASH_DEFINE} -DBOOST_DISABLE_ASSERTS ${VESPA_CPU_ARCH_FLAGS} ${EXTRA_C_FLAGS}") # AddressSanitizer/ThreadSanitizer work for both GCC and Clang if (VESPA_USE_SANITIZER) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${VESPA_USE_SANITIZER}") diff --git a/default_build_settings.cmake b/default_build_settings.cmake index 69a69dc1860..07a70c38d71 100644 --- a/default_build_settings.cmake +++ b/default_build_settings.cmake @@ -96,6 +96,11 @@ function(setup_vespa_default_build_settings_ubuntu_20_04) set(DEFAULT_VESPA_LLVM_VERSION "10" PARENT_SCOPE) endfunction() +function(setup_vespa_default_build_settings_debian_10) + message("-- Setting up default build settings for debian 10") + set(DEFAULT_VESPA_LLVM_VERSION "7" PARENT_SCOPE) +endfunction() + function(vespa_use_default_vespa_unprivileged) if(NOT DEFINED VESPA_UNPRIVILEGED) message("-- Setting VESPA_UNPRIVILEGED to yes") @@ -185,6 +190,8 @@ function(vespa_use_default_build_settings) setup_vespa_default_build_settings_ubuntu_19_10() elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "ubuntu 20.04") setup_vespa_default_build_settings_ubuntu_20_04() + elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "debian 10") + setup_vespa_default_build_settings_debian_10() else() message(FATAL_ERROR "-- Unkonwn vespa build platform ${VESPA_OS_DISTRO_COMBINED}") endif() diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index f536def28a0..a711b29f7a4 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -14,9 +14,11 @@ #include #include #include +#ifndef XXH_NO_INLINE_ALL #ifndef XXH_INLINE_ALL # define XXH_INLINE_ALL // Let XXH64 be inlined for fixed hash size (bucket ID) #endif +#endif #include #include diff --git a/vespalib/src/vespa/vespalib/testkit/test_master.hpp b/vespalib/src/vespa/vespalib/testkit/test_master.hpp index fc163c8d14e..8a5f7eb337b 100644 --- a/vespalib/src/vespa/vespalib/testkit/test_master.hpp +++ b/vespalib/src/vespa/vespalib/testkit/test_master.hpp @@ -4,6 +4,15 @@ namespace vespalib { +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 9 +// cf. https://cplusplus.github.io/LWG/issue2221 +template +std::basic_ostream& operator<<(std::basic_ostream& os, nullptr_t) +{ + return os << (void*) nullptr; +} +#endif + template bool TestMaster::compare(const char *file, uint32_t line, -- cgit v1.2.3