Module: wine
Branch: master
Commit: a35f9a13a80fa93c251e12402a73a38a89ec397f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a35f9a13a80fa93c251e12402…
Author: Michael Cronenworth <mike(a)cchtml.com>
Date: Wed Oct 21 20:54:38 2015 -0500
winegcc: Check for linker relocation support before relying on prelink.
Prelink was used to rewrite binares and set their text segment, but
modern linkers support setting the value at link time. Prelink is
being retired by upstream.
Signed-off-by: Michael Cronenworth <mike(a)cchtml.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
configure | 36 +++++++++++++++++++++++++++++++-----
configure.ac | 11 ++++++-----
tools/winegcc/winegcc.c | 13 ++++++++++---
3 files changed, 47 insertions(+), 13 deletions(-)
diff --git a/configure b/configure
index 6689b65..f21a860 100755
--- a/configure
+++ b/configure
@@ -8678,7 +8678,32 @@ if test "x$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" = xyes; then :
esac
fi
- # Extract the first word of "prelink", so it can be a program name with args.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000" >&5
+$as_echo_n "checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... " >&6; }
+if ${ac_cv_cflags__Wl__Ttext_segment_0x7bc00000+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x7bc00000"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int main(int argc, char **argv) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=yes
+else
+ ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&5
+$as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; }
+if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then :
+ :
+else
+ # Extract the first word of "prelink", so it can be a program name with args.
set dummy prelink; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
@@ -8719,10 +8744,11 @@ $as_echo "no" >&6; }
fi
- if test "x$PRELINK" = xfalse
- then
- as_fn_append wine_warnings "|prelink not found, base address of core dlls won't be set correctly."
- fi
+ if test "x$PRELINK" = xfalse
+ then
+ as_fn_append wine_warnings "|prelink not found and linker does not support relocation, base address of core dlls won't be set correctly."
+ fi
+fi
;;
esac
diff --git a/configure.ac b/configure.ac
index 030aa32..a209fa1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -988,11 +988,12 @@ wine-installed: main.o
*) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;;
esac
])
- AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH])
- if test "x$PRELINK" = xfalse
- then
- WINE_WARNING([prelink not found, base address of core dlls won't be set correctly.])
- fi
+ WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],[:],
+ [AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH])
+ if test "x$PRELINK" = xfalse
+ then
+ WINE_WARNING([prelink not found and linker does not support relocation, base address of core dlls won't be set correctly.])
+ fi])
;;
esac
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 3b2794e..ad139f5 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -776,6 +776,7 @@ static void build(struct options* opts)
char *output_file;
const char *spec_o_name;
const char *output_name, *spec_file, *lang;
+ const char *prelink = NULL;
int generate_app_loader = 1;
int fake_module = 0;
unsigned int j;
@@ -1134,6 +1135,13 @@ static void build(struct options* opts)
}
break;
default:
+ if (opts->image_base)
+ {
+ if (!try_link(opts->prefix, link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base)))
+ strarray_add(link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base));
+ else
+ prelink = PRELINK;
+ }
break;
}
@@ -1167,10 +1175,9 @@ static void build(struct options* opts)
spawn(opts->prefix, link_args, 0);
strarray_free (link_args);
- /* set the base address */
- if (opts->image_base && !opts->target)
+ /* set the base address with prelink if linker support is not present */
+ if (prelink && !opts->target)
{
- const char *prelink = PRELINK;
if (prelink[0] && strcmp(prelink,"false"))
{
strarray *prelink_args = strarray_alloc();
Module: wine
Branch: master
Commit: 998e5a0432b10fe88452baebba249efb1471d968
URL: http://source.winehq.org/git/wine.git/?a=commit;h=998e5a0432b10fe88452baebb…
Author: Andrew Eikum <aeikum(a)codeweavers.com>
Date: Wed Oct 21 10:01:22 2015 -0500
xaudio2: Don't render less than a period of audio.
Sometimes the ALSA driver will report a very small amount of frames
available after a period signal. There is a bug in OpenAL 1.15 which
will crash the application if alcRenderSamplesSOFT is called with less
than 4 frames. And anyway, we shouldn't incur all of this overhead
just to render a couple of frames. So, just skip the rendering step if
we have less than a period of space available in the driver.
Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/xaudio2_7/xaudio_dll.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 76b4c13..a4a9399 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -2723,7 +2723,11 @@ static void do_engine_tick(IXAudio2Impl *This)
}
nframes = This->period_frames * 3 - pad;
- TRACE("going to render %u frames\n", nframes);
+
+ TRACE("frames available: %u\n", nframes);
+
+ if(nframes < This->period_frames)
+ return;
if(!nframes)
return;