[FFmpeg-trac] #3540(avutil:new): The asm inline code in function libavcodec/dirac_arith.h:dirac_get_arith_bit with PIC and stack-check build options

FFmpeg trac at avcodec.org
Wed Apr 9 12:02:54 CEST 2014


#3540: The asm inline code in function
libavcodec/dirac_arith.h:dirac_get_arith_bit with PIC and stack-check build
options
----------------------------------+----------------------------------
             Reporter:  alucowie  |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avutil    |                  Version:  1.2.6
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+----------------------------------
 Summary of the bug:
 The code in function libavcodec/dirac_arith.h:dirac_get_arith_bit needs 6
 registers and must be protected by a macro HAVE_6REGS. If we enable PIC
 (ebx is used by PIC) and check-stack or no-omit-frame-pointer (which use
 ebp) then we haven't 6 registers but 5 on x86 then the compilation failed
 as :
 In file included from /var/tmp/portage/media-
 video/ffmpeg-1.2.6/work/ffmpeg-1.2.6/libavcodec/diracdec.c:35:0:
 /var/tmp/portage/media-
 video/ffmpeg-1.2.6/work/ffmpeg-1.2.6/libavcodec/dirac_arith.h: In function
 ‘dirac_get_arith_bit’:
 /var/tmp/portage/media-
 video/ffmpeg-1.2.6/work/ffmpeg-1.2.6/libavcodec/dirac_arith.h:141:5:
 error: ‘asm’ operand has impossible constraints
 make: * [libavcodec/diracdec.o] Error 1



 How to reproduce:
 {{{
 i686-pc-linux-gnu-gcc -I. -I../ffmpeg-1.2.6/ -D_ISOC99_SOURCE
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112
 -D_XOPEN_SOURCE=600 -DPIC -DHAVE_AV_CONFIG_H -std=c99 -fPIC -pthread
 -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT
 -I/usr/include/SDL -pie -fstack-check -MMD -MF libavcodec/diracdec.d -MT
 libavcodec/diracdec.o -c -o libavcodec/diracdec.o
 ../ffmpeg-1.2.6/libavcodec/diracdec.c
 }}}
 I test with 1.2.6 but all version since are affected.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3540>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list