xdebug - 错误的ELF类:ELFCLASS64

时间:2012-11-08 16:36:24

标签: gcc xdebug

我正在尝试在x64 Arch Linux上运行xdebug,但没有成功。我安装了它,现在当我尝试运行灯泡时,它说:

Failed loading /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so:/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so: wrong ELF class: ELFCLASS64

我做了一些搜索,发现我需要再次下载xdebug,将其编译为x64并将xdebug.so文件移动到lampp中的文件夹中。

http://www.designified.com/blog/article/60/compiling-installing-xdebug-for-php-525-entropych-build-on-os-x-105

How to use "make" to use 64 bit libs because of ELFCLASS64 error

我已经尝试根据第一个链接的指南编译它:

CFLAGS='-arch x86_64' ./configure --enable-xdebug

以及这些参数:

./configure --enable-xdebug "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --with-php-config=/opt/lampp/bin/php-config

但我遇到了这个问题:

configure: 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 configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --enable-xdebug

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

hostname = michal-ntb
uname -m = x86_64
uname -r = 3.6.5-1-ARCH
uname -s = Linux
uname -v = #1 SMP PREEMPT Wed Oct 31 20:57:39 CET 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: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/bin/core_perl


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

configure:2293: checking for grep that handles long lines and -e
configure:2351: result: /usr/bin/grep
configure:2356: checking for egrep
configure:2418: result: /usr/bin/grep -E
configure:2423: checking for a sed that does not truncate output
configure:2477: result: /bin/sed
configure:2609: checking for cc
configure:2625: found /usr/bin/cc
configure:2636: result: cc
configure:2667: checking for C compiler version
configure:2676: cc --version >&5
cc (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:2687: $? = 0
configure:2676: cc -v >&5
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7.2/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --disable-ppl-version-check --disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --disable-multilib --disable-libssp --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-checking=release
Thread model: posix
gcc version 4.7.2 (GCC) 
configure:2687: $? = 0
configure:2676: cc -V >&5
cc: error: unrecognized command line option '-V'
cc: fatal error: no input files
compilation terminated.
configure:2687: $? = 1
configure:2676: cc -qversion >&5
cc: error: unrecognized command line option '-qversion'
cc: fatal error: no input files
compilation terminated.
configure:2687: $? = 1
configure:2707: checking whether the C compiler works
configure:2729: cc -arch x86_64   conftest.c  >&5
cc: error: unrecognized command line option '-arch'
cc: error: x86_64: No such file or directory
configure:2733: $? = 1
configure:2771: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2776: error: in `/home/michal/TEMP/xdebug-2.2.1':
configure:2778: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-arch x86_64'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_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_path_EGREP='/usr/bin/grep -E'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_prog_ac_ct_CC=cc
lt_cv_path_SED=/bin/sed

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

AR=''
AWK=''
CC='cc'
CFLAGS='-arch x86_64'
CONFIGURE_COMMAND=' '\''./configure'\''  '\''--enable-xdebug'\'''
CONFIGURE_OPTIONS=' '\''--enable-xdebug'\'''
CPP=''
CPPFLAGS=''
DEFS=''
DSYMUTIL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
GREP='/usr/bin/grep'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
NMEDIT=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RE2C=''
SED='/bin/sed'
SHELL='/bin/sh'
SHLIB_DL_SUFFIX_NAME=''
SHLIB_SUFFIX_NAME=''
STRIP=''
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''

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

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

configure: exit 77

我一直在寻找几个小时的解决方案,找到了一些类似的主题(比如this),但它没有帮助。

感谢您提出建议和意见。

2 个答案:

答案 0 :(得分:2)

在互联网上进行快速查询,结果发现,当我在64 bit Linux上运行时,我编译了64 bit xdebug.so版本的Xampp

32 bit运行{{1}}所需的是预编译的32位版本

我找到了解决方案here

答案 1 :(得分:0)

问题解决了。 :-)显然编译时出错:

/usr/bin/ld: cannot find -lgcc

我通过从官方的Arch linux multilib存储库安装gcc-multilib包解决了这个问题。

对于编译,我使用了以下参数:

./configure --enable-xdebug "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --with-php-config=/opt/lampp/bin/php-config