Bug: ld.lld: error: relocation R_386_PC32 cannot be used against symbol rename; recompile with -fPIC
Status: RESOLVED
Priority: --
Resolution: FIXED
Created: 2021-03-18 09:31:13+00:00
Resolved: 2021-05-09 00:43:27+00:00

```
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:117 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:117)
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_fopen(char const*, char const*))
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol rename; recompile with -fPIC
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:156 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:156)
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_rename(char const*, char const*))
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol opendir; recompile with -fPIC
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:173 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:173)
[task 2021-03-18T05:06:04.556Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_opendir(char const*))
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol readdir; recompile with -fPIC
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:199 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:199)
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol readdir; recompile with -fPIC
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:199 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:199)
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  ld.lld: error: can't create dynamic relocation R_386_32 against symbol: .L.str in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> defined in /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:202 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:202)
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol strcmp; recompile with -fPIC
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.557Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:202 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:202)
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  ld.lld: error: can't create dynamic relocation R_386_32 against symbol: .L.str.1 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> defined in /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:202 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:202)
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol strcmp; recompile with -fPIC
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> referenced by file-utils.cpp:202 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/file-utils.cpp:202)
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol strlen; recompile with -fPIC
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> referenced by __string:370 (/builds/worker/fetches/clang/bin/../include/c++/v1/__string:370)
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol memcpy; recompile with -fPIC
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>> referenced by __string:386 (/builds/worker/fetches/clang/bin/../include/c++/v1/__string:386)
[task 2021-03-18T05:06:04.558Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_readdir_name(__dirstream*))
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol __xstat; recompile with -fPIC
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> referenced by stat.h:455 (/builds/worker/fetches/sysroot/usr/include/i386-linux-gnu/sys/stat.h:455)
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/file-utils.o:(rnp_filemtime(char const*))
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol malloc; recompile with -fPIC
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> referenced by list.cpp:75 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/list.cpp:75)
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/list.o:(list_do_insert(list_head**, list_item*, void const*, unsigned int))
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  ld.lld: error: relocation R_386_PC32 cannot be used against symbol calloc; recompile with -fPIC
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> defined in /builds/worker/fetches/sysroot/lib/i386-linux-gnu/libc.so.6
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>> referenced by list.cpp:67 (/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common/list.cpp:67)
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  >>>               /builds/worker/workspace/obj-build/comm/third_party/rnp/list.o:(list_do_insert(list_head**, list_item*, void const*, unsigned int))
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[task 2021-03-18T05:06:04.559Z] 05:06:04    ERROR -  make[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:545: librnp.so] Error 1
[task 2021-03-18T05:06:04.559Z] 05:06:04     INFO -  make[4]: Leaving directory '/builds/worker/workspace/obj-build/comm/third_party/rnp'
[task 2021-03-18T05:06:04.560Z] 05:06:04    ERROR -  make[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: comm/third_party/rnp/target] Error 2
```
The cause is probably these:
https://hg.mozilla.org/mozilla-central/log?rev=9f192e1b76d6
https://hg.mozilla.org/mozilla-central/log?rev=d624f866fbe0