<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font size="4">Greeting!</font><div><font size="4"><br></font></div><div><font size="4">I would like to share with some compilation problem while I was prepared libx264.a. Then I was linked libx264 with the ffmpeg compilation and meat some problem.</font></div><div><font size="4"><br></font></div><div><font size="4">All Steps:</font></div><div><font size="4"><br></font></div><div><font size="4">1. Source downloading of the libx264</font></div><div><font size="4"><br></font></div><div><font size="4">> <span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; ">git clone <a href="git://git.videolan.org/x264.git">git://git.videolan.org/x264.git</a></span></font></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4"><br></font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4">2. Compiling libx264 for iOS (let's say it will be for armv7s)</font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4"><br></font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4"><div>> CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc ./configure \</div><div>--host=arm-apple-darwin \</div><div>--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \</div><div>--prefix=armv7s \</div><div>--extra-cflags="-arch armv7s -mcpu=cortex-a9" \</div><div>--extra-ldflags="-arch armv7s -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system" \</div><div>--enable-static \</div><div><br></div><div>On that step I have compiled library and includes. Compiles library I was copy to the /usr/local/lib and includes I was copy to the /usr/local/include</div></font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4"><br></font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4">3. Source downloading of the ffmpeg</font></span></div><div><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; "><font size="4"><br></font></span></div><div><font size="4"><span style="background-color: rgb(255, 255, 255); line-height: 22px; text-align: left; ">> </span>git clone <a href="git://source.ffmpeg.org/ffmpeg.git">git://source.ffmpeg.org/ffmpeg.git</a> ffmpeg</font></div><div><font size="4"><br></font></div><div><font size="4">4. Some preparation for ffmpeg compilation </font></div><div><font size="4"><br></font></div><div><font size="4">- Installing mac ports (if not installed)</font></div><div><font size="4">- Installing pkgconfig (> sudo port install pkgconfig)</font></div><div><font size="4">- Downloading gas-preprocessor.pl and copy it to the /usr/local/bin</font></div><div><font size="4">- Then change permitition for </font><span style="font-size: large; ">gas-preprocessor.pl</span><font size="4"> (> chown 777 /usr/local/bin/</font><span style="font-size: large; ">gas-preprocessor.pl</span><font size="4">)</font></div><div><font size="4"><br></font></div><div><font size="4">So for now we are ready to compile and install ffmpeg with libx264</font></div><div><font size="4"><br></font></div><div><font size="4">5. Compiling and installing ffmpeg</font></div><div><font size="4"><br></font></div><div><font size="4">> ./configure \</font></div><div><font size="4">--prefix=armv7s \</font></div><div><font size="4">--disable-ffmpeg \</font></div><div><font size="4">--disable-ffplay \</font></div><div><font size="4">--disable-ffprobe \</font></div><div><font size="4">--disable-ffserver \</font></div><div><font size="4">--enable-avresample \</font></div><div><font size="4">--enable-cross-compile \</font></div><div><font size="4">--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk" \</font></div><div><font size="4">--target-os=darwin \</font></div><div><font size="4">--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \</font></div><div><font size="4">--extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.0 -I/usr/local/include" \</font></div><div><font size="4">--extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0 -L/usr/local/lib" \</font></div><div><font size="4">--arch=arm \</font></div><div><font size="4">--cpu=cortex-a9 \</font></div><div><font size="4">--disable-asm \</font></div><div><font size="4">--enable-libx264 \</font></div><div><font size="4">--enable-gpl \</font></div><div><font size="4"><br></font></div><div><font size="4">> make clean && make && make install</font></div><div><font size="4"><br></font></div><div><font size="4">The main thing here is --enable-libx264 option and paths to the libx264 in --extra-cflags and --extra-ldflags</font></div><div><font size="4"><br></font></div><div><font size="4">6. Putting all together </font></div><div><font size="4"><br></font></div><div><font size="4">- Create new Xcode project</font></div><div><font size="4">- Copy libraries from libx264 to the project</font></div><div><font size="4">- Copy libraries from ffmpeg to the project</font></div><div><font size="4">- In the project in the AppDelegate.m file in method didFinishLaunchingWithOptions I added one ffmpeg call avcodec_register_all();</font></div><div><font size="4"><br></font></div><div><font size="4">After running the project I found one warning from XCode</font></div><div><font size="4"><br></font></div><div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in l070 from /Users/aukuzmin/Projects/x264/h264/lib/libx264.a(pixel-a.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie</font></div></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><img height="721" width="1245" apple-width="yes" apple-height="yes" id="940b7561-f6ad-4c31-8a1d-83873b1cb36b" src="cid:1B59087F-438E-4EF1-9911-259E8140AECC@hackers.netlab"></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><span style="font-size: large; ">I was trying to find out what's going on and I found next thing. When I was configuring libx264 it is compiling with </span><span style="font-size: large; ">-mdynamic-no-pic</span><span style="font-size: large; "> flag. I opened configure file and made next:</span></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">And after that I compiled libx264 one more time copied lib to the /usr/local/lib and compiled ffmpeg one more time. Then copy compiled libs to the Xcode and run the demo project.</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">So warning wash't dismiss.</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">So my question is:</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">How can I compile libx264 without any warning?</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">P.S. My system is OS X 10.8.2, Xcode 4.5.2, iOS SDK 6.0</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">Thank you,</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4">Alexey</font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; "><font size="4"><br></font></div><div style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; font-family: Menlo; "><br></div></body></html>