ld: fatal: file /usr/local/lib/libiconv.所以:错误的ELF类:ELFCLASS3



我正在尝试在Solaris sparc 10上构建PHP 7.4,但是我得到这个错误:

d_objects。lo Zend/zend_object_handlers。lo Zend/zend_objects_API。lo Zend/zend_default_classes。lo Zend/zend_inheritance。lo Zend/zend_smart_str。lo Zend/zend_cpuinfo。lo Zend/zend_execute。lo sapi/apache2handler/mod_php7。lo sapi/apache2handler/sapi_apache2。lo sapi/apache2handler/apache_config。lo sapi/apache2handler/php_functions。lo主要/internal_functions。l -lresolv -lrt - lconv -lintl -lrt -lnsl -lsocket - llgcc - libphp7.laLd: fatal: file/usr/local/lib/libiconv.所以:错误的ELF类:ELFCLASS32Ld: fatal:文件处理错误。没有输出写入.libs/libphp7.so***错误码1make:致命错误:libphp7.la命令失败

我的配置如下:

。/configure——disable-xmlwriter——disable-xmlreader——disable-simplexml——disable-xml——disable-dom——with-apxs2=/usr/apache2/bin/apxs——with-gd——with-zlib——disable-ipv6——with-jpeg-dir=/usr/local——with-png-dir=/usr/local——with-freetype-dir=/usr/local——with- pear——with-openssl——with-mysqli——enable-bcmath——enable-ctype——enable-mbstring——with-gettext——prefix=/usr/php——without-libxml OPENSSL_CFLAGS=-I/usr/include/openssl OPENSSL_LIBS=-L/usr/local/ssl/includeSQLITE_CFLAGS = - i/usr/php/include/php/ext SQLITE_LIBS = - l/usr/php/include/php/ext ZLIB_CFLAGS = - i/usr/包括ZLIB_LIBS = - l/usr/包括ONIG_CFLAGS = - i/usr/地方/include/php/ext/mbstring ONIG_LIBS = - l/地方/include/php/ext/mbstring
——with-external-pcre
——with-pcre-jit
PCRE2_LIBS = - l/app/INSTALL_FILES php-7.4.13/ext/pcre/pcre2lib
PCRE2_CFLAGS = - i/app/INSTALL_FILES php-7.4.13/ext/pcre/pcre2lib
SQLITE_LIBS = - l/app/INSTALL_FILES php-7.2.5/ext/sqlite3/libsqlite
SQLITE_CFLAGS = - i/app/INSTALL_FILES php-7.2.5/ext/sqlite3/libsqlite

环境设置如下:

$ env|grep LD

LDFLAGS = - l/opt/世界基督教联合会/lib/gcc - l/usr/地方/lib - r/opt/世界基督教联合会/lib/gcc

LD_LIBRARY_PATH_64 =/opt/世界基督教联合会/lib/sparcv9:/usr/地方/64/lib:/usr/sfw/lib/sparcv9

LD_LIBRARY_PATH =/opt/世界基督教联合会/bin/sparcv9:/opt/世界基督教联合会/lib/sparcv9:/usr/地方/include/php/ext/sqlite3/libsqlite:/opt/世界基督教联合会/lib:/usr/地方/64/lib:/usr/sfw/lib/sparcv9:/usr/apache2.2 pcre/lib/:/usr/apache2.2 apr_util/lib/:/usr/apache2.2/4月/lib

LD_LIBRARY_PATH_32 =/usr/地方/include/php/ext/sqlite3/libsqlite:/opt/世界基督教联合会/lib:/usr/apache2.2 pcre/lib/:/usr/apache2.2 apr_util/lib/:/usr/apache2.2/4月/lib

任何帮助都将非常感激,提前感谢:)

您正在使用以下环境变量集构建64位可执行文件:

LD LDFLAGS=-L/opt/csw/lib/gcc -L/usr/local/lib -R/opt/csw/lib/gcc

给出这个错误:

ld: fatal: file /usr/local/lib/libiconv.so: wrong ELF class: ELFCLASS32

/usr/local/lib/libiconv.so为32位共享对象。

在构建或运行64位二进制文件时,您可以从LD_*环境变量中删除包含32位二进制文件的目录,或者如果/usr/local/lib中有您需要的64位库,请确保这些目录的内容都是32位或64位的。

您需要读取环境变量Solaris 10ld.so.1手册页:

环境变量

每个环境变量都可以用_32_64来指定后缀。这使得环境变量分别特定于32位或64位进程。此环境变量将覆盖任何中的环境变量的无后缀版本的效果。指定的不带值的环境变量_32或_64后缀,有效地取消任何关联的通用环境变量设置。

你混合了很多LD_*环境变量,有或没有_32_64后缀,你需要清理并保持一致,这样你就不会把32位和64位的可执行文件混合在一起。

这看起来是完全错误的:

ZLIB_LIBS=-L/usr/include

库在/usr/include??

最新更新