お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2011-08-26 16:49:26

karateMan
メンバ
登録日: 2009-04-30

H8開発環境の構築 :binutilsとgccを再インストール

パソコン環境は
Dell Inspiron12
Ubuntu8.04Hardy (古いですが、アップデートするとパソコンが遅くなるのでそのままです)
gcc4.2.3
binutils-2.21.1

gccとbinutilsはインストール済みだったので、ダウングレードし、書籍(12ステップで作る組み込みOS自作入門)にあるバージョンを再インストール(ダウングレード)を試みました。再インストールせずとも環境設定が可能ならば、それに越したことはないんですが…

binutilsをインストールしようとすると…

[@xxxx ~/Download/binutils-2.19.1]$ ./configure --target=h8300-elf --
disable-nls
checking build system type... i686-pc-linux-gnulibc1
checking host system type... i686-pc-linux-gnulibc1
checking target system type... h8300-unknown-elf
checking for a BSD-compatible install... /usr/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... configure: error:
in `/home/soichi/Download/binutils-2.19.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.
[@xxxx ~/Download/binutils-2.19.1]$ make
make: *** ターゲットが指定されておらず, makefile も見つかりません.  中止.

となってしまいます。gcc-3.4.6も同様です。
なにが問題でしょうか?

インストール済みのものを削除したほうがいいでしょうか?

オフライン

 

#2 2011-08-26 17:48:18

weyk
メンバ
登録日: 2009-04-03

Re: H8開発環境の構築 :binutilsとgccを再インストール

 表示されているメッセージのとおり、config.logを確認してみてください。
(エラーの時は、そのまま無視して次のコマンド(今回の例ではmake)を実行したりしないほうが良いですよ。そのため、最低限、今実行したコマンドがエラーなのかそうではないのか、しっかり判断する必要があるかと思います。)
 見ても良くわからない場合には、投稿してみてください。短ければ全文を、長いようならファイルの終わりのほうの適当な範囲を掲載するのがよいかと思います。

 異なるアーキテクチャ(CPU)の環境を構築(コンパイラやライブラリ等)することになると思いますので、理解しつつ進めてゆくことをお勧めします(失敗した理由、成功した理由の両方。「よくわからないけどうまく行った」や「よくわからないけど先に進もう」は危険。)

オフライン

 

#3 2011-08-27 10:59:39

karateMan
メンバ
登録日: 2009-04-30

Re: H8開発環境の構築 :binutilsとgccを再インストール

返信ありがとうございます。そして情報不足に関して失礼しました。
以下にconfig.logを添付いたします。はっきり言って、サッパリ理解できません(汗)
長いので、2箇所ほど消した箇所があります。

#-------------------------------------------

  $ ./configure --target=h8300-elf --disable-nls

## --------- ##
## Platform. ##
## --------- ##

hostname = xxxx
uname -m = i686
uname -r = 2.6.24-19-lpia
uname -s = Linux
uname -v = #1 SMP Mon Nov 3 15:25:26 UTC 2008

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

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

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1549: checking build system type
configure:1567: result: i686-pc-linux-gnulibc1
configure:1602: checking host system type
configure:1616: result: i686-pc-linux-gnulibc1
configure:1624: checking target system type
configure:1638: result: h8300-unknown-elf
configure:1682: checking for a BSD-compatible install
configure:1748: result: /usr/bin/install -c
configure:1759: checking whether ln works
configure:1781: result: yes
configure:1785: checking whether ln -s works
configure:1789: result: yes
configure:2983: checking for gcc
configure:2999: found /usr/bin/gcc
configure:3009: result: gcc
configure:3255: checking for C compiler version
configure:3258: gcc --version </dev/null >&5
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3261: $? = 0
configure:3263: gcc -v </dev/null >&5
Using built-in specs.
Target: i686-linux-gnulp
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-arch=i686 --with-tune=i586 --enable-checking=release --build=i686-linux-gnulp --host=i686-linux-gnulp --target=i686-linux-gnulp
Thread model: posix
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
configure:3266: $? = 0
configure:3268: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:3271: $? = 1
configure:3294: checking for C compiler default output file name
configure:3297: gcc    conftest.c  >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:3300: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3338: error: in `/home/xxxx/Download/binutils-2.19.1':
configure:3341: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnulibc1

(…不必要な感じの部分なので、割愛しましたm(_ _)m)

ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=h8300-elf
ac_cv_host=i686-pc-linux-gnulibc1
ac_cv_host_alias=i686-pc-linux-gnulibc1
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=h8300-unknown-elf
ac_cv_target_alias=h8300-elf
acx_cv_prog_LN=ln

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AR_FOR_BUILD='$(AR)'

(…同じく割愛)

RPATH_ENVVAR=''
RUNTEST=''
SHELL='/bin/bash'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='./configure --target=h8300-elf --disable-nls'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_GNATBIND=''
ac_ct_GNATMAKE=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnulibc1'
build_alias=''
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnulibc1'
build_noncanonical='i686-pc-linux-gnulibc1'
build_os='linux-gnulibc1'
build_subdir='build-i686-pc-linux-gnulibc1'
build_tooldir=''
build_vendor='pc'
config_shell='/bin/bash'
configdirs='intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools'
datadir='${prefix}/share'
datarootdir=''
do_compare=''
docdir=''
exec_prefix='NONE'
gmpinc=''
gmplibs=''
host='i686-pc-linux-gnulibc1'
host_alias=''
host_configargs=''
host_cpu='i686'
host_noncanonical='i686-pc-linux-gnulibc1'
host_os='linux-gnulibc1'
host_subdir='.'
host_vendor='pc'
htmldir=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
pdfdir=''
prefix='NONE'
program_transform_name='s,^,h8300-elf-,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='h8300-unknown-elf'
target_alias='h8300-elf'
target_configargs=''
target_cpu='h8300'
target_noncanonical='h8300-elf'
target_os='elf'
target_subdir='h8300-elf'
target_vendor='unknown'
tooldir=''

## ------------- ##
## Output files. ##
## ------------- ##

alphaieee_frag=''
host_makefile_frag='config/mh-x86omitfp'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""

configure: exit 77

オフライン

 

#4 2011-08-27 14:03:14

weyk
メンバ
登録日: 2009-04-03

Re: H8開発環境の構築 :binutilsとgccを再インストール

この部分がエラーの詳細にあたるようです。

configure:3294: checking for C compiler default output file name
configure:3297: gcc    conftest.c  >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:3300: $? = 1
configure: failed program was:

エラーの原因は、「/usr/bin/ld: crt1.o: No such file: No such file or directory」(crt1.oのファイルが無い)ということなので、コンパイルに必要なパッケージが足らないのだと思います。
パッケージ「libc6-dev」をインストールしてみてください。

オフライン

 

#5 2011-08-27 14:36:28

karateMan
メンバ
登録日: 2009-04-30

Re: H8開発環境の構築 :binutilsとgccを再インストール

上手くいきました!ありがとうございます。

このあたりを勉強するに適した書籍などあるといいんですが…どなたか紹介していただけませんか?

オフライン

 

Board footer

Powered by FluxBB