I have been trying to build amd/amd-kria-k26 target on FreeBSD 15.1.
I am facing these errors:
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_addresses.o
>>> referenced by fdt_addresses.c:38 (libfdt/fdt_addresses.c:38)
>>> libfdt/fdt_addresses.o:(fdt_address_cells)
ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c:49 (libfdt/fdt_check.c:49)
>>> libfdt/fdt_check.o:(fdt_check_full)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_addresses.o
>>> referenced by fdt_addresses.c:50 (libfdt/fdt_addresses.c:50)
>>> libfdt/fdt_addresses.o:(fdt_size_cells)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x0)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x8)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x10)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x18)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x20)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x28)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_addresses.o
>>> referenced by fdt_addresses.c:38 (libfdt/fdt_addresses.c:38)
>>> libfdt/fdt_addresses.o:(fdt_appendprop_addrrange)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x30)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x38)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_check.o
>>> referenced by fdt_check.c
>>> libfdt/fdt_check.o:(.rodata+0x40)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_addresses.o
>>> referenced by fdt_addresses.c:50 (libfdt/fdt_addresses.c:50)
>>> libfdt/fdt_addresses.o:(fdt_appendprop_addrrange)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_strerror.o
>>> referenced by fdt_strerror.c:47 (libfdt/fdt_strerror.c:47)
>>> libfdt/fdt_strerror.o:(fdt_strerror)
ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_strerror.o
>>> referenced by fdt_strerror.c:53 (libfdt/fdt_strerror.c:53)
>>> libfdt/fdt_strerror.o:(fdt_strerror)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_strerror.o
>>> referenced by fdt_strerror.c:0 (libfdt/fdt_strerror.c:0)
>>> libfdt/fdt_strerror.o:(fdt_strerror)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_strerror.o
>>> referenced by fdt_strerror.c:0 (libfdt/fdt_strerror.c:0)
>>> libfdt/fdt_strerror.o:(fdt_strerror)
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_empty_tree.o
>>> referenced by fdt_empty_tree.c:25 (libfdt/fdt_empty_tree.c:25)
>>> libfdt/fdt_empty_tree.o:(fdt_create_empty_tree)
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in libfdt/fdt_strerror.o
>>> referenced by fdt_strerror.c
>>> libfdt/fdt_strerror.o:(fdt_errtable)
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:218: libfdt/libfdt.so.1.7.2] Error 1
shell cmd failed: /bin/sh -ex /home/me/GSOC_Work/rtems-deployment/build/dtc-1.7.2-x86_64-freebsd15.1-1/do-build
error: building dtc-1.7.2-x86_64-freebsd15.1-1
I was facing the same errors on freeBSD 15.0 as well. I updated to 15.1 but still facing same errors.
Here is the output of uname -a:
❯ uname -a
FreeBSD beepboop 15.1-RELEASE FreeBSD 15.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC amd64