[FFmpeg-devel] [PATCH] Coremake support - ffmpeg_nommx.patch (1/1) - ffmpeg-nommx.patch (1/1)
Ronald S. Bultje
rbultje
Tue May 22 06:48:51 CEST 2007
Hi Diego,
In article <20070521224139.GD2143 at biurrun.de>,
Diego Biurrun <diego at biurrun.de> wrote:
> On Mon, May 21, 2007 at 09:40:19AM -0400, Ronald S. Bultje wrote:
> > In file included from dct-test.c:33:
> > dsputil.h: In function 'copy_block2':
> > dsputil.h:688: warning: implicit declaration of function 'ST16'
> > dsputil.h:688: warning: implicit declaration of function 'LD16'
> > dsputil.h: In function 'copy_block4':
> > dsputil.h:699: warning: implicit declaration of function 'ST32'
> > dsputil.h:699: warning: implicit declaration of function 'LD32'
> > dct-test.c: In function 'idct248_ref':
> > dct-test.c:333: warning: implicit declaration of function 'sqrt'
> > dct-test.c:333: warning: incompatible implicit declaration of built-in
> > function 'sqrt'
> > dct-test.c:334: warning: implicit declaration of function 'cos'
> > dct-test.c:334: warning: incompatible implicit declaration of built-in
> > function 'cos'
> > dct-test.c:334: error: 'M_PI' undeclared (first use in this function)
> > dct-test.c:334: error: (Each undeclared identifier is reported only once
> > dct-test.c:334: error: for each function it appears in.)
> > dct-test.c:342: warning: incompatible implicit declaration of built-in
> > function 'sqrt'
> > dct-test.c:343: warning: incompatible implicit declaration of built-in
> > function 'cos'
> > dct-test.c:350: warning: incompatible implicit declaration of built-in
> > function 'sqrt'
> > dct-test.c:393: warning: implicit declaration of function 'rint'
> > dct-test.c:393: warning: incompatible implicit declaration of built-in
> > function 'rint'
> >
> > I can work around this by adding an include for math.h.
>
> What environment are you compiling on? It works fine here on x86,
> Debian stable.
This is OSX 10.4.9. I think Linux sort-of automatically includes most
math.h functions with other standard headers, so Linux doesn't really
need include math.h. I think it's proper to add the include for
portability reasons.
> > In file included from fft-test.c:26:
> > dsputil.h: In function 'copy_block2':
> > dsputil.h:688: warning: implicit declaration of function 'ST16'
> > dsputil.h:688: warning: implicit declaration of function 'LD16'
> > dsputil.h: In function 'copy_block4':
> > dsputil.h:699: warning: implicit declaration of function 'ST32'
> > dsputil.h:699: warning: implicit declaration of function 'LD32'
> > fft-test.c: In function 'frandom':
> > fft-test.c:129: warning: implicit declaration of function 'random'
> > fft-test.c: In function 'help':
> > fft-test.c:161: warning: implicit declaration of function 'exit'
> > fft-test.c:161: warning: incompatible implicit declaration of built-in
> > function 'exit'
> > fft-test.c: In function 'main':
> > fft-test.c:198: warning: implicit declaration of function 'atoi'
> > fft-test.c:249: warning: implicit declaration of function 'memcpy'
> > fft-test.c:249: warning: incompatible implicit declaration of built-in
> > function 'memcpy'
> > fft-test.c:276: warning: incompatible implicit declaration of built-in
> > function 'memcpy'
> >
> > I can work around this by adding includes for stdlib.h and string.h to
> > fft-test.c.
>
> Here is what I get:
>
> gcc -Wl,--warn-common -Wl,--as-needed
> -Wl,-rpath-link,"/usr/src/ffmpeg"/libavcodec
> -Wl,-rpath-link,"/usr/src/ffmpeg"/libavformat
> -Wl,-rpath-link,"/usr/src/ffmpeg"/libavutil -o fft-test fft-test.o
> libavcodec.a mdct.o fft.o -L"/usr/src/ffmpeg"/libavutil -lavutil -lm -lz
^^^^^^^^^^^^ ^^^^^^ ^^^^^
> mdct.o: In function `ff_mdct_calc':
> /usr/src/ffmpeg/libavcodec/mdct.c:133: multiple definition of `ff_mdct_calc'
> libavcodec.a(mdct.o):/usr/src/ffmpeg/libavcodec/mdct.c:133: first defined
> here
> mdct.o: In function `ff_mdct_end':
> /usr/src/ffmpeg/libavcodec/mdct.c:173: multiple definition of `ff_mdct_end'
> libavcodec.a(mdct.o):/usr/src/ffmpeg/libavcodec/mdct.c:173: first defined
> here
> mdct.o: In function `ff_mdct_init':
> /usr/src/ffmpeg/libavcodec/mdct.c:32: multiple definition of `ff_mdct_init'
> libavcodec.a(mdct.o):/usr/src/ffmpeg/libavcodec/mdct.c:32: first defined here
> mdct.o: In function `ff_imdct_calc':
> /usr/src/ffmpeg/libavcodec/mdct.c:81: multiple definition of `ff_imdct_calc'
> libavcodec.a(mdct.o):/usr/src/ffmpeg/libavcodec/mdct.c:81: first defined here
> fft.o: In function `ff_fft_calc_c':
> /usr/src/ffmpeg/libavcodec/fft.c:162: multiple definition of `ff_fft_calc_c'
> libavcodec.a(fft.o):/usr/src/ffmpeg/libavcodec/fft.c:162: first defined here
> fft.o: In function `ff_fft_permute':
> /usr/src/ffmpeg/libavcodec/fft.c:239: multiple definition of `ff_fft_permute'
> libavcodec.a(fft.o):/usr/src/ffmpeg/libavcodec/fft.c:239: first defined here
> fft.o: In function `ff_fft_end':
> /usr/src/ffmpeg/libavcodec/fft.c:257: multiple definition of `ff_fft_end'
> libavcodec.a(fft.o):/usr/src/ffmpeg/libavcodec/fft.c:257: first defined here
> fft.o: In function `ff_fft_init':
> /usr/src/ffmpeg/libavcodec/fft.c:34: multiple definition of `ff_fft_init'
> libavcodec.a(fft.o):/usr/src/ffmpeg/libavcodec/fft.c:34: first defined here
> collect2: ld returned 1 exit status
> make: *** [fft-test] Error 1
You're including fft.o/mdct.o twice, once manually and once through
libavcodec.a. Oh, did I mention I don't use the ffmpeg build system?
Maybe I should include patches to that in my next patch so that it
actually builds for you guys, also. :-).
>
> > --- ffmpeg.orig/libavcodec/dct-test.c 2007-03-22 01:00:46.000000000 -0400
> > +++ ffmpeg/libavcodec/dct-test.c 2007-05-21 09:28:31.000000000 -0400
> > @@ -39,8 +40,6 @@
> > #define MAX(a, b) (((a) > (b)) ? (a) : (b))
> > #endif
> >
> > -#undef printf
>
> Probably wrong.
>
> > --- ffmpeg.orig/libavcodec/motion_test.c 2007-03-22 01:00:50.000000000
> > -0400
> > +++ ffmpeg/libavcodec/motion_test.c 2007-05-21 09:06:35.000000000 -0400
> > @@ -31,24 +31,24 @@
> >
> > -#undef printf
>
> dito
If I remove HAVE_AV_CONFIG_H, the #undef printf becomes unneeded, it's
solely there because we define HAVE_AV_CONFIG_H, which defines printf to
please_use_av_log or so. Michael suggested to get rid of
HAVE_AV_CONFIG_H, which makes the undef unneeded. I'll put this stuff in
several smaller patches which are better-documented and hopefully
prevent confusion, sorry for now...
Ronald
More information about the ffmpeg-devel
mailing list