Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17103

tokudb doesn't build with gcc8 due to warning

Details

    Description

      The CMake code of the tokudb build files sets and checks the following cflags:

      set_cflags_if_supported(
        -Wextra
        -Wbad-function-cast
        -Wno-missing-noreturn
        -Wstrict-prototypes
        -Wmissing-prototypes
        -Wmissing-declarations
        -Wpointer-arith
        #-Wshadow will fail with GCC-8
        ${OPTIONAL_CFLAGS}
        ## other flags to try:
        #-Wunsafe-loop-optimizations
        #-Wpointer-arith
        #-Wc++-compat
        #-Wc++11-compat
        #-Wwrite-strings
        #-Wzero-as-null-pointer-constant
        #-Wlogical-op
        #-Wvector-optimization-performance
        )
      

      Of those, the following produce a warning with gcc8 with cause CMake to abort the compilation. Therefore they have to be removed. This pertains all versions. It probably does not trigger with old CMake versions or older gcc versions that do not print those warnings.

      -Wbad-function-cast
      -Wstrict-prototypes
      -Wmissing-prototypes
      

      Warnings:
      cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++
      cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
      cc1plus: warning: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
      

      Attachments

        Issue Links

          Activity

            thermi Noel Kuntze created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Component/s Storage Engine - TokuDB [ 10134 ]
            elenst Elena Stepanova made changes -
            Fix Version/s 10.3 [ 22126 ]
            Affects Version/s 10.3 [ 22126 ]
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            thermi Noel Kuntze added a comment -

            More wrong cflags:
            -fimplicit-templates
            -std=c++11
            -Wstrict-null-sentinel
            -Wtautological-constant-out-of-range-compare
            -Waddress-of-array-temporary

            thermi Noel Kuntze added a comment - More wrong cflags: -fimplicit-templates -std=c++11 -Wstrict-null-sentinel -Wtautological-constant-out-of-range-compare -Waddress-of-array-temporary
            thermi Noel Kuntze added a comment -

            I wrote a rather large patch that seperates the handling of CFLAGS and CXXFLAGS to make sure invalid options are never passed to the corresponding compiler. The patch is in total around 600 lines.

            thermi Noel Kuntze added a comment - I wrote a rather large patch that seperates the handling of CFLAGS and CXXFLAGS to make sure invalid options are never passed to the corresponding compiler. The patch is in total around 600 lines.
            thermi Noel Kuntze added a comment - PR 1318 on GH ( https://github.com/MariaDB/server/pull/1318 )
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            anel Anel Husakovic made changes -
            Assignee Sergei Golubchik [ serg ] Anel Husakovic [ anel ]
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Vladislav Vaintroub [ wlad ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -

            I don't get it. First, I have gcc8 and everything compiles fine. Second, MY_CHECK_AND_SET_COMPILER_FLAG macro checks C and C++ separately and does not enable C++ flags for C or vice versa.

            Why one would need to separate options into C and C++ manually (which is error prone and, quite probably, depends on the compiler version) when currently cmake does all that automatically? Or at least is supposed to.

            serg Sergei Golubchik added a comment - I don't get it. First, I have gcc8 and everything compiles fine. Second, MY_CHECK_AND_SET_COMPILER_FLAG macro checks C and C++ separately and does not enable C++ flags for C or vice versa. Why one would need to separate options into C and C++ manually (which is error prone and, quite probably, depends on the compiler version) when currently cmake does all that automatically? Or at least is supposed to.
            wlad Vladislav Vaintroub added a comment - - edited

            maybe thermi could attach build log to the bug so we get an idea. Also CMakeFiles/CMakeOutput.log and CMakeFiles/CMakeError.log, in tar.gz or zip

            wlad Vladislav Vaintroub added a comment - - edited maybe thermi could attach build log to the bug so we get an idea. Also CMakeFiles/CMakeOutput.log and CMakeFiles/CMakeError.log, in tar.gz or zip
            thermi Noel Kuntze made changes -
            Attachment CMakeOutput.log [ 48176 ]
            thermi Noel Kuntze made changes -
            Attachment CMakeError.log [ 48177 ]
            thermi Noel Kuntze added a comment -

            I just figured out that the problem is only caused when LANG is not set to C.
            CMakeOutput.log and CMakeError.log are attached. CMakeOutput.log CMakeError.log

            thermi Noel Kuntze added a comment - I just figured out that the problem is only caused when LANG is not set to C. CMakeOutput.log and CMakeError.log are attached. CMakeOutput.log CMakeError.log

            SET(fail_patterns) in cmake/check_compiler_flag.cmake muß ein wenig Deutsch üben.

            serg, was meinst Du dazu?

            wlad Vladislav Vaintroub added a comment - SET(fail_patterns) in cmake/check_compiler_flag.cmake muß ein wenig Deutsch üben. serg , was meinst Du dazu?
            wlad Vladislav Vaintroub added a comment - - edited

            maybe

             
             set(ENV{LANG}  C)
            

            in MY_CHECK_C_COMPILER_FLAG,MY_CHECK_CXX_COMPILER_FLAG helps

            thermi, kannst Du ausprobieren ob es hilft?

            wlad Vladislav Vaintroub added a comment - - edited maybe set(ENV{LANG} C) in MY_CHECK_C_COMPILER_FLAG,MY_CHECK_CXX_COMPILER_FLAG helps thermi , kannst Du ausprobieren ob es hilft?
            thermi Noel Kuntze added a comment -

            Yes, that works and makes all the CMake tests pass.

            thermi Noel Kuntze added a comment - Yes, that works and makes all the CMake tests pass.

            Great, that explains it. Thanks!

            serg Sergei Golubchik added a comment - Great, that explains it. Thanks!
            wlad Vladislav Vaintroub made changes -
            issue.field.resolutiondate 2019-06-05 17:44:24.0 2019-06-05 17:44:24.149
            wlad Vladislav Vaintroub made changes -
            Fix Version/s 10.1.41 [ 23406 ]
            Fix Version/s 10.2.25 [ 23408 ]
            Fix Version/s 10.3.16 [ 23410 ]
            Fix Version/s 10.4.6 [ 23412 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 89168 ] MariaDB v4 [ 154876 ]

            People

              wlad Vladislav Vaintroub
              thermi Noel Kuntze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.