2016/1/12

Cross Compile For netperf


  1. 下載source code (官網: http://www.netperf.org/)
    $ wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
    
  2. 解壓縮套件
    $ tar zxvf netperf-2.7.0.tar.gz
    
  3. 進入source code目錄執行configure配置編譯選項
    $ ./configure CC=/opt/ti-am335x-linux-devkit-08.00.00.00/bin/arm-linux-gnueabihf-gcc --host arm --config-cache
    
  4. 若有出現下列錯誤,則執行執行步驟5,否則直接執行步驟6進行編譯即可
    checking for sys/socket.h... (cached) yes
    checking types of arguments for select... int,fd_set *,struct timeval *
    checking whether setpgrp takes no argument... configure: error: cannot check setpgrp when cross compiling
    
  5. 修正setpgrp錯誤
    $ echo "ac_cv_func_setpgrp_void=yes" > config.cache
    
  6. 執行編譯
    $ make
    
  7. 編譯成功後可在src目錄下看到netperf與netserver,即可傳到目標機台上進行驗證

2016/1/5

Segmentation fault:FTP傳輸型態在搞鬼

首先看下面這段簡單的Hello World程式碼,按理說編譯完直接丟到目標機台上執行應該不會有什麼問題才對。
但卻一直發生Segmentation fault的錯誤提示
後來發現是因為使用FileZilla傳輸造成的,FileZilla有個設定值:傳輸型態,預設為自動,將這設定值改為二進位檔案即可解決此問題。