gpt4 book ai didi

perl - 在 CentOS 8.1 上编译 perl Net::Interface 模块失败

转载 作者:行者123 更新时间:2023-12-04 10:05:49 34 4
gpt4 key购买 nike

我下载了源代码并尝试手动编译 perl Net::Interface 模块。使用 CPAN 安装模块会出现同样的错误。

wget http://search.cpan.org/CPAN/authors/id/M/MI/MIKER/Net-Interface-1.016.tar.gz
tar xvfz Net-Interface-1.016.tar.gz
cd Net-Interface-1.016
perl Makefile.PL

现在失败并出现以下错误

checking for getnameinfo... yes
checking whether byte ordering is bigendian... no
checking for uint8_t... yes
checking size of uint8_t... configure: error: cannot compute sizeof (uint8_t)
See `config.log' for more details.
could not open config.h

config.log 显示以下错误

configure:10128: result: yes
configure:10135: checking size of uint8_t
configure:10437: gcc -o conftest -g -O2 -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib conftest.c >&5
/usr/bin/ld: /tmp/ccXH6miX.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
configure:10440: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""

如何解决这个错误? config.log 似乎建议传递“-fPIC”标志,但我不确定如何传递?

谢谢。

最佳答案

/usr/bin/ld: /tmp/ccXH6miX.o: relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

出于某种原因,配置脚本需要使用 --enable-shared 运行(在 Ubuntu 上没有必要)。以下内容在 CentOS 8 的 docker 容器中对我有用:

./configure --enable-shared
perl -I. Makefile.PL
make
sudo make install

关于perl - 在 CentOS 8.1 上编译 perl Net::Interface 模块失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61597959/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com