Commit 24e7faa5 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Various fixes for Solaris compiler.

Also, restrict symbol visibility in statically
built plugins, to minimize the chance for symbol 
name clashes with dynamic plugins.
parent 15f20663
...@@ -305,16 +305,27 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result) ...@@ -305,16 +305,27 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result)
ENDFUNCTION() ENDFUNCTION()
MACRO(RESTRICT_SYMBOL_EXPORTS target) MACRO(RESTRICT_SYMBOL_EXPORTS target)
SET(VISIBILITY_HIDDEN_FLAG)
IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX) IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN) CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN) IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
ENDIF()
IF(VISIBILITY_HIDDEN_FLAG)
GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS) GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
IF(NOT COMPILE_FLAGS) IF(NOT COMPILE_FLAGS)
# Avoid COMPILE_FLAGS-NOTFOUND # Avoid COMPILE_FLAGS-NOTFOUND
SET(COMPILE_FLAGS) SET(COMPILE_FLAGS)
ENDIF() ENDIF()
SET_TARGET_PROPERTIES(${target} PROPERTIES SET_TARGET_PROPERTIES(${target} PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden") COMPILE_FLAGS "${COMPILE_FLAGS} ${VISIBILITY_HIDDEN_FLAG}")
ENDIF()
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
...@@ -93,3 +93,8 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SIZEOF_VOID_P EQUAL 4 ...@@ -93,3 +93,8 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SIZEOF_VOID_P EQUAL 4
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
# Unnamed structs and unions
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -features=extensions")
ENDIF()
...@@ -136,6 +136,7 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -136,6 +136,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER") SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER")
DTRACE_INSTRUMENT(${target}) DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
RESTRICT_SYMBOL_EXPORTS(${target})
IF(WITH_EMBEDDED_SERVER) IF(WITH_EMBEDDED_SERVER)
# Embedded library should contain PIC code and be linkable # Embedded library should contain PIC code and be linkable
# to shared libraries (on systems that need PIC) # to shared libraries (on systems that need PIC)
......
...@@ -279,7 +279,7 @@ public: ...@@ -279,7 +279,7 @@ public:
}; };
void advance_sj_state(JOIN *join, const table_map remaining_tables, uint idx, extern void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
double *current_record_count, double *current_read_time, double *current_record_count, double *current_read_time,
POSITION *loose_scan_pos); POSITION *loose_scan_pos);
void restore_prev_sj_state(const table_map remaining_tables, void restore_prev_sj_state(const table_map remaining_tables,
......
...@@ -550,7 +550,7 @@ public: ...@@ -550,7 +550,7 @@ public:
BNL_JOIN_ALG, /* Block Nested Loop Join algorithm */ BNL_JOIN_ALG, /* Block Nested Loop Join algorithm */
BNLH_JOIN_ALG, /* Block Nested Loop Hash Join algorithm */ BNLH_JOIN_ALG, /* Block Nested Loop Hash Join algorithm */
BKA_JOIN_ALG, /* Batched Key Access Join algorithm */ BKA_JOIN_ALG, /* Batched Key Access Join algorithm */
BKAH_JOIN_ALG, /* Batched Key Access with Hash Table Join Algorithm */ BKAH_JOIN_ALG /* Batched Key Access with Hash Table Join Algorithm */
}; };
/* /*
......
...@@ -1688,7 +1688,7 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab, ...@@ -1688,7 +1688,7 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
double *outer_rec_count, double *reopt_cost); double *outer_rec_count, double *reopt_cost);
Item_equal *find_item_equal(COND_EQUAL *cond_equal, Field *field, Item_equal *find_item_equal(COND_EQUAL *cond_equal, Field *field,
bool *inherited_fl); bool *inherited_fl);
bool test_if_ref(COND *root_cond, extern bool test_if_ref(Item *,
Item_field *left_item,Item *right_item); Item_field *left_item,Item *right_item);
inline bool optimizer_flag(THD *thd, uint flag) inline bool optimizer_flag(THD *thd, uint flag)
......
...@@ -254,8 +254,10 @@ ENDIF() ...@@ -254,8 +254,10 @@ ENDIF()
# On solaris, reduce symbol visibility, so loader does not mix # On solaris, reduce symbol visibility, so loader does not mix
# the same symbols from builtin innodb and from shared one # the same symbols from builtin innodb and from shared one.
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCC) # Only required for old GCC (3.4.3) that does not support hidden visibility
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCC
AND NOT HAVE_VISIBILITY_HIDDEN)
SET(LINKER_SCRIPT "-Wl,-M${CMAKE_CURRENT_SOURCE_DIR}/plugin_exports") SET(LINKER_SCRIPT "-Wl,-M${CMAKE_CURRENT_SOURCE_DIR}/plugin_exports")
ELSE() ELSE()
SET(LINKER_SCRIPT) SET(LINKER_SCRIPT)
......
...@@ -57,7 +57,7 @@ Created 11/5/1995 Heikki Tuuri ...@@ -57,7 +57,7 @@ Created 11/5/1995 Heikki Tuuri
/* prototypes for new functions added to ha_innodb.cc */ /* prototypes for new functions added to ha_innodb.cc */
trx_t* innobase_get_trx(); trx_t* innobase_get_trx();
inline void _increment_page_get_statistics(buf_block_t* block, trx_t* trx) static inline void _increment_page_get_statistics(buf_block_t* block, trx_t* trx)
{ {
ulint block_hash; ulint block_hash;
ulint block_hash_byte; ulint block_hash_byte;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment