LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-28-2010, 12:10 PM   #1
sdt
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Problem building gcc 4.4.3 cross-compiler on Fedora 12


Hi, I am trying to build a gcc 4.4.3 cross-compiler. I downloaded the gcc 4.4.3 release, uncompressed it, made a new directory called gccbuild and cd'd there. I have already installed gmp, mpfr, and mpc in /usr/local

These are the commands I used:
Code:
configure --target=arm-linux --enable-languages=c --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local

make
However, the build fails with
Code:
checking for arm-linux-gcc... /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include
checking for suffix of object files... configure: error: in `/home/steven/gccbuild/arm-linux/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/home/steven/gccbuild'
make: *** [all] Error 2
Output from gcc -v:
Code:
Using built-in specs.
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.4.2 20091222 (Red Hat 4.4.2-20) (GCC)
What am I doing wrong and how can I fix this? Thanks.

Here is the relevant config.log
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Runtime Library configure 1.0, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ /home/steven/gcc-4.4.3/libgcc/configure --cache-file=./config.cache --enable-multilib --with-cross-host=i686-pc-linux-gnu --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-languages=c --program-transform-name=s,^,arm-linux-, --with-target-subdir=arm-linux --build=i686-pc-linux-gnu --host=arm-linux --target=arm-linux --srcdir=../../../gcc-4.4.3/libgcc

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

hostname = trilby.yukata
uname -m = i686
uname -r = 2.6.31.12-174.2.3.fc12.i686
uname -s = Linux
uname -v = #1 SMP Mon Jan 18 20:22:46 UTC 2010

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

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

PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /home/steven/bin


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

configure:1199: creating cache ./config.cache
configure:1388: checking for --enable-version-specific-runtime-libs
configure:1403: result: no
configure:1435: checking for a BSD-compatible install
configure:1490: result: /usr/bin/install -c
configure:1506: checking for gawk
configure:1522: found /usr/bin/gawk
configure:1532: result: gawk
configure:1555: checking build system type
configure:1573: result: i686-pc-linux-gnu
configure:1581: checking host system type
configure:1595: result: arm-unknown-linux-gnu
configure:1654: checking for arm-linux-ar
configure:1680: result: arm-linux-ar
configure:1733: checking for arm-linux-lipo
configure:1759: result: arm-linux-lipo
configure:1813: checking for arm-linux-nm
configure:1839: result: /home/steven/gccbuild/./gcc/nm
configure:1892: checking for arm-linux-ranlib
configure:1918: result: arm-linux-ranlib
configure:1972: checking for arm-linux-strip
configure:1998: result: arm-linux-strip
configure:2049: checking whether ln -s works
configure:2053: result: yes
configure:2070: checking for arm-linux-gcc
configure:2096: result: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include
configure:2380: checking for C compiler version
configure:2383: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include --version </dev/null >&5
xgcc (GCC) 4.4.3
Copyright (C) 2010 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:2386: $? = 0
configure:2388: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include -v </dev/null >&5
Reading specs from /home/steven/gccbuild/./gcc/specs
Target: arm-linux
Configured with: ../gcc-4.4.3/configure --target=arm-linux --enable-languages=c --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local
Thread model: posix
gcc version 4.4.3 (GCC) 
configure:2391: $? = 0
configure:2393: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include -V </dev/null >&5
xgcc: '-V' must come at the start of the command line
configure:2396: $? = 1
configure:2415: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include -o conftest -g -O2     conftest.c  >&5
/home/steven/gccbuild/./gcc/as: line 76: exec: : not found
configure:2418: $? = 1
configure:2590: checking for suffix of object files
configure:2611: /home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include -c -g -O2    conftest.c >&5
/home/steven/gccbuild/./gcc/as: line 76: exec: : not found
configure:2614: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2627: error: in `/home/steven/gccbuild/arm-linux/libgcc':
configure:2630: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

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

ac_cv_build=i686-pc-linux-gnu
ac_cv_build_alias=i686-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -O2  '
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i686-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-linux
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=arm-linux
ac_cv_host=arm-unknown-linux-gnu
ac_cv_host_alias=arm-linux
ac_cv_prog_AR=arm-linux-ar
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include'
ac_cv_prog_LIPO=arm-linux-lipo
ac_cv_prog_NM=/home/steven/gccbuild/./gcc/nm
ac_cv_prog_RANLIB=arm-linux-ranlib
ac_cv_prog_STRIP=arm-linux-strip

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

AR='arm-linux-ar'
AWK='gawk'
CC='/home/steven/gccbuild/./gcc/xgcc -B/home/steven/gccbuild/./gcc/ -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -isystem /usr/local/arm-linux/sys-include'
CFLAGS='-g -O2  '
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='arm-linux-lipo'
LN_S='ln -s'
LTLIBOBJS=''
NM='/home/steven/gccbuild/./gcc/nm'
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='GNU C Runtime Library'
PACKAGE_STRING='GNU C Runtime Library 1.0'
PACKAGE_TARNAME='libgcc'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
RANLIB='arm-linux-ranlib'
SHELL='/bin/sh'
STRIP='arm-linux-strip'
ac_ct_AR=''
ac_ct_CC=''
ac_ct_LIPO=''
ac_ct_NM=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias='i686-pc-linux-gnu'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-i686-pc-linux-gnu'
build_vendor='pc'
datadir='${prefix}/share'
decimal_float=''
enable_decimal_float=''
enable_shared='yes'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
host='arm-unknown-linux-gnu'
host_alias='arm-linux'
host_cpu='arm'
host_noncanonical='arm-linux'
host_os='linux-gnu'
host_subdir='.'
host_vendor='unknown'
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libgcc_topdir='../../../gcc-4.4.3/libgcc/..'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,^,arm-linux-,'
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
sharedstatedir='${prefix}/com'
slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
sysconfdir='${prefix}/etc'
target_alias='arm-linux'
target_subdir='arm-linux'
tmake_file=''
vis_hide=''

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

#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "GNU C Runtime Library"
#define PACKAGE_STRING "GNU C Runtime Library 1.0"
#define PACKAGE_TARNAME "libgcc"
#define PACKAGE_VERSION "1.0"

configure: exit 1
 
Old 03-28-2010, 03:10 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I strongly recommend using a tool that has built-in knowledge of cross toolchain building. The one I use is crosstool-NG, which is currently supported and has an active mailing list support community. Using such a tool makes the plethora of problems such as you have encountered disappear, mostly. Having said this, I found that using it on Fedora 11 and earlier releases, as well as all RHEL releases did not work due to some older or missing dependencies. My preferred platform for cross toolchain building is Debian (5.02).


--- rod.
 
Old 03-28-2010, 03:14 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

There is no such thing as a standalone cross-compiler (arm-linux-gcc).
A complete tool chain is required. Simplified example :
http://www.gnuarm.com/
http://www.gnuarm.com/support.html#build
Minimum : 1) First thing to build is the "arm binutils"
2) gcc , 3) A libc, one of: glibc, newlib, eglibc, uClibc, etc.
4) And may be a debugger : gdb or insight.
If you are very skilled at building cross compilers, it is said
to be possible to do in about a week.

Therefore a build tool like crosstool-NG is to be preferred,
and recommended. Already said by @theNbomr, while I wrote this.
It is continiously maintained, the last update was two weeks ago.
http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
http://ymorin.is-a-geek.org/dokuwiki...load_and_usage
hg clone http://ymorin.is-a-geek.org/hg/crosstool-ng
The package 'mercurial' providing /usr/bin/hg is required.
.....

Last edited by knudfl; 03-29-2010 at 10:23 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
building cross compiler, having issues moonlightcheese *BSD 1 09-13-2008 02:09 AM
Troubles in building cross compiler (error @ binutils) saistain Linux - Software 3 10-15-2007 06:37 AM
glib Error: while building Cross-Compiler for PPC Dhana_pal Linux From Scratch 2 12-28-2006 12:57 AM
Building cross-compiler gcc for powerpc-linux ccool Linux - General 3 09-17-2004 06:33 AM
Building an ARM7 cross compiler from gcc Charlie_B Linux - Software 2 08-20-2003 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration