[FFmpeg-trac] #4474(build system:new): Some inline asm code does not compile on Haiku 32-bit with GCC 4
FFmpeg
trac at avcodec.org
Sun Apr 12 01:38:16 CEST 2015
#4474: Some inline asm code does not compile on Haiku 32-bit with GCC 4
-------------------------------------+-------------------------------------
Reporter: Timothy_Gu | Owner:
Type: defect | Status: new
Priority: normal | Component: build
Version: git-master | system
Keywords: haiku | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by Timothy_Gu):
But back to `vf_noise.c`. If I comment out
[https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/x86/vf_noise.c#L93-L96
this part] compilation succeeds. But if I even call any function
(including a noop function I created) with a variable as argument
compilation fails.
A reduced test case is below:
{{{
#!c
// gcc -m32 -fPIC -fomit-frame-pointer
void noop()
{}
void line_noise_avg_mmx(int src)
{
int var = 0;
__asm__ volatile(
"addl #2, %0"
:: "r" (src+1), "r" (src+2), "r" (src+3), "r" (src+4),
"r" (src+5), "g" (src+6)
: "%eax"
);
// Doesn't compile on Haiku.
// noop(var);
noop(); // this compiles
}
}}}
The odd thing is that GCC on Ubuntu (4.8.2) and on haiku (4.8.4) generates
the exact same assembly with `noop()`, but Haiku errors out on
`noop(var)`.
GCC on Ubuntu seems to add these two instructions right after the exit of
inline asm:
{{{
movl 28(%esp), %eax # 28(%esp) seems to be `var`
movl %eax , (%esp)
}}}
and Haiku GCC for some reason is simply too dumb to figure ''this'' out of
everything, out.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4474#comment:10>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list