From d4f11d23ff28fb4c0192b354b20056a9daa36d58 Mon Sep 17 00:00:00 2001 From: rik prohaska Date: Wed, 8 Apr 2020 16:53:56 -0400 Subject: [PATCH 1/2] glibc 2.30 defines the gettid system call, which conflicts with the tokuft test version. rename tokuft test version to avoid conflict. --- portability/tests/test-xid.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portability/tests/test-xid.cc b/portability/tests/test-xid.cc index 9ee68906b..6143d3b58 100644 --- a/portability/tests/test-xid.cc +++ b/portability/tests/test-xid.cc @@ -54,7 +54,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // since we implement the same thing here as in toku_os_gettid, this test // is pretty pointless -static int gettid(void) { +static int test_gettid(void) { #if defined(__NR_gettid) return syscall(__NR_gettid); #elif defined(SYS_gettid) @@ -68,6 +68,6 @@ static int gettid(void) { int main(void) { assert(toku_os_getpid() == getpid()); - assert(toku_os_gettid() == gettid()); + assert(toku_os_gettid() == test_gettid()); return 0; } From afc4d07f44f11e082afbe85585466bc3bcfa68aa Mon Sep 17 00:00:00 2001 From: rik prohaska Date: Fri, 22 May 2020 17:57:54 -0400 Subject: [PATCH 2/2] Build with gcc-10.0.1 (unbuntu 20.04). When cmake is probing for language specific flag support by the compiler, the probe needs to turn warnings into errors. Performing C++ SOURCE FILE Test HAVE_STDCXX0X failed with the following output: Change Dir: /home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_7c189/fast && /usr/bin/make -f CMakeFiles/cmTC_7c189.dir/build.make CMakeFiles/cmTC_7c189.dir/build make[1]: Entering directory '/home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_7c189.dir/src.cxx.o /usr/bin/g++-10 -Wall -Werror -Wcast-align -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wno-missing-noreturn -Wbad-function-cast -Wextra -fno-omit-frame-pointer -Wpacked -Wno-error=nonnull-compare -fno-exceptions -fno-rtti -Wlogical-op -Wtrampolines -Wswitch -Winit-self -Wstrict-null-sentinel -Wno-missing-field-initializers -Wno-address-of-packed-member -fexceptions -DHAVE_STDCXX0X -std=c++0x -o CMakeFiles/cmTC_7c189.dir/src.cxx.o -c /home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp/src.cxx cc1plus: error: command-line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [-Werror] cc1plus: error: command-line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [-Werror] cc1plus: error: command-line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [-Werror] --- cmake_modules/TokuSetupCompiler.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_modules/TokuSetupCompiler.cmake b/cmake_modules/TokuSetupCompiler.cmake index 92897b88f..4a6100ffe 100644 --- a/cmake_modules/TokuSetupCompiler.cmake +++ b/cmake_modules/TokuSetupCompiler.cmake @@ -2,6 +2,10 @@ function(add_c_defines) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ARGN}) endfunction(add_c_defines) +## always want these +set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") + if (APPLE) add_c_defines(DARWIN=1 _DARWIN_C_SOURCE) endif () @@ -170,10 +174,6 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) prepend_cflags_if_supported(-Wcast-align) endif () -## always want these -set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") - # pick language dialect set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11)