Luca Barbato <[email protected]> writes: > On 11/28/12 2:12 PM, fei wang wrote: >> Hi all, >> I have a question on the link of latest libav libraries. >> ####Background#### >> I am porting the latest libav to android by a ndk(cross-compile it >> through ndk standalone toolchain, passing sys-root parameter to configure >> script) on Linux. After that I found the new libav libraries cannot link >> well with other modules >> while my previous libraries based on ffmpeg works well. Then I look into >> the symbol table and compared them with each other and found that all >> internal defined symbols in latest libav libraries >> are prefixed with a LIBAVCODEC_54/ LIBAVFORMAT_54/LIBAVUTIL_52, but my >> other modules which depending on these apis exported by libav libraries >> refers to the original symbols which is not prefixed with these version >> information(I am very certain that i have used the proper header files). >> ####Question#### >> So can any body help me to fix this link problem? > > You should build the libraries unversioned. > > I guess we might add a toolchain switch for android to get you that > right out of box. That might involve changing again the library creation > rules though =_=;
configure --disable-symver should do the trick. I tried for the second time as you say: my config.sh(used to configure libav source) is as attached: " #!/bin/bash TOOL_CHAIN_STANDALONE=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain ./configure --target-os=linux \ --enable-cross-compile \ --sysroot=$TOOL_CHAIN_STANDALONE/sysroot \ --cross-prefix=$TOOL_CHAIN_STANDALONE/bin/arm-linux-androideabi- \ --arch=armv6t2 \ --enable-pic \ --extra-cflags="-fPIC -DANDROID" \ --enable-shared \ --disable-static \ --disable-avdevice \ --disable-asm \ --disable-yasm \ --disable-programs \ --disable-symver " Then i input these commands to compile libav: " fwang@BG2BLT06:~/work/self/libav$ make clean fwang@BG2BLT06:~/work/self/libav$ find . -iname "*.so" fwang@BG2BLT06:~/work/self/libav$ fwang@BG2BLT06:~/work/self/libav$ make -j10 -B fwang@BG2BLT06:~/work/self/libav$ find . -iname "*.so" ./libavresample/libavresample.so ./libavcodec/libavcodec.so ./libswscale/libswscale.so ./libavformat/libavformat.so ./libavutil/libavutil.so ./libavfilter/libavfilter.so fwang@BG2BLT06:~/work/self/libav$ objdump -T ./libavcodec/libavcodec.so |grep 54 003b0718 g DF .text 0000003c LIBAVCODEC_54 av_log_missing_feature 002cddc0 g DF .text 00000db0 LIBAVCODEC_54 avpriv_copy_pce_data 00017b60 g DF .text 0000032c LIBAVCODEC_54 avpriv_aac_parse_header 003ad030 g DF .text 0000004c LIBAVCODEC_54 av_fast_realloc 003ad07c g DF .text 00000050 LIBAVCODEC_54 av_fast_malloc 0006d35c g DF .text 0000006c LIBAVCODEC_54 av_packet_get_side_data 003ae5ac g DF .text 00000054 LIBAVCODEC_54 avcodec_get_frame_defaults 004b8e84 g DO .rodata 00000040 LIBAVCODEC_54 avpriv_mpeg4audio_sample_rates 003b06c4 g DF .text 00000054 LIBAVCODEC_54 av_log_ask_for_sample 00077e94 g DF .text 0000007c LIBAVCODEC_54 avpriv_align_put_bits 002cd3cc g DF .text 000009f4 LIBAVCODEC_54 avpriv_mpeg4audio_get_config 003ae600 g DF .text 00000020 LIBAVCODEC_54 avcodec_alloc_frame 0045825c g DO .rodata 00000010 LIBAVCODEC_54 avpriv_ac3_channel_layout_tab 00039de8 g DF .text 000008f0 LIBAVCODEC_54 avpriv_ac3_parse_header 0005082c g DF .text 00000198 LIBAVCODEC_54 avpriv_adx_decode_header 003af7f0 g DF .text 0000004c LIBAVCODEC_54 av_get_bits_per_sample 003ad19c g DF .text 00000084 LIBAVCODEC_54 avcodec_register ...... " Then i check whether the --disable-symver is appended: " fwang@BG2BLT06:~/work/self/libav$ grep -R "\-\-disable\-symver" . ./config.log:# ./configure --target-os=linux --enable-cross-compile --sysroot=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/sysroot --cross-prefix=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/bin/arm-linux-androideabi- --arch=armv6t2 --enable-pic --extra-cflags='-fPIC -DANDROID' --enable-shared --disable-static --disable-avdevice --disable-asm --disable-yasm --disable-programs --disable-symver ./config.log:LIBAV_CONFIGURATION='--target-os=linux --enable-cross-compile --sysroot=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/sysroot --cross-prefix=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/bin/arm-linux-androideabi- --arch=armv6t2 --enable-pic --extra-cflags='"'"'-fPIC -DANDROID'"'"' --enable-shared --disable-static --disable-avdevice --disable-asm --disable-yasm --disable-programs --disable-symver' ./config.log:opt='--disable-symver' ./config.log:optval='--disable-symver' ./config.log:r='--disable-symver' ./configure: --disable-symver disable symbol versioning ./config.sh:--disable-symver ./config.fate:config:arm::generic:linux:gcc 4.6 (GCC) 20120106 (prerelease):--target-os=linux --enable-cross-compile --sysroot=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/sysroot --cross-prefix=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/bin/arm-linux-androideabi- --arch=armv6t2 --enable-pic --extra-cflags='-fPIC -DANDROID' --enable-shared --disable-static --disable-avdevice --disable-asm --disable-yasm --disable-programs --disable-symver ./config.h:#define LIBAV_CONFIGURATION "--target-os=linux --enable-cross-compile --sysroot=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/sysroot --cross-prefix=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/bin/arm-linux-androideabi- --arch=armv6t2 --enable-pic --extra-cflags='-fPIC -DANDROID' --enable-shared --disable-static --disable-avdevice --disable-asm --disable-yasm --disable-programs --disable-symver" ./config.mak:LIBAV_CONFIGURATION=--target-os=linux --enable-cross-compile --sysroot=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/sysroot --cross-prefix=/home/fwang/work/self/android-ndk-r8c/standalone_toolchain/bin/arm-linux-androideabi- --arch=armv6t2 --enable-pic --extra-cflags='-fPIC -DANDROID' --enable-shared --disable-static --disable-avdevice --disable-asm --disable-yasm --disable-programs --disable-symver " It seems that this option doesn't work as i & your proposal expected. Can you give me any other advice? 2012/11/28 Måns Rullgård <[email protected]> > Luca Barbato <[email protected]> writes: > > > On 11/28/12 2:12 PM, fei wang wrote: > >> Hi all, > >> I have a question on the link of latest libav libraries. > >> ####Background#### > >> I am porting the latest libav to android by a ndk(cross-compile it > >> through ndk standalone toolchain, passing sys-root parameter to > configure > >> script) on Linux. After that I found the new libav libraries cannot link > >> well with other modules > >> while my previous libraries based on ffmpeg works well. Then I look into > >> the symbol table and compared them with each other and found that all > >> internal defined symbols in latest libav libraries > >> are prefixed with a LIBAVCODEC_54/ LIBAVFORMAT_54/LIBAVUTIL_52, but my > >> other modules which depending on these apis exported by libav libraries > >> refers to the original symbols which is not prefixed with these version > >> information(I am very certain that i have used the proper header files). > >> ####Question#### > >> So can any body help me to fix this link problem? > > > > You should build the libraries unversioned. > > > > I guess we might add a toolchain switch for android to get you that > > right out of box. That might involve changing again the library creation > > rules though =_=; > > configure --disable-symver should do the trick. > > -- > Måns Rullgård > [email protected] > _______________________________________________ > libav-devel mailing list > [email protected] > https://lists.libav.org/mailman/listinfo/libav-devel >
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
