[Linux] RockyLinux 9 編譯安裝 davfs2

Startu發表於2024-03-08

官網: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得到的

相關文章