2012-10-05 68 views
3

我試圖構建gcc。有了這個參數:在Ubuntu 12.04.1下構建cross-gcc 4.7.2

AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \ 
    ../gcc-4.7.2/configure --prefix=${CLFS}/cross-tools \ 
    --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \ 
    --with-sysroot=${CLFS} --disable-nls --disable-shared \ 
    --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \ 
    --with-mpc=${CLFS}/cross-tools --without-headers --with-newlib \ 
    --disable-decimal-float --disable-libgomp --disable-libmudflap \ 
    --disable-libssp --disable-threads --enable-languages=c \ 
    --disable-multilib --with-abi=${CLFS_ABI} --with-arch=${CLFS_ARM_ARCH} \ 
    --with-mode=${CLFS_ARM_MODE} --with-float=${CLFS_FLOAT} \ 
    --with-fpu=${CLFS_FPU} 

這是我的.bashrc:

checking for arm-unknown-linux-uclibceabi-gcc... /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include 
checking for suffix of object files... configure: error: in `/mnt/clfs/sources/gcc-build/arm-unknown-linux-uclibceabi/libgcc': 
configure: error: cannot compute suffix of object files: cannot compile 
See `config.log' for more details. 
make: *** [configure-target-libgcc] Error 1 

/mnt/clfs/sources/gcc-build/arm-unknown-linux-uclibceabi/libgcc內容是:

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.64. Invocation command line was 

    $ /mnt/clfs/sources/gcc-4.7.2/libgcc/configure --cache-file=./config.cache --with-cross-host=i686-cross-linux-gnu --prefix=/mnt/clfs/cross-tools --with-sysroot=/mnt/clfs --disable-nls --disable-shared --without-headers --with-newlib --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-threads --disable-multilib --with-abi=aapcs-linux --with-arch=armv7 --with-mode=arm --with-float=hard --with-fpu=neon --enable-languages=c,lto --program-transform-name=s&^&arm-unknown-linux-uclibceabi-& --disable-option-checking --with-target-subdir=arm-unknown-linux-uclibceabi --build=i686-cross-linux-gnu --host=arm-unknown-linux-uclibceabi --target=arm-unknown-linux-uclibceabi --srcdir=../../../gcc-4.7.2/libgcc 

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

hostname = beagleboardlinux 
uname -m = i686 
uname -r = 3.2.0-31-generic-pae 
uname -s = Linux 
uname -v = #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 2012 

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

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

PATH: /mnt/clfs/cross-tools/bin 
PATH: /bin 
PATH: /usr/bin 


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

configure:1976: creating cache ./config.cache 
configure:2144: checking build system type 
configure:2158: result: i686-cross-linux-gnu 
configure:2178: checking host system type 
configure:2191: result: arm-unknown-linux-uclibceabi 
configure:2289: checking for --enable-version-specific-runtime-libs 
configure:2302: result: no 
configure:2350: checking for a BSD-compatible install 
configure:2418: result: /usr/bin/install -c 
configure:2434: checking for gawk 
configure:2461: result: gawk 
configure:2561: checking for arm-unknown-linux-uclibceabi-ar 
configure:2588: result: /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ar 
configure:2653: checking for arm-unknown-linux-uclibceabi-lipo 
configure:2680: result: arm-unknown-linux-uclibceabi-lipo 
configure:2745: checking for arm-unknown-linux-uclibceabi-nm 
configure:2772: result: /mnt/clfs/sources/gcc-build/./gcc/nm 
configure:2837: checking for arm-unknown-linux-uclibceabi-ranlib 
configure:2864: result: /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ranlib 
configure:2929: checking for arm-unknown-linux-uclibceabi-strip 
configure:2956: result: /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/strip 
configure:3018: checking whether ln -s works 
configure:3022: result: yes 
configure:3039: checking for arm-unknown-linux-uclibceabi-gcc 
configure:3066: result: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include 
configure:3335: checking for C compiler version 
configure:3344: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include --version >&5 
xgcc (GCC) 4.7.2 
Copyright (C) 2012 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:3355: $? = 0 
configure:3344: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include -v >&5 
Reading specs from /mnt/clfs/sources/gcc-build/./gcc/specs 
COLLECT_GCC=/mnt/clfs/sources/gcc-build/./gcc/xgcc 
COLLECT_LTO_WRAPPER=/mnt/clfs/sources/gcc-build/./gcc/lto-wrapper 
Target: arm-unknown-linux-uclibceabi 
Configured with: ../gcc-4.7.2/configure --prefix=/mnt/clfs/cross-tools --build=i686-cross-linux-gnu --host=i686-cross-linux-gnu --target=arm-unknown-linux-uclibceabi --with-sysroot=/mnt/clfs --disable-nls --disable-shared --with-mpfr=/mnt/clfs/cross-tools --with-gmp=/mnt/clfs/cross-tools --with-mpc=/mnt/clfs/cross-tools --without-headers --with-newlib --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-threads --enable-languages=c --disable-multilib --with-abi=aapcs-linux --with-arch=armv7 --with-mode=arm --with-float=hard --with-fpu=neon 
Thread model: single 
gcc version 4.7.2 (GCC) 
configure:3355: $? = 0 
configure:3344: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include -V >&5 
xgcc: error: unrecognized command line option '-V' 
xgcc: fatal error: no input files 
compilation terminated. 
configure:3355: $? = 1 
configure:3344: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include -qversion >&5 
xgcc: error: unrecognized command line option '-qversion' 
xgcc: fatal error: no input files 
compilation terminated. 
configure:3355: $? = 1 
configure:3371: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include -o conftest -g -O2 conftest.c >&5 
conftest.c:1:0: error: target CPU does not support ARM mode 
configure:3374: $? = 1 
configure:3562: checking for suffix of object files 
configure:3584: /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include -c -g -O2 conftest.c >&5 
conftest.c:1:0: error: target CPU does not support ARM mode 
configure:3588: $? = 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 "" 
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" 
| /* end confdefs.h. */ 
| 
| int 
| main() 
| { 
| 
| ; 
| return 0; 
| } 
configure:3602: error: in `/mnt/clfs/sources/gcc-build/arm-unknown-linux-uclibceabi/libgcc': 
configure:3605: error: cannot compute suffix of object files: cannot compile 
See `config.log' for more details. 

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

ac_cv_build=i686-cross-linux-gnu 
ac_cv_env_CC_set=set 
ac_cv_env_CC_value=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/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_LIBS_set= 
ac_cv_env_LIBS_value= 
ac_cv_env_build_alias_set=set 
ac_cv_env_build_alias_value=i686-cross-linux-gnu 
ac_cv_env_host_alias_set=set 
ac_cv_env_host_alias_value=arm-unknown-linux-uclibceabi 
ac_cv_env_target_alias_set=set 
ac_cv_env_target_alias_value=arm-unknown-linux-uclibceabi 
ac_cv_host=arm-unknown-linux-uclibceabi 
ac_cv_path_install='/usr/bin/install -c' 
ac_cv_prog_AR=/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ar 
ac_cv_prog_AWK=gawk 
ac_cv_prog_CC=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include ' 
ac_cv_prog_LIPO=arm-unknown-linux-uclibceabi-lipo 
ac_cv_prog_NM=/mnt/clfs/sources/gcc-build/./gcc/nm 
ac_cv_prog_RANLIB=/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ranlib 
ac_cv_prog_STRIP=/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/strip 

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

AR='/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ar' 
AWK='gawk' 
CC=' /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/sys-include ' 
CFLAGS='-g -O2' 
CPP='' 
CPPFLAGS='' 
DEFS='' 
ECHO_C='' 
ECHO_N='-n' 
ECHO_T='' 
EXEEXT='' 
INSTALL_DATA='${INSTALL} -m 644' 
INSTALL_PROGRAM='${INSTALL}' 
INSTALL_SCRIPT='${INSTALL}' 
LDFLAGS='' 
LIBOBJS='' 
LIBS='' 
LIPO='arm-unknown-linux-uclibceabi-lipo' 
LN_S='ln -s' 
LTLIBOBJS='' 
MAINT='#' 
NM='/mnt/clfs/sources/gcc-build/./gcc/nm' 
OBJEXT='' 
PACKAGE_BUGREPORT='' 
PACKAGE_NAME='GNU C Runtime Library' 
PACKAGE_STRING='GNU C Runtime Library 1.0' 
PACKAGE_TARNAME='libgcc' 
PACKAGE_URL='http://www.gnu.org/software/libgcc/' 
PACKAGE_VERSION='1.0' 
PATH_SEPARATOR=':' 
PICFLAG='-fPIC' 
RANLIB='/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/ranlib' 
SHELL='/bin/bash' 
STRIP='/mnt/clfs/cross-tools/arm-unknown-linux-uclibceabi/bin/strip' 
ac_ct_CC='' 
asm_hidden_op='' 
bindir='${exec_prefix}/bin' 
build='i686-cross-linux-gnu' 
build_alias='i686-cross-linux-gnu' 
build_cpu='i686' 
build_libsubdir='build-i686-cross-linux-gnu' 
build_os='linux-gnu' 
build_subdir='build-i686-cross-linux-gnu' 
build_vendor='cross' 
cpu_type='' 
datadir='${datarootdir}' 
datarootdir='${prefix}/share' 
decimal_float='' 
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' 
double_type_size='' 
dvidir='${docdir}' 
enable_decimal_float='no' 
enable_shared='no' 
exec_prefix='NONE' 
extra_parts='' 
fixed_point='' 
host='arm-unknown-linux-uclibceabi' 
host_alias='arm-unknown-linux-uclibceabi' 
host_cpu='arm' 
host_noncanonical='arm-unknown-linux-uclibceabi' 
host_os='linux-uclibceabi' 
host_subdir='.' 
host_vendor='unknown' 
htmldir='${docdir}' 
includedir='${prefix}/include' 
infodir='${datarootdir}/info' 
libdir='${exec_prefix}/lib' 
libexecdir='${exec_prefix}/libexec' 
libgcc_topdir='../../../gcc-4.7.2/libgcc/..' 
localedir='${datarootdir}/locale' 
localstatedir='${prefix}/var' 
long_double_type_size='' 
mandir='${datarootdir}/man' 
oldincludedir='/usr/include' 
pdfdir='${docdir}' 
prefix='/mnt/clfs/cross-tools' 
program_transform_name='s&^&arm-unknown-linux-uclibceabi-&' 
psdir='${docdir}' 
sbindir='${exec_prefix}/sbin' 
set_have_cc_tls='' 
set_use_emutls='' 
sfp_machine_header='' 
sharedstatedir='${prefix}/com' 
slibdir='$(exec_prefix)/$(host_noncanonical)/lib' 
sysconfdir='${prefix}/etc' 
target_alias='arm-unknown-linux-uclibceabi' 
target_noncanonical='arm-unknown-linux-uclibceabi' 
target_subdir='arm-unknown-linux-uclibceabi' 
tm_defines='' 
tm_file='' 
tmake_file='' 
toolexecdir='$(exec_prefix)/$(target_noncanonical)' 
toolexeclibdir='$(toolexecdir)/lib' 
vis_hide='' 

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

/* 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 "" 
#define PACKAGE_URL "http://www.gnu.org/software/libgcc/" 

configure: exit 1 

export CLFS_ABI="aapcs-linux" 
export CLFS_HOST="i686-cross-linux-gnu" 
export CLFS_TARGET="arm-unknown-linux-uclibceabi" 
export CLFS_ARCH="arm" 
export CLFS_ENDIAN="little" 
export CLFS_ARM_ARCH="armv7" 
export CLFS_ARM_MODE="arm" 
export CLFS_FLOAT="hard" 
export CLFS_FPU="neon" 

它總是與此消息失敗

你有什麼想法?

回答

0

this website他們說我需要這樣的配置:ARMv7-A Thumb-2 - Little-Endian, Soft-Float, GLIBC我的BeagleBoard-XM ..因爲它擁有的ARM Cortex-A8

0

這在FAQ中回答,請參閱http://gcc.gnu.org/wiki/FAQ#configure_suffix - 答案是幾乎可以肯定的是,你沒有設置LD_LIBRARY_PATH=${CLFS}/cross-tools

解決方法是設置它,而是跟隨在http://gcc.gnu.org/wiki/InstallingGCC關於安裝GMP的說明,MPFR和MPC:可以從Ubuntu軟件包管理器(例如Synaptic或其它軟件)安裝它們,或者使用download_prerequisites腳本。 請勿將安裝在${CLFS}/cross-tools中,否則您只會遇到困難。

+0

我設置'LD_LIBRARY_PATH = $ {CLFS} /跨tools'我的'〜/.bashrc'仍然是同樣的錯誤..我遵循這個[教程](http://cross-lfs.org/view/clfs-embedded/arm/index.html)..所以我有mpfr,gmp,mpc * .so文件位於$ {CLFS}/cross-tools/lib中。我應該在哪裏安裝它們? – Pascal

+0

您是否也'出口'env變量?如果不是這就是它失敗的原因。但正如我所說,這不是正確的答案。 _「我應該在哪裏安裝它們?」_ **不要**將它們安裝在任何地方!只需運行'download_prerequisites'腳本。請閱讀我發送的第二個鏈接。我寫了那個頁面,所以我不必一直向所有人重複信息。如果你遵循這些指示,它將起作用。 –

+0

我只是喜歡你說的嗎。我下載了gcc-4.7.2解壓縮並運行download_prerequisites ....仍然是相同的錯誤 – Pascal

相關問題