[Linux] RockyLinux 9 编译安装 davfs2

官网:davfs2 - Summary [Savannah] (nongnu.org)
下载地址:Index of /releases/davfs2/ (nongnu.org)
下载最新版

wget https://download.savannah.nongnu.org/releases/davfs2/davfs2-1.7.0.tar.gz
tar zxvf davfs2-1.7.0.tar.gz
cd davfs2-1.7.0
mkdir build && cd build

CFLAGS="-fPIE" LDFLAGS="-fPIE" CPPFLAGS="-fPIE" ../configure

make -j8
make install

直接 ../configure 构建的时候会出现问题

/usr/bin/ld: cache.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: dav_fuse.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: kernel_interface.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: mount_davfs.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: webdav.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE

大概意思就是编译的文件和库文件使用了不匹配的pie选项,导致连接失败,所以需要指定-fPIE
这个选项是通过../configure --help得到的

如果你是其他项目出现了这个问题,也可以试着添加-no-pie选项,总之用到的库和可执行程序的pie选项要统一

作者:cjdty

出处:https://www.cnblogs.com/cjdty/p/18061134

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

posted @   Startu  阅读(291)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!
more_horiz
keyboard_arrow_up dark_mode palette
选择主题
点击右上角即可分享
微信分享提示