← Back to team overview

maria-developers team mailing list archive

Re: 21265d5: MDEV-9943 - TokuDB fails to compile with gcc 5.2.1

 

Hi Sergei,

I don't mind, but it needs to be tested. It have to wait till tomorrow.

Regards,
Sergey

On Tue, Apr 19, 2016 at 06:30:43PM +0200, Sergei Golubchik wrote:
> Hi, Sergey!
> 
> On Apr 19, Sergey Vojtovich wrote:
> > revision-id: 21265d58c1ea65f5c21a56cf669321f39066d7b5 (mariadb-5.5.48-19-g21265d5)
> > parent(s): 6c0e231c0282b43d6a46a4983f5971e960d3b8ca
> > committer: Sergey Vojtovich
> > timestamp: 2016-04-19 16:16:13 +0400
> > message:
> > 
> > MDEV-9943 - TokuDB fails to compile with gcc 5.2.1
> > 
> > For some reason check_cxx_compiler_flag() passes result variable name down to
> > compiler:
> > https://github.com/Kitware/CMake/blob/master/Modules/CheckCXXSourceCompiles.cmake#L57
> > 
> > But compiler doesn't permit dashes in macro name, like in
> > -DHAVE_CXX_-fimplicit-templates.
> > 
> > Workarounded by renaming HAVE_CXX_-fimplicit-templates to
> > HAVE_CXX_IMPLICIT_TEMPLAES.
> > 
> > diff --git a/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake b/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake
> > index 99629e4..4ae7b63 100644
> > --- a/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake
> > +++ b/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake
> > @@ -103,8 +103,8 @@ set_cflags_if_supported(
> >  
> >  if (CMAKE_CXX_FLAGS MATCHES -fno-implicit-templates)
> >    # must append this because mysql sets -fno-implicit-templates and we need to override it
> > -  check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
> > -  if (HAVE_CXX_-fimplicit-templates)
> > +  check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_IMPLICIT_TEMPLATES)
> > +  if (HAVE_CXX_IMPLICIT_TEMPLATES)
> >      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
> >    endif ()
> >  endif()
> 
> I'd rather fix other similar places too. If you agree, ok to push with
> the patch below.
> 
> --- a/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake
> +++ b/storage/tokudb/ft-index/cmake_modules/TokuSetupCompiler.cmake
> @@ -61,12 +61,13 @@ endmacro(set_cflags_if_supported_named)
>  ## adds a compiler flag if the compiler supports it
>  macro(set_cflags_if_supported)
>    foreach(flag ${ARGN})
> -    check_c_compiler_flag(${flag} HAVE_C_${flag})
> -    if (HAVE_C_${flag})
> +    STRING(REGEX REPLACE "[-,= ]" "_" res ${flag})
> +    check_c_compiler_flag(${flag} HAVE_C_${res})
> +    if (HAVE_C_${res})
>        set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
>      endif ()
> -    check_cxx_compiler_flag(${flag} HAVE_CXX_${flag})
> -    if (HAVE_CXX_${flag})
> +    check_cxx_compiler_flag(${flag} HAVE_CXX_${res})
> +    if (HAVE_CXX_${res})
>        set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
>      endif ()
>    endforeach(flag)
> @@ -75,8 +76,9 @@ endmacro(set_cflags_if_supported)
>  ## adds a linker flag if the compiler supports it
>  macro(set_ldflags_if_supported)
>    foreach(flag ${ARGN})
> -    check_cxx_compiler_flag(${flag} HAVE_${flag})
> -    if (HAVE_${flag})
> +    STRING(REGEX REPLACE "[-,= ]" "_" res ${flag})
> +    check_cxx_compiler_flag(${flag} HAVE_${res})
> +    if (HAVE_${res})
>        set(CMAKE_EXE_LINKER_FLAGS "${flag} ${CMAKE_EXE_LINKER_FLAGS}")
>        set(CMAKE_SHARED_LINKER_FLAGS "${flag} ${CMAKE_SHARED_LINKER_FLAGS}")
>      endif ()
> 
> Regards,
> Sergei
> Chief Architect MariaDB
> and security@xxxxxxxxxxx


References