tokudb CMakeLists.txt

Bug #1510081 reported by Sergei Golubchik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Tomislav Plavcic
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Tomislav Plavcic

Bug Description

Issues in tokudb CMakeLists.txt (found when merging in MariaDB):

1. in percona-server tokudb has:
---------------------------------------------
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
    NOT CMAKE_VERSION VERSION_LESS "2.8.9" AND
   NOT WITHOUT_TOKUDB AND NOT WITHOUT_TOKUDB_STORAGE_ENGINE)
CHECK_CXX_SOURCE_COMPILES(
"
struct a {int b; int c; };
struct a d = { .b=1, .c=2 };
int main() { return 0; }
" TOKUDB_OK)
ENDIF()

IF(NOT TOKUDB_OK)
  RETURN()
ENDIF()
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
---------------------------------------------

In MariaDB it is:
---------------------------------------------
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND
    NOT CMAKE_VERSION VERSION_LESS "2.8.9")
CHECK_CXX_SOURCE_COMPILES(
"
struct a {int b; int c; };
struct a d = { .b=1, .c=2 };
int main() { return 0; }
" TOKUDB_OK)
ENDIF()

IF(NOT TOKUDB_OK OR WITHOUT_TOKUDB OR WITHOUT_TOKUDB_STORAGE_ENGINE)
  RETURN()
ENDIF()
---------------------------------------------
This was changed (from the code that you have) in https://github.com/MariaDB/server/commit/00464252 with the comment:

  Fix "cmake . && cmake -DWITHOUT_TOKUDB=1" to disable tokudb

2. You have
---------------------------------------------
SET_PROPERTY(TARGET tokudb APPEND PROPERTY LINK_FLAGS_RELEASE "-flto -fuse-linker-plugin")
SET_PROPERTY(TARGET tokudb APPEND PROPERTY LINK_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin")
---------------------------------------------
This is generally a bad idea for plugins, because the "tokudb" target may not exist and cmake will fail.

Either do it as in MariaDB:
---------------------------------------------
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} -flto -fuse-linker-plugin")
---------------------------------------------
or check whether a target exists:
---------------------------------------------
IF(TARGET tokudb)
  SET_PROPERTY(TARGET tokudb APPEND PROPERTY LINK_FLAGS_RELEASE "-flto -fuse-linker-plugin")
  SET_PROPERTY(TARGET tokudb APPEND PROPERTY LINK_FLAGS_RELWITHDEBINFO "-flto -fuse-linker-plugin")
ENDIF()
---------------------------------------------

3. Unlike MariaDB, you don't add -Wno-vla to compiler flags. Is that not an issue anymore? Or you simpy never use any warning levels that imply -Wvla? TokuDB used to put -Werror on the compiler line so any warning was fatal.

Tags: tokudb
description: updated
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

I do recall fixing a few -Wvla warnings at Tokutek's request as they used to build with -Wvla -Werror.

Revision history for this message
Sergei Golubchik (sergii) wrote :

Without -Wno-vla the compilation still fails. For example:

toku_assert.cc: In function ‘void db_env_do_backtrace(FILE*)’:
toku_assert.cc:125:20error: variable length array ‘buff’ is used [-Werror=vla]

Revision history for this message
Tomislav Plavcic (tplavcic) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1662

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.