summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <[email protected]>2011-09-21 19:10:58 +0200
committerMichael Niedermayer <[email protected]>2011-10-01 20:28:12 +0200
commit02affe2f0e8603533a80be9a1864cce0039e9c63 (patch)
tree842e658ffb25e0f7781855f3787c78db97b62584
parent6109974cd95cc75a72704029e5608beaaf6691d5 (diff)
Compile x86/swscale_template with -mno-red-zone.
Replaces a very hackish hack to fix the same issue (call instruction overwriting stack variables). Signed-off-by: Reimar Döffinger <[email protected]> (cherry picked from commit 424bcc46b5fb0d662e0fb9ad6319c5b9ef3d770f)
-rwxr-xr-xconfigure5
-rw-r--r--libswscale/Makefile2
-rw-r--r--libswscale/x86/swscale_template.c10
3 files changed, 7 insertions, 10 deletions
diff --git a/configure b/configure
index ef3697e3c4..b9badcafc6 100755
--- a/configure
+++ b/configure
@@ -3073,6 +3073,10 @@ else
fi
check_cflags -fno-math-errno
check_cflags -fno-signed-zeros
+check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
+int x;
+EOF
+
if enabled icc; then
# Just warnings, no remarks
@@ -3383,6 +3387,7 @@ SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
SAMPLES:=${samples:-\$(FATE_SAMPLES)}
+NOREDZONE_FLAGS=$noredzone_flags
EOF
get_version(){
diff --git a/libswscale/Makefile b/libswscale/Makefile
index 8bb06baae2..11017f6580 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -20,6 +20,8 @@ OBJS-$(HAVE_MMX) += x86/rgb2rgb.o \
x86/yuv2rgb_mmx.o
OBJS-$(HAVE_VIS) += sparc/yuv2rgb_vis.o
+$(SUBDIR)x86/swscale_mmx.o: CFLAGS += $(NOREDZONE_FLAGS)
+
TESTPROGS = colorspace swscale
DIRS = bfin mlib ppc sparc x86
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index e715270714..25399fadef 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -2240,10 +2240,6 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
#if defined(PIC)
DECLARE_ALIGNED(8, uint64_t, ebxsave);
#endif
- // HACK: gcc 4.6 no longer decrements esp,
- // use this to make it reserve space for the call
- // return address
- void *dummy;
__asm__ volatile(
#if defined(PIC)
@@ -2295,7 +2291,6 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
#if defined(PIC)
,"m" (ebxsave)
#endif
- ,"m" (dummy)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
#if !defined(PIC)
,"%"REG_b
@@ -2317,10 +2312,6 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
#if defined(PIC)
DECLARE_ALIGNED(8, uint64_t, ebxsave);
#endif
- // HACK: gcc 4.6 no longer decrements esp,
- // use this to make it reserve space for the call
- // return address
- void *dummy;
__asm__ volatile(
#if defined(PIC)
@@ -2360,7 +2351,6 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
#if defined(PIC)
,"m" (ebxsave)
#endif
- ,"m" (dummy)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
#if !defined(PIC)
,"%"REG_b