FC2ブログ

[LM32]GNUツール(Cygwin)

mico32_gnutools_src_7.1.tar.gz
ソース一式(src_611.tar.bz2) LatticeMico32 GNU-Tools Source Code

・LatticeのHPで、GNU toolソースのありかを発見。
http://www.latticesemi.com/en/FileExplorer.aspx?media={2A9287FC-FC17-4466-8384-75532B42CA06}&document_id=29747


lm32-elf-gcc -c $src_name.c
lm32-elf-as startup.s -o startup.o
lm32-elf-ld -Map $src_name.map -T memory.def startup.o $src_name.o -o $src_name
lm32-elf-objcopy -O srec $src_name $src_name.srec
lm32-elf-objcopy -O ihex $src_name $src_name.hex



・ここに従い、Cygwinでやってみる。
http://www7b.biglobe.ne.jp/~denden/cross_compile/index.html

.bashrcへ追加。

■binutils

export PATH=/usr/local/lm32/bin:$PATH


x230: pwd
/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src
x230: ./binutils/configure --target=lm32-elf --prefix=/usr/local/lm32 --disable-nls
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... lm32-unknown-elf
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... dlltool
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... windres
checking for windmc... windmc
checking for objcopy... objcopy
checking for objdump... objdump
checking for lm32-elf-cc... no
checking for lm32-elf-gcc... no
checking for lm32-elf-c++... no
checking for lm32-elf-g++... no
checking for lm32-elf-cxx... no
checking for lm32-elf-gxx... no
checking for lm32-elf-gcc... no
checking for lm32-elf-gcj... no
checking for lm32-elf-gfortran... no
checking for lm32-elf-ar... no
checking for lm32-elf-as... no
checking for lm32-elf-dlltool... no
checking for lm32-elf-ld... no
checking for lm32-elf-lipo... no
checking for lm32-elf-nm... no
checking for lm32-elf-objdump... no
checking for lm32-elf-ranlib... no
checking for lm32-elf-strip... no
checking for lm32-elf-windres... no
checking for lm32-elf-windmc... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... just compiled
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target ld... just compiled
checking where to find the target lipo... pre-installed
checking where to find the target nm... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking where to find the target windmc... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
configure: creating ./config.status
config.status: creating Makefile
x230:



x230: cd binutils/
x230: make
  :
&& CONFIG_FILES=po/Makefile.in:po/Make-in \
CONFIG_HEADERS= /bin/sh ./config.status
config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd/po'
make[3]: Entering directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
Makefile:1081: recipe for target 'info-recursive' failed
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
Makefile:3034: recipe for target 'all-bfd' failed
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils'
Makefile:679: recipe for target 'all' failed
make: *** [all] Error 2



・エラーが。
https://sourceware.org/ml/binutils/2008-12/msg00158.html

ここにあったlm32.patch.gz は効くのかな?

patch -p0 < lm32.patch
-p0付けないと、いちいちFile to pathと聞かれた。このオプションで飛ばせるらしい。
Reverseなんちゃらと聞かれるので、ずっとEnter長押し(全てYesの意味)を押した。



・パッチ当ててからconfigure、makeとやったら、まだエラー。

else \
rc=$?; \
$restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
bfd.texinfo:326: unknown command `colophon'
bfd.texinfo:337: unknown command `cygnus'
./elf.texi:11: raising the section level of @subsubsection which is too low
Makefile:388: recipe for target 'bfd.info' failed
make[3]: *** [bfd.info] Error 1
make[3]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd/doc'
Making info in po
make[3]: Entering directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd/po'
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd/po'
make[3]: Entering directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
Makefile:1081: recipe for target 'info-recursive' failed
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils/bfd'
Makefile:3034: recipe for target 'all-bfd' failed
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/binutils'
Makefile:679: recipe for target 'all' failed
make: *** [all] Error 2


■gcc

x230: ./gcc/configure --prefix=/usr/local/lm32/ --target=lm32-elf --enable-languages=c --with-newlib --enable
-sjlj-exceptions --disable-nls --disable-libstdcxx-pch
configure: error: sjlj-exceptions --disable-nls: invalid feature name


x230: ./gcc/configure --prefix=/usr/local/lm32/ --target=lm32-elf --enable-languages=c --with-newlib --disabl
e-libstdcxx-pch
creating cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... lm32-unknown-elf
checking build system type... i686-pc-cygwin
checking for a BSD compatible install... /bin/install -c
*** This configuration is not supported in the following subdirectories:
target-libffi target-boehm-gc target-zlib target-libjava target-libstdc++-v3 target-libf2c zlib fastjar t
arget-libobjc
(Any other directories should still work fine.)
checking for i686-pc-cygwin-ar... no
checking for ar... ar
checking for i686-pc-cygwin-as... no
checking for as... as
checking for i686-pc-cygwin-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-cygwin-ld... no
checking for ld... ld
checking for i686-pc-cygwin-nm... no
checking for nm... nm
checking for i686-pc-cygwin-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-cygwin-windres... no
checking for windres... windres
checking for i686-pc-cygwin-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-cygwin-objdump... no
checking for objdump... objdump
checking for lm32-elf-ar... no
checking for lm32-elf-as... no
checking for lm32-elf-dlltool... no
checking for lm32-elf-ld... no
checking for lm32-elf-nm... no
checking for lm32-elf-ranlib... no
checking for lm32-elf-windres... no
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ./config.cache
creating ./config.status
creating Makefile
x230:



x230: ./newlib/configure --prefix=/usr/local/lm32/ --target=lm32-elf
loading cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... lm32-unknown-elf
checking build system type... i686-pc-cygwin
checking for a BSD compatible install... (cached) /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gnatbind... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
checking for bison... bison
checking for bison... bison -y
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for i686-pc-cygwin-ar... no
checking for ar... (cached) ar
checking for i686-pc-cygwin-as... no
checking for as... (cached) as
checking for i686-pc-cygwin-dlltool... no
checking for dlltool... (cached) dlltool
checking for i686-pc-cygwin-ld... no
checking for ld... (cached) ld
checking for i686-pc-cygwin-nm... no
checking for nm... (cached) nm
checking for i686-pc-cygwin-ranlib... no
checking for ranlib... (cached) ranlib
checking for i686-pc-cygwin-windres... no
checking for windres... (cached) windres
checking for i686-pc-cygwin-objcopy... no
checking for objcopy... (cached) objcopy
checking for i686-pc-cygwin-objdump... no
checking for objdump... (cached) objdump
checking for lm32-elf-ar... no
checking for lm32-elf-as... no
checking for lm32-elf-dlltool... no
checking for lm32-elf-ld... no
checking for lm32-elf-nm... no
checking for lm32-elf-ranlib... no
checking for lm32-elf-windres... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking if symbolic links between directories work... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
x230:



x230: ./gcc/configure --prefix=/usr/local/lm32/ --target=lm32-elf --enable-languages=c,c++ --with-newlib --en
able-sjlj-exceptions --disable-nls --disable-libstdcxx-pch
loading cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... lm32-unknown-elf
checking build system type... i686-pc-cygwin
checking for a BSD compatible install... (cached) /bin/install -c
*** This configuration is not supported in the following subdirectories:
target-libffi target-boehm-gc target-zlib target-libjava target-libf2c zlib fastjar target-libobjc
(Any other directories should still work fine.)
checking for i686-pc-cygwin-ar... no
checking for ar... (cached) ar
checking for i686-pc-cygwin-as... no
checking for as... (cached) as
checking for i686-pc-cygwin-dlltool... no
checking for dlltool... (cached) dlltool
checking for i686-pc-cygwin-ld... no
checking for ld... (cached) ld
checking for i686-pc-cygwin-nm... no
checking for nm... (cached) nm
checking for i686-pc-cygwin-ranlib... no
checking for ranlib... (cached) ranlib
checking for i686-pc-cygwin-windres... no
checking for windres... (cached) windres
checking for i686-pc-cygwin-objcopy... no
checking for objcopy... (cached) objcopy
checking for i686-pc-cygwin-objdump... no
checking for objdump... (cached) objdump
checking for lm32-elf-ar... no
checking for lm32-elf-as... no
checking for lm32-elf-dlltool... no
checking for lm32-elf-ld... no
checking for lm32-elf-nm... no
checking for lm32-elf-ranlib... no
checking for lm32-elf-windres... no
checking whether to enable maintainer-specific portions of Makefiles... no
creating ./config.status
creating Makefile
x230:



x230: ./gdb/configure --prefix=/usr/local/lm32/ --target=lm32-elf --disable-nls
loading cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... lm32-unknown-elf
checking build system type... i686-pc-cygwin
checking for a BSD compatible install... (cached) /bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gnatbind... no
checking whether compiler driver understands Ada... (cached) no
checking how to compare bootstrapped objects... (cached) cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for i686-pc-cygwin-ar... no
checking for ar... ar
checking for i686-pc-cygwin-as... no
checking for as... as
checking for i686-pc-cygwin-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-cygwin-ld... no
checking for ld... ld
checking for i686-pc-cygwin-lipo... no
checking for lipo... no
checking for i686-pc-cygwin-nm... no
checking for nm... nm
checking for i686-pc-cygwin-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-cygwin-strip... no
checking for strip... strip
checking for i686-pc-cygwin-windres... no
checking for windres... windres
checking for i686-pc-cygwin-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-cygwin-objdump... no
checking for objdump... objdump
checking for lm32-elf-cc... no
checking for lm32-elf-gcc... no
checking for lm32-elf-c++... no
checking for lm32-elf-g++... no
checking for lm32-elf-cxx... no
checking for lm32-elf-gxx... no
checking for lm32-elf-gcc... no
checking for lm32-elf-gcj... no
checking for lm32-elf-gfortran... no
checking for ar... no
checking for lm32-elf-ar... no
checking for as... no
checking for lm32-elf-as... no
checking for dlltool... no
checking for lm32-elf-dlltool... no
checking for ld... no
checking for lm32-elf-ld... no
checking for lipo... no
checking for lm32-elf-lipo... no
checking for nm... no
checking for lm32-elf-nm... no
checking for objdump... no
checking for lm32-elf-objdump... no
checking for ranlib... no
checking for lm32-elf-ranlib... no
checking for strip... no
checking for lm32-elf-strip... no
checking for windres... no
checking for lm32-elf-windres... no
checking where to find the target ar... pre-installed
checking where to find the target as... pre-installed
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... pre-installed
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target ld... pre-installed
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed
checking where to find the target objdump... pre-installed
checking where to find the target ranlib... pre-installed
checking where to find the target strip... pre-installed
checking where to find the target windres... pre-installed
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ./config.cache
creating ./config.status
creating Makefile
x230:



x230: make install-gdb install-sim
/bin/sh ./gdb/mkinstalldirs /usr/local/lm32/ /usr/local/lm32/
mkdir -p -- /usr/local/lm32/ /usr/local/lm32/
make[1]: Entering directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/gdb'
make[1]: *** No rule to make target 'install'. 中止.
make[1]: Leaving directory '/cygdrive/c/USER/work/lm32/gnu/mico32_gnutools_src_7.1/src/gdb'
Makefile:8188: recipe for target 'install-gdb' failed
make: *** [install-gdb] Error 2




以前はDESIGN WAVE MAGAZINE特集を見て、付属のデータで、次の手順でやってた履歴があった。

lm32-elf-gcc -c $src_name.c
lm32-elf-as startup.s -o startup.o
lm32-elf-ld -Map $src_name.map -T memory.def startup.o $src_name.o -o $src_name
lm32-elf-objcopy -O srec $src_name $src_name.srec
lm32-elf-objcopy -O ihex $src_name $src_name.hex




(2014.6.14追記)
http://www.das-labor.org/wiki/Soc-lm32/lm32-toolchain_install_the_crosscompiler
上からこれをもってくる。
Source (gcc3.4.6): lm32-src-patched

tar jxvfで解凍してからmakeする。Makefile見ると、binutils, gcc, newlibとmakeを実行すれば全てやってくれるみたい。

bob@x230 /usr/local/bin/lm32
$ make
./build-binutils.sh
creating cache ./config.cache
checking host system type... ../binutils/config.guess: unable to guess system type

This script, last modified 2004-11-12, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

ftp://ftp.gnu.org/pub/gnu/config/

If the version you run (../binutils/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to in order to provide the needed
information to handle your system.

config.guess timestamp = 2004-11-12

uname -m = x86_64
uname -r = 1.7.30(0.272/5/3)
uname -s = CYGWIN_NT-6.1
uname -v = 2014-05-23 10:36

/usr/bin/uname -p = unknown
/bin/uname -X =

hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = x86_64
/usr/bin/oslevel =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 1.7.30(0.272/5/3)
UNAME_SYSTEM = CYGWIN_NT-6.1
UNAME_VERSION = 2014-05-23 10:36
configure: error: can not guess host type; you must specify one
Makefile:9: recipe for target 'build-binutils.complete' failed
make: *** [build-binutils.complete] Error 1


このエラーが。Cygwinだから?
スポンサーサイト



カレンダー
04 | 2014/05 | 06
- - - - 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
累積訪問者
現在の訪問者
現在の閲覧者数:
最新記事
最新トラックバック
最新コメント
月別アーカイブ
カテゴリ
プロフィール

bobgosso

Author:bobgosso
FPGAのブログへようこそ!

検索フォーム
RSSリンクの表示
リンク
ブロとも申請フォーム

この人とブロともになる

QRコード
QRコード