[clang/lld 4.0.0 arm64] link failure in sys/boot/efi/loader

Dimitry Andric dim at FreeBSD.org
Mon Jan 23 18:38:07 UTC 2017


On 23 Jan 2017, at 16:27, Shawn Webb <shawn.webb at hardenedbsd.org> wrote:
> 
> Here's an interesting failure I'm seeing on HardenedBSD with clang 4.0.0
> bits mixed in:
> 
> ==== BEGIN LOG ====
> cc -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr -O2 -pipe -DHARDENEDBSD -DSKEIN_LOOP=111 -I/usr/src/sys/boot/efi/loader/../../arm64/libarm64 -msoft-float -mgeneral-regs-only -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/arm64 -I/usr/src/sys/boot/efi/loader/../include -I/usr/src/sys/boot/efi/loader/../include/arm64 -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include -I/usr/src/sys/boot/efi/loader/../../.. -I/usr/src/sys/boot/efi/loader/../../i386/libi386 -I/usr/src/sys/boot/efi/loader/../../zfs -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO_PCI -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/../../ficl/aarch64 -I/usr/src/sys/boot/efi/loader/../../fdt -I/usr/obj/usr/src/sys/boot/efi/loader/../../fdt -DLOADER_FDT_SUPPORT -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -I/usr/src/sys/boot/ficl -I/usr/src/sys/boot/ficl/aarch64 -I/usr/src/sys/boot/ficl/../common -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat -msoft-float -fshort-wchar -fPIC -g -DHAVE_LIBRESSL -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Qunused-arguments  -Wl,-T/usr/src/sys/boot/efi/loader/arch/arm64/ldscript.arm64 -Wl,-Bsymbolic -shared -nostdlib -Wl,-z,relro -Wl,-z,now -o loader.sym.full autoload.o bootinfo.o conf.o copy.o devicename.o main.o self_reloc.o smbios.o vers.o zfs.o skein.o skein_block.o exec.o start.o cache.o boot.o commands.o console.o devopen.o interp.o interp_backslash.o interp_parse.o ls.o misc.o module.o panic.o load_elf64.o reloc_elf64.o disk.o part.o crc32.o bcache.o interp_forth.o  /usr/obj/usr/src/sys/boot/efi/loader/../../ficl/libficl.a /usr/obj/usr/src/sys/boot/efi/loader/../libefi/libefi.a /usr/obj/usr/src/sys/boot/efi/loader/../../fdt/libfdt.a /usr/obj/usr/src/sys/boot/efi/loader/../../efi/fdt/libefi_fdt.a /usr/obj/usr/src/sys/boot/efi/loader/../../../../lib/libstand/libstand.a
> /usr/bin/ld: error: Section has flags incompatible with others with the same name autoload.o:(.text)
> /usr/bin/ld: error: /usr/src/sys/boot/ficl/ficl.c:(.rodata+0x0): can't create dynamic relocation R_AARCH64_ABS64 against local symbol in readonly segment defined in /usr/obj/usr/src/sys/boot/efi/loader/../../ficl/libficl.a(ficl.o)
> /usr/bin/ld: error: /usr/src/sys/boot/ficl/ficl.c:(.rodata+0x8): can't create dynamic relocation R_AARCH64_ABS64 against local symbol in readonly segment defined in /usr/obj/usr/src/sys/boot/efi/loader/../../ficl/libficl.a(ficl.o)

Not an AArch64 expert here, but if I understand correctly AArch64's
world must be linked with a ports version of binutils?  Ed, any clues
about this?  Then again, this could also point to some real problem with
the section flags.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20170123/b8ac6811/attachment.sig>


More information about the freebsd-toolchain mailing list