[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
选项要统一