summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/.cvsignore7
-rw-r--r--unix/Makefile.in5
-rw-r--r--unix/README5
-rwxr-xr-xunix/configure45
-rw-r--r--unix/configure.in8
-rw-r--r--unix/dltest/.cvsignore5
-rw-r--r--unix/ldAix2
-rw-r--r--unix/tcl.m449
-rw-r--r--unix/tclLoadDl.c20
-rw-r--r--unix/tclLoadDyld.c10
-rw-r--r--unix/tclUnixFile.c2
-rw-r--r--unix/tclUnixInit.c10
-rw-r--r--unix/tclUnixThrd.c2
-rw-r--r--unix/tclUnixTime.c28
14 files changed, 62 insertions, 136 deletions
diff --git a/unix/.cvsignore b/unix/.cvsignore
deleted file mode 100644
index ed12ed2..0000000
--- a/unix/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-autom4te.cache
-config.status
-Makefile
-*.exe
-*.sh
-*.dll
-*.a
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 6f193f1..782a89b 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -944,11 +944,8 @@ regerror.o: $(REGHDRS) $(GENERIC_DIR)/regerrs.h $(GENERIC_DIR)/regerror.c
tclAppInit.o: $(UNIX_DIR)/tclAppInit.c
$(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclAppInit.c
-# On Unix we want to use the normal malloc/free implementation, so we
-# specifically set the USE_TCLALLOC flag.
-
tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c
- $(CC) -c $(CC_SWITCHES) -DUSE_TCLALLOC=0 $(GENERIC_DIR)/tclAlloc.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAlloc.c
tclAsync.o: $(GENERIC_DIR)/tclAsync.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c
diff --git a/unix/README b/unix/README
index 96be762..87b151a 100644
--- a/unix/README
+++ b/unix/README
@@ -166,8 +166,3 @@ a test is failing consistently, please send us a bug report with as much
detail as you can manage. Please use the online database at
http://tcl.sourceforge.net/
-The Tcl test suite is very sensitive to proper implementation of ANSI C
-library procedures such as sprintf and sscanf. If the test suite generates
-errors, most likely they are due to non-conformance of your system's ANSI C
-library; such problems are unlikely to affect any real applications so it's
-probably safe to ignore them.
diff --git a/unix/configure b/unix/configure
index 8fbaebc..af64e51 100755
--- a/unix/configure
+++ b/unix/configure
@@ -6630,6 +6630,8 @@ fi
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
LDFLAGS_ORIG="$LDFLAGS"
# When ld needs options to work in 64-bit mode, put them in
# LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
@@ -6754,9 +6756,6 @@ fi
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
@@ -6831,7 +6830,6 @@ fi
BeOS*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -nostart'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -6913,7 +6911,6 @@ fi
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -6923,7 +6920,6 @@ fi
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -6934,7 +6930,6 @@ fi
CYGWIN_*)
SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -6954,7 +6949,6 @@ fi
Haiku*)
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
@@ -7126,7 +7120,6 @@ fi
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
- SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
@@ -7139,7 +7132,6 @@ fi
if test "$GCC" = yes; then
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
fi
@@ -7158,7 +7150,6 @@ fi
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
@@ -7272,7 +7263,6 @@ fi
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7286,7 +7276,6 @@ fi
IRIX-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7320,7 +7309,6 @@ fi
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7355,7 +7343,6 @@ fi
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -7462,7 +7449,6 @@ fi
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared'
@@ -7478,7 +7464,6 @@ fi
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE=-02
SHLIB_LD='${CC} -shared'
@@ -7516,7 +7501,6 @@ fi
NetBSD-1.*|FreeBSD-[1-2].*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7578,11 +7562,11 @@ fi
# Equivalent using configure option --disable-load
# Step 4 will set the necessary variables
DL_OBJS=""
+ SHLIB_LD_LIBS=""
;;
*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7661,7 +7645,6 @@ fi
# NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7695,7 +7678,6 @@ fi
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
TCL_SHLIB_LD_EXTRAS="-soname \$@"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -7949,7 +7931,6 @@ echo "${ECHO_T}$tcl_cv_ld_single_module" >&6
fi
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
@@ -8239,6 +8220,7 @@ fi
LD_SEARCH_FLAGS=""
;;
OS/390-*)
+ SHLIB_LD_LIBS=""
CFLAGS_OPTIMIZE="" # Optimizer is buggy
cat >>confdefs.h <<\_ACEOF
@@ -8289,7 +8271,6 @@ else
fi
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -8411,11 +8392,6 @@ _ACEOF
SHLIB_CFLAGS="-KPIC"
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -8704,11 +8680,6 @@ fi
fi
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -18734,11 +18705,13 @@ cat >>conftest.$ac_ext <<_ACEOF
int StackGrowsUp(int *parent) {
int here;
- return (&here < parent);
+ if (parent)
+ return (&here < parent);
+ else
+ return StackGrowsUp(&here);
}
int main (int argc, char *argv[]) {
- int foo;
- return StackGrowsUp(&foo);
+ return StackGrowsUp(0);
}
_ACEOF
diff --git a/unix/configure.in b/unix/configure.in
index 87731a1..473758d 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -705,11 +705,13 @@ AC_CACHE_CHECK([if the C stack grows upwards in memory], tcl_cv_stack_grows_up,
AC_TRY_RUN([
int StackGrowsUp(int *parent) {
int here;
- return (&here < parent);
+ if (parent)
+ return (&here < parent);
+ else
+ return StackGrowsUp(&here);
}
int main (int argc, char *argv[]) {
- int foo;
- return StackGrowsUp(&foo);
+ return StackGrowsUp(0);
}
], tcl_cv_stack_grows_up=yes, tcl_cv_stack_grows_up=no,
tcl_cv_stack_grows_up=unknown)])
diff --git a/unix/dltest/.cvsignore b/unix/dltest/.cvsignore
deleted file mode 100644
index 1c62620..0000000
--- a/unix/dltest/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.dylib
-*.bundle
-Makefile
-*.dll
-*.so
diff --git a/unix/ldAix b/unix/ldAix
index cf37d40..51b2995 100644
--- a/unix/ldAix
+++ b/unix/ldAix
@@ -1,5 +1,5 @@
#!/bin/sh
-#
+#
# ldAix ldCmd ldArg ldArg ...
#
# This shell script provides a wrapper for ld under AIX in order to
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 2f2f317..78eacd9 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -120,8 +120,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
- AC_MSG_WARN([Can't find Tcl configuration definitions])
- exit 0
+ AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
else
no_tcl=
TCL_BIN_DIR="${ac_cv_c_tclconfig}"
@@ -251,8 +250,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
if test x"${ac_cv_c_tkconfig}" = x ; then
TK_BIN_DIR="# no Tk configs found"
- AC_MSG_WARN([Can't find Tk configuration definitions])
- exit 0
+ AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
else
no_tk=
TK_BIN_DIR="${ac_cv_c_tkconfig}"
@@ -307,7 +305,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
elif test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
- # against Tcl.framework installed in an arbitary location.
+ # against Tcl.framework installed in an arbitrary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
@@ -390,7 +388,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
elif test "`uname -s`" = "Darwin"; then
# If Tk was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
- # against Tk.framework installed in an arbitary location.
+ # against Tk.framework installed in an arbitrary location.
case ${TK_DEFS} in
*TK_FRAMEWORK*)
if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
@@ -1120,6 +1118,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
LDFLAGS_ORIG="$LDFLAGS"
# When ld needs options to work in 64-bit mode, put them in
# LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
@@ -1157,9 +1157,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
@@ -1210,7 +1207,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
BeOS*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -nostart'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1225,7 +1221,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1235,7 +1230,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1246,7 +1240,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CYGWIN_*)
SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1266,7 +1259,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
Haiku*)
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
DL_OBJS="tclLoadDl.o"
@@ -1288,7 +1280,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_ok" = yes], [
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
- SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
@@ -1298,7 +1289,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
AS_IF([test "$GCC" = yes], [
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
])
@@ -1313,7 +1303,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
- SHLIB_LD_LIBS='${LIBS}'
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -1345,7 +1334,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1356,7 +1344,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
IRIX-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1382,7 +1369,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1405,7 +1391,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -1444,7 +1429,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared'
@@ -1457,7 +1441,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE=-02
SHLIB_LD='${CC} -shared'
@@ -1492,7 +1475,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
NetBSD-1.*|FreeBSD-[[1-2]].*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1523,11 +1505,11 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# Equivalent using configure option --disable-load
# Step 4 will set the necessary variables
DL_OBJS=""
+ SHLIB_LD_LIBS=""
;;
*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1572,7 +1554,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1600,7 +1581,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
TCL_SHLIB_LD_EXTRAS="-soname \$[@]"
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1675,7 +1655,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test $tcl_cv_ld_single_module = yes], [
SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
])
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
@@ -1769,6 +1748,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LD_SEARCH_FLAGS=""
;;
OS/390-*)
+ SHLIB_LD_LIBS=""
CFLAGS_OPTIMIZE="" # Optimizer is buggy
AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
[Should OS/390 do the right thing with sockets?])
@@ -1806,7 +1786,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
], [
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
])
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1900,11 +1879,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
[Do we really want to follow the standard? Yes we do!])
SHLIB_CFLAGS="-KPIC"
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -1994,11 +1968,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
use_sunmath=no
])
])
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
@@ -2398,7 +2367,7 @@ closedir(d);
#
# Results:
#
-# Sets the the following vars:
+# Sets the following vars:
# XINCLUDES
# XLIBSW
#
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index e9ff134..e38c280 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -19,17 +19,17 @@
/*
* In some systems, like SunOS 4.1.3, the RTLD_NOW flag isn't defined and this
- * argument to dlopen must always be 1. The RTLD_GLOBAL flag is needed on some
- * systems (e.g. SCO and UnixWare) but doesn't exist on others; if it doesn't
- * exist, set it to 0 so it has no effect.
+ * argument to dlopen must always be 1. The RTLD_LOCAL flag doesn't exist on
+ * some platforms; if it doesn't exist, set it to 0 so it has no effect.
+ * See [Bug #3216070]
*/
#ifndef RTLD_NOW
# define RTLD_NOW 1
#endif
-#ifndef RTLD_GLOBAL
-# define RTLD_GLOBAL 0
+#ifndef RTLD_LOCAL
+# define RTLD_LOCAL 0
#endif
/*
@@ -73,7 +73,10 @@ TclpDlopen(
*/
native = Tcl_FSGetNativePath(pathPtr);
- handle = dlopen(native, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
if (handle == NULL) {
/*
* Let the OS loader examine the binary search path for whatever
@@ -85,7 +88,10 @@ TclpDlopen(
char *fileName = Tcl_GetString(pathPtr);
native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- handle = dlopen(native, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ handle = dlopen(native, RTLD_NOW | RTLD_LOCAL);
Tcl_DStringFree(&ds);
}
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index 08d651c..0a36215 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -196,7 +196,10 @@ TclpDlopen(
if (tclMacOSXDarwinRelease >= 8)
#endif
{
- dlHandle = dlopen(nativePath, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ dlHandle = dlopen(nativePath, RTLD_NOW | RTLD_LOCAL);
if (!dlHandle) {
/*
* Let the OS loader examine the binary search path for whatever
@@ -206,7 +209,10 @@ TclpDlopen(
fileName = Tcl_GetString(pathPtr);
nativeFileName = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
- dlHandle = dlopen(nativeFileName, RTLD_NOW | RTLD_GLOBAL);
+ /*
+ * Use (RTLD_NOW|RTLD_LOCAL) always, see [Bug #3216070]
+ */
+ dlHandle = dlopen(nativeFileName, RTLD_NOW | RTLD_LOCAL);
}
if (dlHandle) {
TclLoadDbgMsg("dlopen() successful");
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 625b864..2639d59 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -82,7 +82,7 @@ TclpFindExecutable(
*/
while (1) {
- while (isspace(UCHAR(*p))) { /* INTL: BUG */
+ while (TclIsSpaceProc(*p)) {
p++;
}
name = p;
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index a798ccb..5111746 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -1092,9 +1092,19 @@ TclpGetCStackParams(
if (stackGrowsDown) {
tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr -
stackSize);
+ if (tsdPtr->stackBound > tsdPtr->outerVarPtr) {
+ /* Overflow, that should never happen, just set it to NULL.
+ * See [Bug #3166410] */
+ tsdPtr->stackBound = NULL;
+ }
} else {
tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr +
stackSize);
+ if (tsdPtr->stackBound < tsdPtr->outerVarPtr) {
+ /* Overflow, that should never happen, just set it to NULL.
+ * See [Bug #3166410] */
+ tsdPtr->stackBound = NULL;
+ }
}
}
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index bc80e00..fd2cd8f 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -724,7 +724,7 @@ TclpFinalizeCondition(
/*
*----------------------------------------------------------------------
*
- * TclpReaddir, TclpLocaltime, TclpGmtime, TclpInetNtoa --
+ * TclpReaddir, TclpInetNtoa --
*
* These procedures replace core C versions to be used in a threaded
* environment.
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index cf730a2..b98f2e1 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -62,7 +62,7 @@ Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime;
ClientData tclTimeClientData = NULL;
/*
- *-----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TclpGetSeconds --
*
@@ -75,7 +75,7 @@ ClientData tclTimeClientData = NULL;
* Side effects:
* None.
*
- *-----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
unsigned long
@@ -85,7 +85,7 @@ TclpGetSeconds(void)
}
/*
- *-----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TclpGetClicks --
*
@@ -100,7 +100,7 @@ TclpGetSeconds(void)
* Side effects:
* None.
*
- *-----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
unsigned long
@@ -431,17 +431,6 @@ TclpGmtime(
return &(tsdPtr->gmtime_buf);
}
-
-/*
- * Forwarder for obsolete item in Stubs
- */
-
-struct tm *
-TclpGmtime_unix(
- CONST time_t *timePtr)
-{
- return TclpGmtime(timePtr);
-}
/*
*----------------------------------------------------------------------
@@ -482,15 +471,6 @@ TclpLocaltime(
return &(tsdPtr->localtime_buf);
}
-/*
- * Forwarder for obsolete item in Stubs
- */
-struct tm*
-TclpLocaltime_unix(
- CONST time_t *timePtr)
-{
- return TclpLocaltime(timePtr);
-}
/*
*----------------------------------------------------------------------