From 6816e77cbfb64f58b952d8cd4fe20e69141729ee Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:18:48 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 31758c3..27e147b 100755 --- a/unix/configure +++ b/unix/configure @@ -7527,7 +7527,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d896d05..83c3fb1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1518,7 +1518,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2a1ef7e5c60cf8a23a9da2c301fd4044c9f0db0e Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:30:49 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 1899aa3..bbac11d 100755 --- a/unix/configure +++ b/unix/configure @@ -7579,7 +7579,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3db997a..d7d6a7b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1542,7 +1542,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2c3171b7932c069b7f8c7bbfdbdb199251e2399e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 9 Oct 2015 14:40:28 +0000 Subject: Make autoconf > 2.59 work warning-free --- win/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/Makefile.in b/win/Makefile.in index c0d8668..b3417e7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -22,6 +22,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ +datarootdir = @datarootdir@ mandir = @mandir@ # The following definition can be set to non-null for special systems like AFS -- cgit v0.12 From 7ac2d8cc226958fbe8a0c9014c2cadae69a31e06 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 10 Oct 2015 12:37:34 +0000 Subject: Fix minor msvc compiler warning in tclWinFile.c --- win/tclWinFile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 73a2183..41de4a8 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1479,8 +1479,7 @@ TclpGetUserHome( * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ - DWORD size = MAX_PATH; - int i; + DWORD i, size = MAX_PATH; getProfilesDirectoryProc(buf, &size); for (i = 0; i < size; ++i){ if (buf[i] == '\\') buf[i] = '/'; -- cgit v0.12 From de3fd77202d2f00e549b962c6b56a85f5d8d7042 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 12 Oct 2015 09:57:26 +0000 Subject: Various build fixes, when using Cygwin shell in combination with native MinGW compiler. Contributed by pooryorick. --- win/Makefile.in | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/win/Makefile.in b/win/Makefile.in index b3417e7..e9a28c4 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -102,10 +102,15 @@ COMPAT_DIR = @srcdir@/../compat # Converts a POSIX path to a Windows native path. CYGPATH = @CYGPATH@ -GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)' | sed 's!\\!/!g') -TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)' | sed 's!\\!/!g') -WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)' | sed 's!\\!/!g') -ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') +libdir_native = $(shell $(CYGPATH) '$(libdir)') +bindir_native = $(shell $(CYGPATH) '$(bindir)') +includedir_native = $(shell $(CYGPATH) '$(includedir)') +mandir_native = $(shell $(CYGPATH) '$(mandir)') +TCL_LIBRARY_NATIVE = $(shell $(CYGPATH) '$(TCL_LIBRARY)') +GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)') +TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') +WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)') +ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)') #GENERIC_DIR_NATIVE = $(GENERIC_DIR) #TOMMATH_DIR_NATIVE = $(TOMMATH_DIR) #WIN_DIR_NATIVE = $(WIN_DIR) @@ -114,7 +119,7 @@ ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') # Fully qualify library path so that `make test` # does not depend on the current directory. LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd) -LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)' | sed 's!\\!/!g') +LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ @@ -503,17 +508,17 @@ tclWinDde.${OBJEXT} : tclWinDde.c tclPkgConfig.${OBJEXT}: tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ - -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \ - -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \ - -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \ - -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \ + -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR_NATIVE)\" \ -DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \ \ - -DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \ - -DCFG_RUNTIME_BINDIR=\"$(bindir)\" \ - -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \ - -DCFG_RUNTIME_INCDIR=\"$(includedir)\" \ - -DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \ + -DCFG_RUNTIME_LIBDIR=\"$(libdir_native)\" \ + -DCFG_RUNTIME_BINDIR=\"$(bindir_native)\" \ + -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY_NATIVE)\" \ + -DCFG_RUNTIME_INCDIR=\"$(includedir_native)\" \ + -DCFG_RUNTIME_DOCDIR=\"$(mandir_native)\" \ -DBUILD_tcl \ @DEPARG@ $(CC_OBJNAME) -- cgit v0.12 From b26b272f52e27f26233144697e4526a6f156e4c0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 17 Oct 2015 07:21:19 +0000 Subject: Proposed fix for [ba44e415a0]: "Use of mutexLock causes problem with reactive event handling in AndroWish". This basically undoes the retry mechamism in Tcl_MutexLock, introduced in [9f8b7bea53]. Does this retry mechamism hurt more than it helps? Feedback requested. --- unix/tclUnixThrd.c | 51 +++++---------------------------------------------- win/tclWinThrd.c | 37 +++++-------------------------------- 2 files changed, 10 insertions(+), 78 deletions(-) diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ae81c5f..0e8070d 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -22,19 +22,6 @@ typedef struct ThreadSpecificData { static Tcl_ThreadDataKey dataKey; /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than zero and - * should be a suitable value for the given platform. - * - * TODO: This may need to be dynamically determined, based on the relative - * performance of the running process. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (25) -#endif - -/* * masterLock is used to serialize creation of mutexes, condition variables, * and thread local storage. This is the only place that can count on the * ability to statically initialize the mutex. @@ -58,13 +45,6 @@ static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t *allocLockPtr = &allocLock; /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static pthread_mutex_t mutexLock = PTHREAD_MUTEX_INITIALIZER; - -/* * These are for the critical sections inside this file. */ @@ -380,7 +360,6 @@ TclpMasterUnlock(void) pthread_mutex_unlock(&masterLock); #endif } - /* *---------------------------------------------------------------------- @@ -457,32 +436,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - pthread_mutex_lock(&mutexLock); - pmutexPtr = *((pthread_mutex_t **)mutexPtr); - if (pmutexPtr == NULL) { - pthread_mutex_unlock(&mutexLock); - goto retry; - } - if (pthread_mutex_trylock(pmutexPtr) == 0) { - pthread_mutex_unlock(&mutexLock); - return; - } - pthread_mutex_unlock(&mutexLock); - /* - * BUGBUG: All core and Thread package tests pass when usleep() - * is used; however, the Thread package tests hang at - * various places when Tcl_Sleep() is used, typically - * while running test "thread-17.8", "thread-17.9", or - * "thread-17.11a". Really, what we want here is just - * to yield to other threads for a while. - */ -#ifdef HAVE_USLEEP - usleep(TCL_MUTEX_LOCK_SLEEP_TIME * 1000); -#else - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); -#endif + + pmutexPtr = *((pthread_mutex_t **)mutexPtr); + if (pmutexPtr == NULL) { + goto retry; } + pthread_mutex_lock(pmutexPtr); } /* diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index ae7ce80..927e115 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -24,16 +24,6 @@ _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask #endif /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than or equal - * to zero and should be a suitable value for the given platform. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (0) -#endif - -/* * This is the master lock used to serialize access to other serialization * data structures. */ @@ -67,13 +57,6 @@ static int allocOnce = 0; #endif /* TCL_THREADS */ /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static CRITICAL_SECTION mutexLock; - -/* * The joinLock serializes Create- and ExitThread. This is necessary to * prevent a race where a new joinable thread exits before the creating thread * had the time to create the necessary data structures in the emulation @@ -386,7 +369,6 @@ TclpInitLock(void) */ init = 1; - InitializeCriticalSection(&mutexLock); InitializeCriticalSection(&joinLock); InitializeCriticalSection(&initLock); InitializeCriticalSection(&masterLock); @@ -534,7 +516,6 @@ void TclFinalizeLock(void) { MASTER_LOCK; - DeleteCriticalSection(&mutexLock); DeleteCriticalSection(&joinLock); /* @@ -605,20 +586,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - EnterCriticalSection(&mutexLock); - csPtr = *((CRITICAL_SECTION **)mutexPtr); - if (csPtr == NULL) { - LeaveCriticalSection(&mutexLock); - goto retry; - } - if (TryEnterCriticalSection(csPtr)) { - LeaveCriticalSection(&mutexLock); - return; - } - LeaveCriticalSection(&mutexLock); - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); + + csPtr = *((CRITICAL_SECTION **)mutexPtr); + if (csPtr == NULL) { + goto retry; } + EnterCriticalSection(csPtr); } /* -- cgit v0.12