使用 apt-get build 編譯你的 firefox [論壇 - Ubuntu 套件打包]
正在瀏覽:
1 名遊客
鬼鬼
|
回覆: 使用 apt-get build 編譯你的 firefox |
|
---|---|---|
Anon:鬼鬼
|
我寫一下心得,經驗吧, 我的認識也很淺薄, 有錯請指正或補充
![]() -O3: 這是一定要的啦 -mtune=(native,core2,k8,amdfam10之類): 如果是native的話, 編譯器還會偵測你的cpu快取大小, 例: 它會自動偵測並加上 --param l1-cache-line-size=64 --param l1-cache-size=32 l2-cache-size=512 類似這樣的參數, 依cpu而定 core2,k8,amdfam10之類的,你要自己認明你的cpu是哪個)就沒看到這個偵測快取參數喔 native的話會偵測你的cpu是 (core2,k8,amdfam10之類的), 還會補上快取大小-msse2, -mfpmath=sse: 指令最好有sse2啦, 對數學運算有幫助, sse3以上是對多媒體的有幫助, 轉檔之類的吧 感覺就沒有那麼重要, 然後浮點運算把它設定為sse類型, 比x87快,參數是-mfpmath=sse -fno-reorder-functions: 有沒有reorder-functions, 對效能影響不大, 但是可以降低程式碼體積, 就設定no了 這個參數說我亂掰也行, 看到有的版本都有這個參數就是了... ![]() 再來就是segmentation fault的問題, 通常你使用-msse2這樣的參數的話會發生, 在我的系統, 是補上-mstackrealign參數, 就不會發生, 但是別人的firefox沒有-mstackrealign,也不會segmentation fault, 這我就不懂了 所以,自己機器要用的參數整理如下... "-O3 -mtune=native -msse2 -mfpmath=sse -mstackrealign -pipe -fomit-frame-pointer -fno-reorder-functions" ===pgo的心得=== 基本上大家都是重視javascript的速度吧, 那麼負責執行javascript是哪個檔案呢? 我有找到了, 就是libmozjs.so這個檔案啦, 這個檔案編譯完成後, 位置是在"(你的編譯目的目錄路徑)/js/src/" 裡面喔, --- 如果你採取make -f client.mk profiledbuild, 也就是PGO的編譯, 第一次的firefox來逛網站, 首先, 大家都會逛sunspider吧(笑), 如果"只"對sunspider做pgo, 在第二次編譯完之後, 即使你用mtune=generic, 也會強過使用"mtune=native 加上你逛很多網站(包含js評測網站)的pgo"的成績喔, (以測sunspider來比較性能) 但是pgo的用意是用來給你逛很多網站最佳化用的,所以,不要太執著於sunspider,v8之類的成績 有跑過就好, 統統都跑一遍就是囉 ![]() 跑完你常逛的網站之後, 按CTRL+Q 關閉firefox, 讓它自動跑第二次編譯... 註:如果關閉firefox, 它第二次編譯沒跑, 就再一次下指令 make -f client.mk profiledbuild 等firefox出現之後, 再按CTRL+Q 關閉firefox, 應該就能成功跑第二次編譯了, (你之前逛過的網站資料還在, 不用重新逛) --- 好啦, 接下來大家常常pgo編譯不過去, 基本上你要的是javascript的性能的話, firefox編譯過程有個眉角, 它把libmozjs.so這個檔案, 排程在很前面就編譯了喔~~ 所以, 你可以馬上觀察"(你的編譯目的目錄路徑)/js/src/"裡面libmozjs.so是不是編譯好了, 編譯好了, 再來呢? (通常沒最佳化libmozjs.so大小很肥,3MB以上, PGO第一次就是用這個來跑的, 最佳化後, 1.5MB以內吧) 再來就是,按CTRL+C(笑), 中斷編譯! (假設你常常PGO的第二次都編譯失敗) --- 接下來, 就是改成 make -f client.mk build 還記得嗎, 你的pgo最佳化libmozjs.so已經編譯成功了, 所以, 它會略過不會再編了, 這時候, 就等編譯完成吧 ![]() 註: 如果不想等, 其實你最佳化的libmozjs.so可以複製出來, 取代原本在你firefox的目錄的libmozjs.so喔, 這樣也可以...(好像有點冒險XD) 以上大概就這樣, 下台一鞠躬~ ![]()
2010/7/15 2:04
| 107a2 e6231 e0df7 55be9
|
|
![]() |
回覆: 使用 apt-get build 編譯你的 firefox |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員四級
![]() ![]() 註冊日期:
2008/9/17 14:25 所屬群組:
已註冊使用者 等級: 19
HP : 0 / 467
![]() |
鬼鬼 寫到:再來就是segmentation fault的問題, 通常你使用-msse2這樣的參數的話會發生, 剛剛試了一下 -mstackrealign 加下去還是不能解決segmentation fault的問題 我避免的方法就像上一頁說的 先用正常的編譯一次,再用pgo編譯一次(PGO第一次因為已經編好了所以會跳過去 不會浪費掉太多時間) -- 會產生 segmentation fault的狀況似乎是在 x86_64 這也許是比較少討論的原因之一
2010/7/15 17:33
|
||||||||||
![]() |
回覆: 使用 apt-get build 編譯你的 firefox |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2008/12/28 14:03 所屬群組:
已註冊使用者 等級: 1
HP : 0 / 11
![]() |
其他的軟件 是不是用同一方法 增加軟件的運行速度.
2011/9/13 20:34
|
||||||||||
![]() |
回覆: 使用 apt-get build 編譯你的 firefox |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
站長
![]() ![]() 註冊日期:
2005/6/10 9:50 來自 Taichung, Taiwan.
所屬群組:
網站管理員 已註冊使用者 等級: 19
HP : 0 / 450
![]() |
搬移主題至 Ubuntu 套件打包。
2012/1/7 3:33
|
||||||||||
![]() |
回覆: 使用 apt-get build 編譯你的 firefox |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員一級
![]() ![]() 註冊日期:
2011/7/3 21:10 所屬群組:
已註冊使用者 等級: 3
HP : 0 / 60
![]() |
我依照這編來編譯firefox是成功了, 但它不能直接覆蓋原有的firefox. 也要自行更改連結.
http://oranqe.wordpress.com/2009/03/10/the-way-to-build-pgo-fx/ 於是再用sudo apt-build install firefox 來編譯, 這次都成功, 不用自行更改連結, 但我的apt-build.conf 是用了 O2, 而編出來則只有Os, 也無法使用.mozconfig 進行設定, 而且這次用了一整天來編譯, 原來它給我把firefox 的語系都編了, 上面那次只用了3 個多小時. 不知是我那裡做錯了呢? 還是apt-build 根本不能和.mozconfig 共存? apt-build.conf : build-dir = /var/cache/apt-build/build repository-dir = /var/cache/apt-build/repository Olevel = -O2 mtune = -mtune=athlon64-sse3 options = " -O2 -pipe -march=athlon64-sse3 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=athlon64-sse3 -fstack-protector " make_options = "-j3" 第2次編譯後的firefox about :buildconfig gcc gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) -Wall -W -Wno-unused -Wpointer-arith -Wdeclaration-after-statement -Wcast-align -W -pedantic -Wno-long-long -g -fno-strict-aliasing -pthread -ffunction-sections -fdata-sections -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer c++ gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -g -fno-exceptions -fno-strict-aliasing -std=gnu++0x -pthread -ffunction-sections -fdata-sections -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer Configure arguments --host=x86_64-linux-gnu --prefix=/usr --libexecdir=/usr/lib/firefox-10.0.2 --with-l10n-base=/build/buildd/firefox-10.0.2+build1/build-tree/mozilla/l10n --srcdir=/build/buildd/firefox-10.0.2+build1/build-tree/mozilla --disable-install-strip --disable-updater --enable-application=browser --enable-startup-notification --with-distribution-id=com.ubuntu --enable-optimize --enable-tests --enable-ipdl-tests --enable-crashreporter --enable-official-branding --disable-gnomevfs --enable-gio --disable-debug --disable-elf-hack --enable-extensions=default,globalmenu
2012/2/29 22:48
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.