GCC无法制作32位可执行文件?

时间:2017-06-20 09:52:44

标签: linux ubuntu gcc

我在我的笔记本电脑上使用ubuntu 16.04和gcc版本6.3.0 20170519(Ubuntu / Linaro 6.3.0-18ubuntu2~16.04)安装asterisk服务器。通过运行以下命令集:

./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='O2 -DNDEBUG'

我收到以下错误:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
aconfigure: error: in `/usr/src/asterisk-13.16.0/pjproject':
aconfigure: error: C compiler cannot create executables
See `config.log' for more details

的config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by pjproject aconfigure 2.x, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./aconfigure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS=O2 -DNDEBUG

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

hostname = Linux-pc
uname -m = x86_64
uname -r = 4.4.0-75-generic
uname -s = Linux
uname -v = #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017

/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: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /snap/bin


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

aconfigure:2455: checking build system type
aconfigure:2469: result: x86_64-unknown-linux-gnu
aconfigure:2489: checking host system type
aconfigure:2502: result: x86_64-unknown-linux-gnu
aconfigure:2522: checking target system type
aconfigure:2535: result: x86_64-unknown-linux-gnu
aconfigure:2623: checking for gcc
aconfigure:2639: found /usr/bin/gcc
aconfigure:2650: result: gcc
aconfigure:2879: checking for C compiler version
aconfigure:2888: gcc --version >&5
gcc (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 6.3.0 20170519
Copyright (C) 2016 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.

aconfigure:2899: $? = 0
aconfigure:2888: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 6.3.0-18ubuntu2~16.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 
aconfigure:2899: $? = 0
aconfigure:2888: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
aconfigure:2899: $? = 1
aconfigure:2888: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
aconfigure:2899: $? = 1
aconfigure:2919: checking whether the C compiler works
aconfigure:2941: gcc O2 -DNDEBUG   conftest.c  >&5
gcc: error: O2: No such file or directory
aconfigure:2945: $? = 1
aconfigure:2983: result: no
aconfigure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pjproject"
| #define PACKAGE_TARNAME "pjproject"
| #define PACKAGE_VERSION "2.x"
| #define PACKAGE_STRING "pjproject 2.x"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
aconfigure:2988: error: in `/usr/src/asterisk-13.16.0/pjproject':
aconfigure:2990: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='O2 -DNDEBUG'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=x86_64-unknown-linux-gnu

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

AR=''
AR_FLAGS=''
CC='gcc'
CC_CFLAGS=''
CC_DEF=''
CC_INC=''
CC_OPTIMIZE=''
CC_OUT=''
CFLAGS='O2 -DNDEBUG'
CPP=''
CPPFLAGS=''
CXX=''
CXXFLAGS='O2 -DNDEBUG '
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
LD=''
LDFLAGS=''
LDOUT=''
LIBEXT2=''
LIBEXT=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='pjproject'
PACKAGE_STRING='pjproject 2.x'
PACKAGE_TARNAME='pjproject'
PACKAGE_URL=''
PACKAGE_VERSION='2.x'
PATH_SEPARATOR=':'
PKG_CONFIG=''
RANLIB=''
SAVED_PKG_CONFIG_PATH=''
SDL_CONFIG=''
SHELL='/bin/bash'
ac_android_cflags=''
ac_build_mak_vars=''
ac_cross_compile=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_external_gsm=''
ac_external_pa=''
ac_external_speex=''
ac_external_srtp=''
ac_ffmpeg_cflags=''
ac_ffmpeg_ldflags=''
ac_has_ffmpeg=''
ac_host=''
ac_ios_cflags=''
ac_libyuv_cflags=''
ac_libyuv_ldflags=''
ac_linux_poll=''
ac_main_obj=''
ac_no_g711_codec=''
ac_no_g7221_codec=''
ac_no_g722_codec=''
ac_no_gsm_codec=''
ac_no_ilbc_codec=''
ac_no_l16_codec=''
ac_no_large_filter=''
ac_no_opencore_amrnb=''
ac_no_opencore_amrwb=''
ac_no_opus=''
ac_no_silk=''
ac_no_small_filter=''
ac_no_speex_aec=''
ac_no_speex_codec=''
ac_no_ssl=''
ac_openh264_cflags=''
ac_openh264_ldflags=''
ac_os_objs=''
ac_pa_cflags=''
ac_pa_use_alsa=''
ac_pa_use_oss=''
ac_pjdir=''
ac_pjmedia_audiodev_objs=''
ac_pjmedia_resample=''
ac_pjmedia_snd=''
ac_pjmedia_video=''
ac_pjmedia_video_has_android=''
ac_pjmedia_video_has_ios=''
ac_pjmedia_video_has_qt=''
ac_qt_cflags=''
ac_resample_dll=''
ac_sdl_cflags=''
ac_sdl_ldflags=''
ac_shared_libraries=''
ac_shlib_suffix=''
ac_srtp_deinit_present=''
ac_srtp_shutdown_present=''
ac_v4l2_cflags=''
ac_v4l2_ldflags=''
ac_webrtc_cflags=''
ac_webrtc_ldflags=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libcrypto_present=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libssl_present=''
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
opencore_amrnb_h_present=''
opencore_amrnb_present=''
opencore_amrwb_dec_h_present=''
opencore_amrwb_dec_present=''
opencore_amrwb_enc_h_present=''
opencore_amrwb_enc_present=''
openssl_h_present=''
opus_h_present=''
opus_present=''
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
silk_h_present=''
silk_present=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='unknown'

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

/* confdefs.h */
#define PACKAGE_NAME "pjproject"
#define PACKAGE_TARNAME "pjproject"
#define PACKAGE_VERSION "2.x"
#define PACKAGE_STRING "pjproject 2.x"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

aconfigure: exit 77

我尝试过以下解决方案来解决这个问题:

1)再次安装GCC和G ++的更新版本

2)apt-get install libc6-dev:i386 gcc:i386 它返回:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc:i386 : Depends: cpp:i386 (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
            Depends: gcc-5:i386 (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

3)apt-get install gcc-multilib显示它已经安装

4)apt-get install lib32gcc-4.8-dev安装成功

5)通过使用gcc test.c -m32 -o test编译一个简单的测试文件返回:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status

我仍然无法摆脱这个问题。任何帮助??

0 个答案:

没有答案