Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4909 closed defect (invalid)

can't compile ffmpeg with gcc520 + enable-libutvideo option under macosx

Reported by: ponpon Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: libutvideo
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Dear ffmpeg team,

thank you for providing the excellent app.
I can't compile ffmpeg with gcc520 + enable-libutvideo option under macosx 1095.
regardless of using complile option -lstdc++, the below appears.
if --enable-shared --disable-static are used in compiling libutvideo, the compile of ffmpeg is succeeded.

Undefined symbols for architecture x86_64:
.
.
.
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

How to reproduce: i executed the following. the logs of ffmpeg are attached in this ticket, because of too long.

~ x$ #Make RamDisk
~ x$ DISK_ID=$(hdid -nomount ram://26214400)
~ x$ newfs_hfs -v Ramdisk ${DISK_ID}
~ x$ diskutil mount ${DISK_ID}
~ x$ 
~ x$ #Set up some shortcuts
~ x$ MES="/Volumes/Ramdisk/Packages"
~ x$ TARGET="/Volumes/Ramdisk/sw"
~ x$ CMPL="/Volumes/Ramdisk/compile"
~ x$ 
~ x$ #Setup target directories
~ x$ mkdir -p ${MES}
~ x$ mkdir -p ${TARGET}
~ x$ mkdir -p ${CMPL}
~ x$
~ x$ #Use gcc
~ x$ unset CC
~ x$ export CC=gcc
~ x$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin13/5.2.0/lto-wrapper
Target: x86_64-apple-darwin13
Configured with: /opt/local/var/macports/build/_opt_mports_dports_lang_gcc5/gcc5/work/gcc-5.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin13 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc5 --includedir=/opt/local/include/gcc5 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-5 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-5 --with-gxx-include-dir=/opt/local/include/gcc5/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc5 5.2.0_0'
Thread model: posix
gcc version 5.2.0 (MacPorts gcc5 5.2.0_0) 
~ x$
~ x$ unset CXX
~ x$ export CXX=g++
~ x$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin13/5.2.0/lto-wrapper
Target: x86_64-apple-darwin13
Configured with: /opt/local/var/macports/build/_opt_mports_dports_lang_gcc5/gcc5/work/gcc-5.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin13 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc5 --includedir=/opt/local/include/gcc5 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-5 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-5 --with-gxx-include-dir=/opt/local/include/gcc5/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc5 5.2.0_0'
Thread model: posix
gcc version 5.2.0 (MacPorts gcc5 5.2.0_0) 
~ x$ 
~ x$ #Build utvideo
~ x$ cd ${CMPL}
compile x$ git clone git://github.com/qyot27/libutvideo
Cloning into 'libutvideo'...
remote: Counting objects: 1142, done.
remote: Total 1142 (delta 0), reused 0 (delta 0), pack-reused 1142
Receiving objects: 100% (1142/1142), 426.50 KiB | 148.00 KiB/s, done.
Resolving deltas: 100% (823/823), done.
Checking connectivity... done.
compile x$ cd ${CMPL}
compile x$ cd libutvideo
libutvideo x$ ./configure  --prefix=${TARGET} --enable-asm=x64&& make && make install 
sed: 1: "version.c": invalid command code v
version.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main() {
 ^
OS:         MACOSX
asm:        x64
debug:      no
gprof:      no
PIC:        no
static:     yes
shared:     no
optlevel:   2

You can run 'make' now.
 CXX	utv_core/Codec.o
 CXX	utv_core/CodecBase.o
 CXX	utv_core/Coefficient.o
 CXX	utv_core/Convert.o
 CXX	utv_core/DummyCodec.o
 CXX	utv_core/FrameBuffer.o
 CXX	utv_core/GlobalConfig.o
 CXX	utv_core/HuffmanCode.o
 CXX	utv_core/Predict.o
 CXX	utv_core/Thread.o
 CXX	utv_core/TunedFunc.o
In file included from utv_core/TunedFunc.cpp:135:0:
utv_core/TunedFunc_x86x64.cpp: In constructor 'CTunedFuncInitializer::CTunedFuncInitializer()':
utv_core/TunedFunc_x86x64.cpp:286:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(uint32_t *)(vendor+0) = cpuid_0.ebx;
                         ^
utv_core/TunedFunc_x86x64.cpp:304:30: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *(uint32_t *)(procbrand+ 0) = cpuid_ex2.eax;
                              ^
utv_core/TunedFunc_x86x64.cpp:280:15: warning: variable 'maname' set but not used [-Wunused-but-set-variable]
   const char *maname;
               ^
utv_core/TunedFunc_x86x64.cpp:281:12: warning: variable 'ma' set but not used [-Wunused-but-set-variable]
   uint32_t ma;
            ^
 CXX	utv_core/UL00Codec.o
 CXX	utv_core/ULRACodec.o
 CXX	utv_core/ULRGCodec.o
 CXX	utv_core/ULYUV420Codec.o
 CXX	utv_core/ULYUV422Codec.o
 CXX	utv_core/UQ00Codec.o
utv_core/UQ00Codec.cpp: In member function 'int CUQ00Codec::CalcFrameMetric(utvf_t, unsigned int, unsigned int, size_t, const void*, size_t)':
utv_core/UQ00Codec.cpp:233:20: warning: unused variable 'p' [-Wunused-variable]
  const STREAMINFO *p = (const STREAMINFO *)pExtraData;
                    ^
 CXX	utv_core/UQY2Codec.o
 CXX	utv_core/utv_core.o
 ASM	utv_core/Convert_asm_x64.o
 ASM	utv_core/HuffmanCode_asm_x64.o
 ASM	utv_core/Predict_asm_x64.o
 CXX	utv_core/TunedFunc_x86x64.o
utv_core/TunedFunc_x86x64.cpp: In constructor 'CTunedFuncInitializer::CTunedFuncInitializer()':
utv_core/TunedFunc_x86x64.cpp:286:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(uint32_t *)(vendor+0) = cpuid_0.ebx;
                         ^
utv_core/TunedFunc_x86x64.cpp:304:30: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *(uint32_t *)(procbrand+ 0) = cpuid_ex2.eax;
                              ^
utv_core/TunedFunc_x86x64.cpp:280:15: warning: variable 'maname' set but not used [-Wunused-but-set-variable]
   const char *maname;
               ^
utv_core/TunedFunc_x86x64.cpp:281:12: warning: variable 'ma' set but not used [-Wunused-but-set-variable]
   uint32_t ma;
            ^
 AR	utv_core/libutvideo.a
/opt/local/bin/ranlib: file: utv_core/libutvideo.a(GlobalConfig.o) has no symbols
/opt/local/bin/ranlib: file: utv_core/libutvideo.a(utv_core.o) has no symbols
 RANLIB	utv_core/libutvideo.a
ranlib: file: utv_core/libutvideo.a(GlobalConfig.o) has no symbols
ranlib: file: utv_core/libutvideo.a(utv_core.o) has no symbols
 INSTALL	/Volumes/Ramdisk/sw/include/utvideo/Codec.h
 INSTALL	/Volumes/Ramdisk/sw/include/utvideo/utvideo.h
 INSTALL	/Volumes/Ramdisk/sw/include/utvideo/version.h
 INSTALL	/Volumes/Ramdisk/sw/lib/pkgconfig/libutvideo.pc
 INSTALL	/Volumes/Ramdisk/sw/lib/libutvideo.a
ranlib: file: /Volumes/Ramdisk/sw/lib/libutvideo.a(GlobalConfig.o) has no symbols
ranlib: file: /Volumes/Ramdisk/sw/lib/libutvideo.a(utv_core.o) has no symbols
libutvideo x$
libutvideo x$ #Add flags
libutvideo x$ export PKG_CONFIG_PATH="/Volumes/Ramdisk/sw/lib/pkgconfig:/opt/local/lib/pkgconfig"
libutvideo x$ unset LDFLAGS CFLAGS MYFLAGS  CXXFLAGS
libutvideo x$ export MYFLAGS=" -lstdc++  -L/opt/local/lib -I/opt/local/include -L${TARGET}/lib  -I${TARGET}/include " 
libutvideo x$ export LDFLAGS="$MYFLAGS" 
libutvideo x$ export CFLAGS="$MYFLAGS"
libutvideo x$ export CXXFLAGS="$MYFLAGS"
libutvideo x$ 
libutvideo x$ #Build ffmpeg
compile x$ cd ${CMPL}
compile x$ git clone git://source.ffmpeg.org/ffmpeg.git
Cloning into 'ffmpeg'...
remote: Counting objects: 446401, done.
remote: Compressing objects: 100% (99571/99571), done.
remote: Total 446401 (delta 354904), reused 436264 (delta 346093)
Receiving objects: 100% (446401/446401), 105.22 MiB | 1.59 MiB/s, done.
Resolving deltas: 100% (354904/354904), done.
Checking connectivity... done.
Checking out files: 100% (5404/5404), done.
compile x$ cd ${CMPL}
compile x$ cd ffmpeg
ffmpeg x$ 
./configure --prefix=${TARGET}  --enable-pthreads --cc="gcc" --extra-cflags=" -lstdc++" --cxx="g++" --enable-gpl --enable-libutvideo 1>>configure_result.txt 2>>configure_result.txt&& make -j 8 1>>make_result.txt 2>>make_result.txt&& make install 

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (3)

config.log (418.3 KB) - added by ponpon 4 years ago.
configure_displayed_log.txt (11.9 KB) - added by ponpon 4 years ago.
make_log.txt (107.9 KB) - added by ponpon 4 years ago.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by ponpon

Changed 4 years ago by ponpon

Changed 4 years ago by ponpon

comment:1 Changed 4 years ago by cehoyos

  • Keywords libutvideo added

Do you have any indication that you found a bug in FFmpeg (that can be fixed in FFmpeg)?

comment:2 Changed 4 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

It seems very unlikely to me that there is anything wrong that can be fixed in FFmpeg.

comment:3 Changed 4 years ago by ponpon

thank you for reply.

It seems very unlikely to me that there is anything wrong that can be fixed in FFmpeg.

i will try to ask qyot27.

Note: See TracTickets for help on using tickets.