Richard Shaw wrote on 2022/05/10 12:07:
I'm working on some IIoT related packages in my COPR where I have a dynamic library linking to a static library and getting the following error:
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libmqttc.a(mqtt.c.o): warning: relocation against `mqtt_fixed_header_rules' in read-only section `.text' /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/libmqttc.a(mqtt.c.o): relocation R_X86_64_PC32 against symbol `mqtt_fixed_header_rules' can not be used when making a shared object; recompile with -fPIC
I added the following to the libmqttc library and verified -fPIC -pie is in the build flags[1] per the recommendation from the hardening page[2] but the error remains.
Any ideas?
Thanks, Richard
[1] https://download.copr.fedorainfracloud.org/results/hobbes1069/IIoT/fedora-ra...
This log no longer seems to exist.
[2] https://fedoraproject.org/wiki/Changes/Harden_All_Packages
Regards, Mamoru