Skip to content

Commit 5db192d

Browse files
author
Steinar H. Gunderson
committed
Revert "Bug #25835560: SET DEFAULT SYMBOL VISIBILITY TO HIDDEN"
This reverts commit 7925d81b8a2b1dadad0d02729d4d00eb7652438e. Change-Id: Ifde69156e6f16d07109ef3e4cfd9ac728a33d3ca
1 parent 4feea84 commit 5db192d

File tree

226 files changed

+1484
-1641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+1484
-1641
lines changed

cmake/build_configurations/compiler_options.cmake

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IF(UNIX)
3030

3131
# Default GCC flags
3232
IF(CMAKE_COMPILER_IS_GNUCC)
33-
SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fvisibility=hidden")
33+
SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer")
3434
# Disable inline optimizations for valgrind testing to avoid false positives
3535
IF(WITH_VALGRIND)
3636
SET(COMMON_C_FLAGS "-fno-inline ${COMMON_C_FLAGS}")
@@ -46,7 +46,7 @@ IF(UNIX)
4646
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
4747
ENDIF()
4848
IF(CMAKE_COMPILER_IS_GNUCXX)
49-
SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -std=c++11 -fvisibility=hidden")
49+
SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -std=c++11")
5050
# Disable inline optimizations for valgrind testing to avoid false positives
5151
IF(WITH_VALGRIND)
5252
SET(COMMON_CXX_FLAGS "-fno-inline ${COMMON_CXX_FLAGS}")
@@ -66,15 +66,15 @@ IF(UNIX)
6666

6767
# Default Clang flags
6868
IF(CMAKE_C_COMPILER_ID MATCHES "Clang")
69-
SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fvisibility=hidden")
69+
SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer")
7070
IF(NOT DISABLE_SHARED)
7171
SET(COMMON_C_FLAGS "-fPIC ${COMMON_C_FLAGS}")
7272
ENDIF()
7373
SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
7474
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
7575
ENDIF()
7676
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
77-
SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -std=c++11 -fvisibility=hidden")
77+
SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -std=c++11")
7878
IF(NOT DISABLE_SHARED)
7979
SET(COMMON_CXX_FLAGS "-fPIC ${COMMON_CXX_FLAGS}")
8080
ENDIF()
@@ -109,7 +109,6 @@ IF(UNIX)
109109
SET(SUNPRO_FLAGS "-xdebuginfo=no%decl")
110110
SET(SUNPRO_FLAGS "${SUNPRO_FLAGS} -xbuiltin=%all")
111111
SET(SUNPRO_FLAGS "${SUNPRO_FLAGS} -xlibmil")
112-
SET(SUNPRO_FLAGS "${SUNPRO_FLAGS} -xldscope=symbolic")
113112
IF(NOT DISABLE_SHARED)
114113
SET(SUNPRO_FLAGS "${SUNPRO_FLAGS} -KPIC")
115114
ENDIF()

cmake/os/Windows.cmake

-8
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,6 @@ IF(MSVC)
129129
#TODO: update the code and remove the disabled warnings
130130
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
131131
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099")
132-
133-
# These are warnings about exported entry points not being complete,
134-
# e.g. exporting "Baz *Foo::bar();" without Baz being exported.
135-
# As most of these are for legacy export (MYSQL_PLUGIN_LEGACY_API),
136-
# we deliberately keep the exported interface minimal, and thus,
137-
# we suppress these warnings.
138-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4251 /wd4275")
139-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275")
140132
ENDIF()
141133

142134
# Always link with socket library

cmake/plugin.cmake

+9-17
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,8 @@ MACRO(MYSQL_ADD_PLUGIN)
120120
# Build either static library or module
121121
IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY)
122122
ADD_CONVENIENCE_LIBRARY(${target} STATIC ${SOURCES})
123-
124-
# Plugins are taken to be part of the server (so MYSQL_SERVER).
125-
# However, also make sure that when building the plugin statically, we
126-
# don't try to export any symbols pulled in from header files.
127-
# This would be harmless in the server, but some of the statically linked
128-
# plugins (like the performance schema plugin) are also linked into unit
129-
# tests, which don't necessarily link in all the dependencies of such
130-
# symbols.
131123
SET_TARGET_PROPERTIES(${target}
132-
PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER;MYSQL_NO_PLUGIN_EXPORT")
124+
PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER")
133125
SET_TARGET_PROPERTIES(${target}
134126
PROPERTIES COMPILE_FLAGS ${SSL_DEFINES})
135127

@@ -140,9 +132,9 @@ MACRO(MYSQL_ADD_PLUGIN)
140132
OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
141133
ENDIF()
142134

143-
# Link the plugin into mysqld.
144-
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
145-
${target} CACHE INTERNAL "" FORCE)
135+
# Update mysqld dependencies
136+
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
137+
${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
146138

147139
IF(ARG_MANDATORY)
148140
SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server"
@@ -186,19 +178,19 @@ MACRO(MYSQL_ADD_PLUGIN)
186178
# unresolved symbols. Others are less strict and allow unresolved symbols
187179
# in shared libraries. On Linux for example, CMake does not even add
188180
# executable to the linker command line (it would result into link error).
189-
# Use MYSQL_PLUGIN_API for symbols to be exported/imported.
181+
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
182+
# an additional dependency.
183+
# Use MYSQL_PLUGIN_IMPORT for static data symbols to be exported.
190184
IF(WIN32 OR APPLE)
191185
TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
192-
ELSE()
193-
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
194186
ENDIF()
195187
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
196188

197-
IF(NOT ARG_MODULE_ONLY)
189+
IF(NOT ARG_MODULE_ONLY)
198190
# set cached variable, e.g with checkbox in GUI
199191
SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server"
200192
FORCE)
201-
ENDIF()
193+
ENDIF()
202194
SET_TARGET_PROPERTIES(${target} PROPERTIES
203195
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
204196

components/mysql_server/dynamic_loader_path_filter.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
2828

2929
typedef std::string my_string;
3030

31-
extern "C" MYSQL_PLUGIN_API CHARSET_INFO *system_charset_info;
31+
extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
3232
bool check_string_char_length(const LEX_CSTRING &str, const char *err_msg,
3333
size_t max_char_length, const CHARSET_INFO *cs,
3434
bool no_error);

configure.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ ENDIF()
519519

520520
SET(CMAKE_EXTRA_INCLUDE_FILES)
521521

522+
# Support for tagging symbols with __attribute__((visibility("hidden")))
523+
MY_CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
524+
522525
#
523526
# Code tests
524527
#

dbug/dbug.c

+22-25
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
#include "my_inttypes.h"
9797
#include "my_io.h"
9898
#include "my_macros.h"
99-
#include "my_sharedlib.h"
10099
#include "my_sys.h"
101100
#include "my_thread_local.h"
102101
#include "mysql/service_my_snprintf.h"
@@ -403,7 +402,7 @@ static void unlock_stack(CODE_STATE *cs)
403402
*
404403
*/
405404

406-
void MYSQL_PLUGIN_API _db_process_(const char *name)
405+
void _db_process_(const char *name)
407406
{
408407
CODE_STATE *cs;
409408

@@ -841,7 +840,7 @@ static void FixTraceFlags(uint old_fflags, CODE_STATE *cs)
841840
*
842841
*/
843842

844-
MYSQL_PLUGIN_API void _db_set_(const char *control)
843+
void _db_set_(const char *control)
845844
{
846845
CODE_STATE *cs;
847846
uint old_fflags;
@@ -880,7 +879,7 @@ MYSQL_PLUGIN_API void _db_set_(const char *control)
880879
*
881880
*/
882881

883-
MYSQL_PLUGIN_API void _db_push_(const char *control)
882+
void _db_push_(const char *control)
884883
{
885884
CODE_STATE *cs;
886885
uint old_fflags;
@@ -905,7 +904,7 @@ MYSQL_PLUGIN_API void _db_push_(const char *control)
905904
Returns TRUE if session-local settings have been set.
906905
*/
907906

908-
MYSQL_PLUGIN_API int _db_is_pushed_()
907+
int _db_is_pushed_()
909908
{
910909
CODE_STATE *cs= NULL;
911910
get_code_state_or_return FALSE;
@@ -927,7 +926,7 @@ MYSQL_PLUGIN_API int _db_is_pushed_()
927926
*
928927
*/
929928

930-
MYSQL_PLUGIN_API void _db_set_init_(const char *control)
929+
void _db_set_init_(const char *control)
931930
{
932931
CODE_STATE tmp_cs;
933932
memset(&tmp_cs, 0, sizeof(tmp_cs));
@@ -953,7 +952,7 @@ MYSQL_PLUGIN_API void _db_set_init_(const char *control)
953952
*
954953
*/
955954

956-
MYSQL_PLUGIN_API void _db_pop_()
955+
void _db_pop_()
957956
{
958957
struct settings *discard;
959958
uint old_fflags;
@@ -1069,7 +1068,7 @@ MYSQL_PLUGIN_API void _db_pop_()
10691068
} \
10701069
} while (0)
10711070

1072-
MYSQL_PLUGIN_API int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
1071+
int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
10731072
{
10741073
char *start=buf, *end=buf+len-4;
10751074

@@ -1173,9 +1172,8 @@ int _db_explain_init_(char *buf, size_t len)
11731172
*
11741173
*/
11751174

1176-
MYSQL_PLUGIN_API void _db_enter_(
1177-
const char *_func_, const char *_file_,
1178-
uint _line_, struct _db_stack_frame_ *_stack_frame_)
1175+
void _db_enter_(const char *_func_, const char *_file_,
1176+
uint _line_, struct _db_stack_frame_ *_stack_frame_)
11791177
{
11801178
int save_errno;
11811179
CODE_STATE *cs;
@@ -1244,8 +1242,7 @@ MYSQL_PLUGIN_API void _db_enter_(
12441242
*
12451243
*/
12461244

1247-
MYSQL_PLUGIN_API void _db_return_(
1248-
uint _line_, struct _db_stack_frame_ *_stack_frame_)
1245+
void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
12491246
{
12501247
int save_errno=errno;
12511248
uint _slevel_= _stack_frame_->level & ~TRACE_ON;
@@ -1308,7 +1305,7 @@ MYSQL_PLUGIN_API void _db_return_(
13081305
*
13091306
*/
13101307

1311-
MYSQL_PLUGIN_API void _db_pargs_(uint _line_, const char *keyword)
1308+
void _db_pargs_(uint _line_, const char *keyword)
13121309
{
13131310
CODE_STATE *cs;
13141311
get_code_state_or_return;
@@ -1334,7 +1331,7 @@ MYSQL_PLUGIN_API void _db_pargs_(uint _line_, const char *keyword)
13341331
* function evaluates to 1.
13351332
*/
13361333

1337-
MYSQL_PLUGIN_API int _db_enabled_()
1334+
int _db_enabled_()
13381335
{
13391336
CODE_STATE *cs;
13401337

@@ -1373,7 +1370,7 @@ MYSQL_PLUGIN_API int _db_enabled_()
13731370

13741371
#include <stdarg.h>
13751372

1376-
MYSQL_PLUGIN_API void _db_doprnt_(const char *format,...)
1373+
void _db_doprnt_(const char *format,...)
13771374
{
13781375
va_list args;
13791376
CODE_STATE *cs;
@@ -1436,7 +1433,7 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args)
14361433
* Is used to examine corrupted memory or arrays.
14371434
*/
14381435

1439-
MYSQL_PLUGIN_API void _db_dump_(uint _line_, const char *keyword,
1436+
void _db_dump_(uint _line_, const char *keyword,
14401437
const unsigned char *memory, size_t length)
14411438
{
14421439
int pos;
@@ -1767,7 +1764,7 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state)
17671764
* To be called at the very end of the program.
17681765
*
17691766
*/
1770-
MYSQL_PLUGIN_API void _db_end_()
1767+
void _db_end_()
17711768
{
17721769
struct settings *discard;
17731770
static struct settings tmp;
@@ -1868,7 +1865,7 @@ FILE *_db_fp_(void)
18681865
*
18691866
*/
18701867

1871-
MYSQL_PLUGIN_API int _db_keyword_(CODE_STATE *cs, const char *keyword, int strict)
1868+
int _db_keyword_(CODE_STATE *cs, const char *keyword, int strict)
18721869
{
18731870
bool result;
18741871
get_code_state_if_not_set_or_return FALSE;
@@ -2286,7 +2283,7 @@ static void DbugFlush(CODE_STATE *cs)
22862283

22872284
/* For debugging */
22882285

2289-
MYSQL_PLUGIN_API void _db_flush_()
2286+
void _db_flush_()
22902287
{
22912288
CODE_STATE *cs= NULL;
22922289
get_code_state_or_return;
@@ -2300,7 +2297,7 @@ MYSQL_PLUGIN_API void _db_flush_()
23002297
extern void __gcov_flush();
23012298
#endif
23022299

2303-
MYSQL_PLUGIN_API void _db_flush_gcov_()
2300+
void _db_flush_gcov_()
23042301
{
23052302
#ifdef HAVE_GCOV
23062303
// Gcov will assert() if we try to flush in parallel.
@@ -2310,7 +2307,7 @@ MYSQL_PLUGIN_API void _db_flush_gcov_()
23102307
#endif
23112308
}
23122309

2313-
MYSQL_PLUGIN_API void _db_suicide_()
2310+
void _db_suicide_()
23142311
{
23152312
int retval;
23162313
sigset_t new_mask;
@@ -2335,23 +2332,23 @@ MYSQL_PLUGIN_API void _db_suicide_()
23352332
#endif /* ! _WIN32 */
23362333

23372334

2338-
MYSQL_PLUGIN_API void _db_lock_file_()
2335+
void _db_lock_file_()
23392336
{
23402337
CODE_STATE *cs;
23412338
get_code_state_or_return;
23422339
native_mutex_lock(&THR_LOCK_dbug);
23432340
cs->locked=1;
23442341
}
23452342

2346-
MYSQL_PLUGIN_API void _db_unlock_file_()
2343+
void _db_unlock_file_()
23472344
{
23482345
CODE_STATE *cs;
23492346
get_code_state_or_return;
23502347
cs->locked=0;
23512348
native_mutex_unlock(&THR_LOCK_dbug);
23522349
}
23532350

2354-
MYSQL_PLUGIN_API const char* _db_get_func_(void)
2351+
const char* _db_get_func_(void)
23552352
{
23562353
CODE_STATE *cs;
23572354
get_code_state_or_return NULL;

extra/regex/my_regex.h

+5-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/* ========= begin header generated by ./mkh ========= */
55

66
#include "m_ctype.h"
7-
#include "my_sharedlib.h"
87

98
#ifdef __cplusplus
109
extern "C" {
@@ -32,8 +31,8 @@ typedef struct {
3231

3332
/* === regcomp.c === */
3433
typedef int (*my_regex_stack_check_t)(int);
35-
extern MYSQL_PLUGIN_LEGACY_API int my_regcomp(
36-
my_regex_t *, const char *, int, const CHARSET_INFO *charset);
34+
extern int my_regcomp(my_regex_t *, const char *, int,
35+
const CHARSET_INFO *charset);
3736
#define MY_REG_BASIC 0000
3837
#define MY_REG_EXTENDED 0001
3938
#define MY_REG_ICASE 0002
@@ -67,8 +66,7 @@ extern size_t my_regerror(int, const my_regex_t *, char *, size_t);
6766

6867

6968
/* === regexec.c === */
70-
extern MYSQL_PLUGIN_LEGACY_API int my_regexec(
71-
const my_regex_t *, const char *, size_t, my_regmatch_t [], int);
69+
extern int my_regexec(const my_regex_t *, const char *, size_t, my_regmatch_t [], int);
7270
#define MY_REG_NOTBOL 00001
7371
#define MY_REG_NOTEOL 00002
7472
#define MY_REG_STARTEND 00004
@@ -78,14 +76,14 @@ extern MYSQL_PLUGIN_LEGACY_API int my_regexec(
7876

7977

8078
/* === regfree.c === */
81-
extern MYSQL_PLUGIN_LEGACY_API void my_regfree(my_regex_t *);
79+
extern void my_regfree(my_regex_t *);
8280

8381
/* === reginit.c === */
8482

8583
/* Should be called for multithread progs */
8684
extern void my_regex_init(const CHARSET_INFO *cs,
8785
my_regex_stack_check_t func);
88-
extern MYSQL_PLUGIN_LEGACY_API void my_regex_end(void); /* If one wants a clean end */
86+
extern void my_regex_end(void); /* If one wants a clean end */
8987

9088
#ifdef __cplusplus
9189
}

extra/regex/regcomp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int never = 0; /* for use in asserts; shuts lint up */
112112
= #define MY_REG_PEND 0040
113113
= #define MY_REG_DUMP 0200
114114
*/
115-
MYSQL_PLUGIN_LEGACY_API int /* 0 success, otherwise MY_REG_something */
115+
int /* 0 success, otherwise MY_REG_something */
116116
my_regcomp(preg, pattern, cflags, charset)
117117
my_regex_t *preg;
118118
const char *pattern;

extra/regex/regexec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
139139
@return 0 success, MY_REG_NOMATCH failure
140140
*/
141-
MYSQL_PLUGIN_LEGACY_API int
141+
int
142142
my_regexec(preg, str, nmatch, pmatch, eflags)
143143
const my_regex_t *preg;
144144
const char *str;

0 commit comments

Comments
 (0)