Commit c928e917 authored by Reimar Döffinger's avatar Reimar Döffinger

Hack around gcc 4.6 breaking asm using call.

gcc 4.6 no longer decrements esp to account for local variables.
Thus using call will end up overwriting some local variable.
So add an extra one it can safely clobber.
This is a huge hack because it's basically pure chance it works,
no idea how this is supposed to be done.

Fixes trac ticket #397.
Signed-off-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
parent cadbe4ec
...@@ -1963,6 +1963,10 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, ...@@ -1963,6 +1963,10 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
#if defined(PIC) #if defined(PIC)
DECLARE_ALIGNED(8, uint64_t, ebxsave); DECLARE_ALIGNED(8, uint64_t, ebxsave);
#endif #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( __asm__ volatile(
#if defined(PIC) #if defined(PIC)
...@@ -2014,6 +2018,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, ...@@ -2014,6 +2018,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
#if defined(PIC) #if defined(PIC)
,"m" (ebxsave) ,"m" (ebxsave)
#endif #endif
,"m" (dummy)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
#if !defined(PIC) #if !defined(PIC)
,"%"REG_b ,"%"REG_b
...@@ -2035,6 +2040,10 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, ...@@ -2035,6 +2040,10 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
#if defined(PIC) #if defined(PIC)
DECLARE_ALIGNED(8, uint64_t, ebxsave); DECLARE_ALIGNED(8, uint64_t, ebxsave);
#endif #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( __asm__ volatile(
#if defined(PIC) #if defined(PIC)
...@@ -2074,6 +2083,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, ...@@ -2074,6 +2083,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
#if defined(PIC) #if defined(PIC)
,"m" (ebxsave) ,"m" (ebxsave)
#endif #endif
,"m" (dummy)
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D
#if !defined(PIC) #if !defined(PIC)
,"%"REG_b ,"%"REG_b
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment