0

我正在运行 Ubuntu 16.04.1 的 odroidC2 板 (armv8-64bit) 上编译一些文件,但出现以下错误:

odroid@odroid64:~/flext-master/tutorial/simple1$ g++ -fPIC -L/usr/lib -pthread -shared -Wl,-S -L/usr/local/src/pd/bin -L/usr/local/lib -o pd-linux/release-single/simple1.pd_linux   pd-linux/release-single/main.opp  -lflext-pd_s 
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o)(.text+0x344): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

如您所见,存在 -fPIC 选项。所以我不明白为什么编译器建议“用-fPIC重新编译”。任何想法?

4

1 回答 1

2

问题不pd-linux/release-single/main.opp在于您正在编译的(顺便说一句,也许是 .cpp?)-fPIC,而libflext-pd_s.a在于包含libflext_pd_s_la-flxlet.o未编译的对象的存档中-fPIC,因此您需要正确重新编译 flext 库。

于 2016-08-12T20:48:30.353 回答