[FFmpeg-devel] Hacks on FATE
Måns Rullgård
mans
Thu Jun 18 12:29:38 CEST 2009
Michael Kostylev <michael.kostylev at gmail.com> writes:
> M?ns Rullg?rd wrote:
>
>> x86_32 DOS: --extra-cflags='-U__STRICT_ANSI__ -fno-builtin' --disable-network
>> What breaks without -fno-builtin?
>
> The c99 math function detection doesn't work correctly - false positives
> happen.
Can you please post the relevant parts of config.err without this flag?
>> Why is --disable-network needed?
>
> Network is enabled by default but DOS lacks its own network stack.
> There is an alternative: add --extra-cflags=-I/some/non-standard/path
> (e.g. /usr/i386-pc-msdosdjgpp/include/watt32) to make the network headers
> visible.
So we're missing a header check?
>> x86_32 FreeBSD: --extra-cflags=-D__BSD_VISIBLE
>> x86_32 NetBSD: --extra-cflags=-D_NETBSD_SOURCE
>> These are presumably required to work around the broken system
>> headers (bktr.h) on these systems.
>
> bktr.h is ok. /usr/include/sys/cdefs.h:
> and /usr/include/sys/featuretest.h:
> probably aren't.
It's bktr.h that's causing the problems for us by using u_int and
similar BSD typedefs. The usual way to handle such situations is to
always typedef __-prefixed versions of all non-standard types and use
these in system headers. This namespace is reserved for the system
for precisely this reason.
>> x86_32 OpenBSD: cavsdsp_mmx-fPIC-friendly.diff; CFLAGS='-fPIC -DPIC'
>> Does OpenBSD require PIC even for static builds?
>
> Excluding completely -static.
Why is this? It makes no sense. Does the dynamic linker not support
text relocations at all?
>> If so, this should be handled in configure.
I'll see about fixing the PIC handling in configure.
> And what's in the patch?
>
> "r"((x86_reg)dstStride) -> "rm"((x86_reg)dstStride)
This looks wrong.
>> x86_32 OpenSolaris: sed -i -e 's/^\(SHFLAGS\)=\(.*\)/\1=-mimpure-text \2/' config.mak
>> The -mimpure-text option allows non-PIC in shared libs. This should
>> be set in configure.
>
> Btw, the Sun linker still complains about relocations even when objects are built with
> -fPIC:
> gcc -shared -Wl,-h,libavcodec.so.52 ...
> Text relocation remains referenced
> against symbol offset in file
> .rodata (section) 0x2fd0 libavcodec/x86/dsputil_mmx.o
> .rodata (section) 0x9 libavcodec/x86/idct_sse2_xvid.o
> [skip ~4300 lines]
> ff_pw_9 0x3b0 libavcodec/x86/vc1dsp_mmx.o
> ld: fatal: relocations remain against allocatable but non-writable sections
> collect2: ld returned 1 exit status
I take it this is without -mimpure-text, correct?
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list