summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-19 09:09:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-19 09:09:42 (GMT)
commit015b2e6c6503106478c6dd3affa36035264c7482 (patch)
tree44c5fc73d66aad479de3c5be76a4bd086063b1ea /unix/tcl.m4
parent9b104b7167d18325a28a7e1c3891ce8513249e23 (diff)
downloadtcl-015b2e6c6503106478c6dd3affa36035264c7482.zip
tcl-015b2e6c6503106478c6dd3affa36035264c7482.tar.gz
tcl-015b2e6c6503106478c6dd3affa36035264c7482.tar.bz2
Revert [5215b8740c] (Enh [2959069]), as it turns out that -fvisibility=hidden only affects definitions and not declarations.
Therefore explicitely declaring each MODULE_SCOPE function as __attribute__((__visibility__("hidden")) is much better. Suggested by Stuart Cassoff (Thanks!).
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m430
1 files changed, 6 insertions, 24 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 194cf90..e3a0d15 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1045,34 +1045,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler supports visibility "hidden"],
tcl_cv_cc_visibility_hidden, [
- AS_IF([test "$SHARED_BUILD" = 1], [
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror"
- AC_TRY_COMPILE(,[#if !defined(__GNUC__) || __GNUC__ < 4
-#error visibility hidden is not supported for this compiler
-#endif
- ], tcl_cv_cc_visibility_hidden=yes,
- tcl_cv_cc_visibility_hidden=no)
- CFLAGS=$hold_cflags
- ], [
- tcl_cv_cc_visibility_hidden=no
- ])
- ])
- AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
- CFLAGS="$CFLAGS -fvisibility=hidden"
- AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden])
- ], [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
AC_TRY_LINK([
extern __attribute__((__visibility__("hidden"))) void f(void);
void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
tcl_cv_cc_visibility_hidden=no)
- CFLAGS=$hold_cflags
- AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
- AC_DEFINE(MODULE_SCOPE,
- [extern __attribute__((__visibility__("hidden")))],
- [Compiler support for module scope symbols])
- AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
- ])
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
])
# Step 0.d: Disable -rpath support?
@@ -1638,7 +1621,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
[Compiler support for module scope symbols])
- tcl_cv_cc_visibility_hidden=yes
])
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""