编译 make 最后一步出现如下错误:
/bin/ld: dynamic STT_GNU_IFUNC symbol `mb_utf16be_to_wchar' with pointer equality in `ext/mbstring/libmbfl/filters/mbfilter_utf16.o' can not be used when making an executable; recompile with -fPIE and relink with -pie collect2: error: ld returned 1 exit status /bin/ld: dynamic STT_GNU_IFUNC symbol `mb_utf16be_to_wchar' with pointer equality in `ext/mbstring/libmbfl/filters/mbfilter_utf16.o' can not be used when making an executable; recompile with -fPIE and relink with -pie collect2: error: ld returned 1 exit status
解决方法:
编辑源代码目录下的 Makefile 文件
nano Makefile
找到以下两行:
CC = cc
BUILD_CC = cc
改成:
CC = cc -fPIE -pie
BUILD_CC = cc -fPIE -pie
重新 make 下就行了。
文章评论
https://bit.ly/3SWya9q Huge selection!
重新make报了新的错误
...
/usr/bin/ld: sapi/cli/ps_title.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: sapi/cli/php_cli_process_title.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
make: *** [Makefile:299: sapi/cli/php] Error 1
@匿名 me too
@匿名 make clean
make
我因为遇到这个错误,找到了这篇文章