The migration to the LLVM project's lld linker as the system linker (/usr/bin/ld) for FreeBSD is in progress - it is the case for arm64 and amd64 today, and i386 will switch once ports issues are addressed - see exp-run in PR214864. Linking graphics/freeimage with lld produces errors of the form: /usr/bin/ld: error: can't create dynamic relocation R_386_PC32 against symbol: malloc in readonly segment; recompile object files with -fPIC >>> defined in /lib/libc.so.7 >>> referenced by BitmapAccess.cpp >>> ./Source/FreeImage/BitmapAccess.o:(FreeImage_Aligned_Malloc(unsigned int, unsigned int)) /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: .L.str.1 in readonly segment; recompile object files with -fPIC >>> defined in ./Source/FreeImage/BitmapAccess.o >>> referenced by BitmapAccess.cpp >>> ./Source/FreeImage/BitmapAccess.o:(FreeImage_Aligned_Malloc(unsigned int, unsigned int)) http://package18.nyi.freebsd.org/data/headi386PR214864-default/2018-07-30_18h09m59s/logs/errors/freeimage-3.16.0_6.log
How do i test this and see if I can fix it?
(In reply to Nathan from comment #1) Nevermind found out how
@Ed Can you retest this as I've updated this port since and forcing LLD as linker, I don't get an error on i386
(In reply to Nathan from comment #3) Yup. Retested again, this time while running inside 12-386, also inside 11.2-386; moving /usr/bin/ld.lld /usr/bin/ld I got no linker error BTW, looks like it is compiling the code with -fPIC now Since this bug report, port has been updated in r479150
Confirmed, head builds on i386 with lld as /usr/bin/ld now.