2016-03-22 14 views
0

我已經從官方網站檢出了ffmpeg的最新來源。我現在想編譯並構建ffmpeg作爲獨立於位置的可執行文件。如何在Android上將ffmpeg構建爲位置獨立可執行文件(PIE)或PIC?

這裏是我的配置命令是什麼樣子

./configure --prefix=/usr/local --enable-gpl --enable-pic --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 

我已經添加了一些選項--enable-pic,使之成爲PIE。然而,當構建過程成功完成,當我做了硬化檢查如下然後我得到以下輸出

硬化檢查的ffmpeg

ffmpeg: 
Position Independent Executable: no, normal executable! 
Stack protected: yes 
Fortify Source functions: yes (some protected functions found) 
Read-only relocations: yes 
Immediate binding: no, not found! 

這告訴我,ffmpeg的仍然不是餡餅。誰能告訴我我在這裏錯過了什麼?是否有任何其他更改需要添加PIE支持。

回答

2

您需要添加-fPIE和 - 餅圖選項到CFLAGS和LDFLAGS到配置腳本,如下所示:

./configure <other options> \ 
--extra-cflags="-I../x264 -mfloat-abi=softfp -mfpu=neon -fPIE -pie" \ 
--extra-ldflags="-L../x264 -fPIE -pie" 

最新的腳本已經有了這些更改。

+0

-fPIE僅適用於cflags,-pie僅適用於ldflags – tmm1

相關問題