From 6b44b4a775fe29ecc7bcb7996e086e3bc09e5fd0 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 17 Sep 2013 11:52:28 +0300 Subject: Add native threading support on Windows. Now liblzma only uses "mythread" functions and types which are defined in mythread.h matching the desired threading method. Before Windows Vista, there is no direct equivalent to pthread condition variables. Since this package doesn't use pthread_cond_broadcast(), pre-Vista threading can still be kept quite simple. The pre-Vista code doesn't use anything that wasn't already available in Windows 95, so the binaries should run even on Windows 95 if someone happens to care. --- windows/README-Windows.txt | 2 +- windows/build.bash | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'windows') diff --git a/windows/README-Windows.txt b/windows/README-Windows.txt index 72c5a988..b6a85b83 100644 --- a/windows/README-Windows.txt +++ b/windows/README-Windows.txt @@ -29,7 +29,7 @@ Package contents There is one directory for each type of binaries: bin_i486 32-bit x86 (i486 and up), Windows 95 and later - bin_x86-64 64-bit x86-64, Windows XP and later + bin_x86-64 64-bit x86-64, Windows Vista and later Each of the above directories have the following files: diff --git a/windows/build.bash b/windows/build.bash index c5cf2b31..85e1f4fc 100644 --- a/windows/build.bash +++ b/windows/build.bash @@ -69,11 +69,10 @@ buildit() # Clean up if it was already configured. [ -f Makefile ] && make distclean - # Build the size-optimized binaries. Note that I don't want to - # provide size-optimized liblzma (shared nor static), because - # that isn't thread-safe now, and depending on bunch of things, - # maybe it will never be on Windows (pthreads-win32 helps but - # static liblzma might bit a bit tricky with it). + # Build the size-optimized binaries. Providing size-optimized liblzma + # could be considered but I don't know if it should only use -Os or + # should it also use --enable-small and if it should support + # threading. So I don't include a size-optimized liblzma for now. ./configure \ --prefix= \ --disable-nls \ @@ -90,16 +89,11 @@ buildit() make distclean - # Build the normal speed-optimized binaries. Note that while - # --disable-threads has been documented to make some things - # thread-unsafe, it's not actually true with this combination - # of configure flags in XZ Utils 5.0.x. Things can (and probably - # will) change after 5.0.x, and this script will be updated too. + # Build the normal speed-optimized binaries. ./configure \ --prefix= \ --disable-nls \ --disable-scripts \ - --disable-threads \ --build="$BUILD" \ CFLAGS="$CFLAGS -O2" make -C src/liblzma @@ -132,8 +126,9 @@ txtcp() } # FIXME: Make sure that we don't get i686 or i586 code from the runtime. -# Actually i586 would be fine, but i686 probably not if the idea is to -# support even Win95. +# Or if we do, update the strings here to match the generated code. +# i686 has cmov which can help like maybe 1 % in performance but things +# like SSE don't help, so i486 isn't horrible for performance. # # FIXME: Using i486 in the configure triplet may be wrong. if [ -d "$MINGW_W32_DIR" ]; then @@ -153,7 +148,7 @@ elif [ -d "$MINGW_DIR" ]; then fi if [ -d "$MINGW_W64_DIR" ]; then - # 64-bit x86, WinXP or later, using MinGW-w64 + # x86-64, Windows Vista or later, using MinGW-w64 PATH=$MINGW_W64_DIR/bin:$MINGW_W64_DIR/x86_64-w64-mingw32/bin:$PATH \ buildit \ pkg/bin_x86-64 \ -- cgit v1.2.3