|
From: Michael O. <198...@gm...> - 2018-09-29 07:47:18
|
Hi folks, FreeBSD is evaluting LLVM ld (lld) as its default linker on i386 and I am the port maintainer of JSW. It is a bit stricter and GNU ld and does not allow dynamic relocations in the readonly segment: > [exec] /usr/bin/ld: error: can't create dynamic relocation R_386_PC32 against symbol: strcmp in readonly segment; recompile object files with -fPIC > [exec] >>> defined in /lib/libc.so.7 > [exec] >>> referenced by wrapper_i18n.c > [exec] >>> wrapper_i18n.o:(multiByteToWideChar) > [exec] > [exec] /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: .L.str in readonly segment; recompile object files with -fPIC > [exec] >>> defined in wrapper_i18n.o > [exec] >>> referenced by wrapper_i18n.c > [exec] >>> wrapper_i18n.o:(multiByteToWideChar) > [exec] > [exec] /usr/bin/ld: error: can't create dynamic relocation R_386_PC32 against symbol: strcmp in readonly segment; recompile object files with -fPIC > [exec] >>> defined in /lib/libc.so.7 > [exec] >>> referenced by wrapper_i18n.c > [exec] >>> wrapper_i18n.o:(multiByteToWideChar) > [exec] >... There are now two approaches to solve this, either compile as position-independent code (-fPIC) or restore the previous behavior with "LDFLAGS=-Wl,-znotext". Since I cannot properly evaluate the impliciations, can you tell what would be the right choice here? I know that the amd64 target is already position-independent. See also the reference bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214864 Regards, Michael |