// you’re reading...

FreeBSD

SimpleScalar Installation Guide

軟體介紹:

安裝環境:

  • Fedora Core 6 (Zod)
  • Kernel Version 2.6
  • Gcc Version 4.1.1

需要軟體:

開始安裝

Step 1.

建議先額外建立起一個額外的資料夾,然後下載 simpleutils-990811.tar.gz, simplesim-3v0d.tgz, gcc-2.7.2.3.ss.tar.gz 和 simpletools-2v0.tgz 這四個壓縮檔,接著把它們解開。這個額外的資料夾,我等會會直接將它當成欲安裝的資料夾,實際情形可以再視狀況調整。

Step 2.

安裝 utils,請依照順序輸入下列指令:

  1. export IDIR=你要安裝的資料夾位置
    在這我將以 /home/snese/crossdir 為例。
  2. cd $IDIR/simpleutils-990811/
  3. ./configure –host=i386-*-linux –target=sslittle-na-sstrix –with-gnu-as –with-gnu-ld –prefix=$IDIR
  4. make all install

Step 3.

安裝 simplescalar 3.0,請依照順序輸入下列指令:

  1. cd $IDIR/simplesim-3.0
  2. make config-pisa
  3. make
  4. make sim-tests

Step 4.

安裝 simplescalar gcc,請依照順序輸入下列指令:

  1. cd $IDIR/gcc-2.7.2.3
  2. export PATH=$PATH:$IDIR/sslittle-na-sstrix/bin
  3. ./configure –host=i386-*-linux –target=sslittle-na-sstrix –with-gnu-as –with-gnu-ld –prefix=$IDIR
  4. make
  5. 修正 insn-output.c 裡面三個含有 FIXME 區域的多餘 “\” 給刪除掉。
  6. cp patched/sys/cdefs.h ../sslittle-na-sstrix/include/sys/
  7. 修改 objc/sendmsg.c 在第 35 行裡加上 “#define STRUCT_VALUE 0″
  8. 把 protoize.c 裡第 60 行的 “#include <stdarg .h>” 換成 “#include <varargs .h>”
  9. make LANGUAGES=c
  10. make enquire
  11. ../simplesim-3.0/sim-safe ./enquire -f > float.h-cross
  12. make install LANGUAGES=c

Step 5.

安裝 glibc,前面 4 個步驟做完後,lib 會存放在 $IDIR/sslittle-na-sstrix/lib/libc.a 這邊。

參考資料

晚點有空的時候,再來補寫到 snese’s notebook ,除了 Linux 之外,FreeBSD 其實也是可以裝的。

Discussion

10 comments for “SimpleScalar Installation Guide”

  1. 作著你好:
    請問在“修正 insn-output.c 裡面三個含有 FIXME 區域的多餘 “\” 給刪除掉。”
    要刪除那些“\”,因為一直make 不過,麻煩指點一下,謝謝,gimy.

    Posted by gimyNo Gravatar | November 25, 2007, 2:42 pm
  2. 不知道回得有沒有太晚 …

    但那句的意思就是用 Editor 把多餘的符號刪除掉,不然會造成你 make 上的 error。

    希望這回答有幫到你。

    Posted by sneseNo Gravatar | December 14, 2007, 10:01 pm
  3. Step 4.5
    修正 insn-output.c 裡面三個含有 FIXME 區域的多餘 “\” 給刪除掉。

    ==> 把 return “FIXME\n 後面加一個 \ 就可以了

    改成這樣 return “FIXME\n\

    Posted by 安卓No Gravatar | December 17, 2007, 5:08 pm
  4. 你好大大我安裝到step2.4會出現
    [root@aaa binutils-2.5.2]# ./configure –host=i386-amd-linux –target=sslittle-na-sstrix –with-gnu-as –with-gnu-ld –prefix=/usr/local/sim/binutils-2.5.2
    Created “Makefile” in /usr/local/sim/binutils-2.5.2 using “config/mh-linux”
    [root@vlsipc7 binutils-2.5.2]# make all installmake[1]: Entering directory `/usr/local/sim/binutils-2.5.2/libiberty’
    echo “# !Automatically generated from ./functions.def”\
    “- DO NOT EDIT!” >needed2.awk
    grep ‘^DEFVAR(’ >needed2.awk
    grep ‘^DEFFUNC(’ >needed2.awk
    echo “/* !Automatically generated from ./functions.def”\
    “- DO NOT EDIT! */” >lconfig.h
    awk -f needed2.awk >lconfig.h
    cp lconfig.h config.h
    gcc -c -g -I. -I./../include argv.c
    gcc -c -g -I. -I./../include basename.c
    gcc -c -g -I. -I./../include concat.c
    gcc -c -g -I. -I./../include cplus-dem.c
    cplus-dem.c: 在函式 「demangle_template」 中:
    cplus-dem.c:931: 警告:隱含宣告與內建函式 「abort」 不相容
    gcc -c -g -I. -I./../include fdmatch.c
    gcc -c -g -I. -I./../include getopt.c
    gcc -c -g -I. -I./../include getopt1.c
    gcc -c -g -I. -I./../include getruntime.c
    gcc -c -g -I. -I./../include floatformat.c
    gcc -c -g -I. -I./../include obstack.c
    obstack.c: 在函式 「_obstack_free」 中:
    obstack.c:341: 警告:隱含宣告與內建函式 「abort」 不相容
    obstack.c: 在函式 「obstack_free」 中:
    obstack.c:375: 警告:隱含宣告與內建函式 「abort」 不相容
    gcc -c -g -I. -I./../include spaces.c
    spaces.c: 在函式 「spaces」 中:
    spaces.c:50: 警告:與內建函式 「malloc」 類型衝突
    gcc -c -g -I. -I./../include strerror.c
    strerror.c:467: 錯誤:對 「sys_nerr」 的靜態宣告出現在非靜態宣告之後
    /usr/include/bits/sys_errlist.h:27: 錯誤:「sys_nerr」 的上一個宣告在此
    strerror.c:468: 錯誤:與 「sys_errlist」 類型衝突
    /usr/include/bits/sys_errlist.h:28: 錯誤:「sys_errlist」 的上一個宣告在此
    make[1]: *** [strerror.o] Error 1
    make[1]: Leaving directory `/usr/local/sim/binutils-2.5.2/libiberty’
    make: *** [all-libiberty] Error 2

    不知到要怎麼解決

    Posted by szndNo Gravatar | December 19, 2007, 5:30 pm
  5. 是真的就卡在第二步嗎?

    有沒有試著接著做下去看看?

    真的不行的話,等我有空點再幫你研究一下 XD

    Posted by sneseNo Gravatar | December 24, 2007, 10:55 pm
  6. 你好:
    我作到make LANGUAGES=c出現error
    insn-output.c:825:12: error: invalid suffix “f” on integer constant
    insn-output.c:825: error: stray ‘\’ in program
    insn-output.c:826: error: stray ‘\’ in program
    insn-output.c:826: error: stray ‘\’ in program
    insn-output.c:826: error: stray ‘\’ in program
    insn-output.c:827: error: stray ‘\’ in program
    insn-output.c:827: error: stray ‘\’ in program
    insn-output.c:827: error: stray ‘\’ in program
    insn-output.c:828: error: stray ‘\’ in program
    insn-output.c:828: error: stray ‘\’ in program
    insn-output.c:828: error: stray ‘\’ in program
    insn-output.c:829: error: stray ‘\’ in program
    insn-output.c:830: error: stray ‘\’ in program
    insn-output.c:831: error: stray ‘\’ in program
    insn-output.c:831: error: stray ‘\’ in program
    insn-output.c:831:17: error: invalid suffix “f” on integer constant
    insn-output.c:831: error: stray ‘\’ in program
    insn-output.c:832: error: stray ‘\’ in program
    insn-output.c:832: error: stray ‘\’ in program
    insn-output.c:832: error: stray ‘\’ in program
    insn-output.c:833: error: stray ‘\’ in program
    insn-output.c:834: error: stray ‘\’ in program
    insn-output.c:834: error: stray ‘\’ in program
    insn-output.c:834: error: stray ‘\’ in program
    insn-output.c:835: error: stray ‘\’ in program
    insn-output.c:835: error: stray ‘\’ in program
    insn-output.c:835: error: stray ‘\’ in program
    insn-output.c:836: error: stray ‘\’ in program
    insn-output.c:836: error: stray ‘\’ in program
    insn-output.c:836: error: stray ‘\’ in program
    insn-output.c:837: error: stray ‘\’ in program
    insn-output.c:838: error: stray ‘\’ in program
    insn-output.c:838: error: stray ‘\’ in program
    insn-output.c:838: error: stray ‘\’ in program
    insn-output.c:839: error: missing terminating ” character
    不知那裡出錯~能幫解決ㄇ~謝

    Posted by No Gravatar | April 24, 2008, 9:13 pm
  7. 看了錯誤訊息,感覺應該是檔案格式出了點問題。

    不知道你是不是從 Windows 再傳送檔案到要負責編譯的主機那邊,如果是的話可能要注意檔案儲存的格式,要以 Unix 的格式進行儲存。

    ——

    另外出現這種問題,我覺得你應該先去看看 insn-output.c 的那些行數的 source code 看看發生什麼事才對,畢竟這樣才能得到更精確的資訊,以上。

    Posted by sneseNo Gravatar | April 30, 2008, 11:37 pm
  8. I config and install simplescalar into SLES10. When do setup for “simpleutils-990811″,the configuration as above did successfully, but installation failed saying “ldlex.l:589: error: yy_current_buffer undeclared”. I think something error in the phase of configuration advanced.

    Please help!

    Posted by EetyChenNo Gravatar | June 27, 2008, 4:38 pm
  9. 你好,我在make simpleutils-990811 出現了這樣的問題,該怎麼解決呢??
    謝謝您
    /bin/sh ./../ylwrap “” arparse.y y.tab.c arparse.c y.tab.h arparse.h — -d
    ./../ylwrap: 86: -d: not found
    make[3]: *** [arparse.c] Error 1
    make[3]: Leaving directory `/home/cmusic100/simplescalar/simpleutils-990811/binutils’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/cmusic100/simplescalar/simpleutils-990811/binutils’
    make[1]: *** [all-recursive-am] Error 2
    make[1]: Leaving directory `/home/cmusic100/simplescalar/simpleutils-990811/binutils’

    Posted by cmusic100No Gravatar | August 21, 2008, 10:37 pm
  10. the same problem with sznd:

    strerror.c:467: 错误:对‘sys_nerr’的静态声明出现在非静态声明之后
    /usr/include/bits/sys_errlist.h:27: 错误:‘sys_nerr’的上一个声明在此
    strerror.c:468: 错误:与‘sys_errlist’类型冲突
    /usr/include/bits/sys_errlist.h:28: 错误:‘sys_errlist’的上一个声明在此
    make[1]: *** [strerror.o] 错误 1
    make[1]: Leaving directory `/ltt/software/simplescale/binutils-2.5.2/libiberty’
    make: *** [all-libiberty] 错误 2

    Posted by TinaNo Gravatar | November 9, 2008, 6:30 pm

Post a comment