在过去的几个小时里,我对此束手无策,试图弄清楚到底发生了什么。我正在运行SLES12PHP服务器,并且需要从SP3连接到Microsoft SQL server数据库,我遵循微软的文档,直到它要求我运行以下命令:
pecl install sqlsrv该命令失败,并显示以下相关输出:
checking whether the C compiler works... no
configure: error: in `/tmp/pear/temp/pear-build-rootLa81RX/sqlsrv-5.3.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
rolling back 8 file operations
ERROR: `/tmp/pear/temp/sqlsrv/configure --with-php-config=/usr/bin/php-config' failed我很想在config.log上查看更详细的错误信息,但似乎在尝试失败后/tmp/pear/temp目录中的所有内容都会被立即删除,包括日志。在尝试诊断错误时,我尝试使用gcc构建以下C文件:
#include <stdio.h>
int main() { printf("hello world\n"); return 0; }并得到了同样奇怪的错误:
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/../../../../lib64/crt1.o: unrecognized relocation (0x2a) in section `.text'
/usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status在这一点上,我正式不知道在哪里可以尝试诊断这里实际发生了什么。
发布于 2018-07-25 02:28:03
重定位0x2a是R_X86_64_REX_GOTPCRELX,它用于创建某些可松弛的x86-64重定位(可通过链接器优化的重定位)。您至少需要binutils 2.26来处理这些目标文件。
https://stackoverflow.com/questions/51487366
复制相似问题