freebsd / crochet

Build FreeBSD images for RaspberryPi, BeagleBone, PandaBoard, and others.
BSD 2-Clause "Simplified" License
611 stars 187 forks source link

libstand.a: could not read symbols #103

Closed f-andrey closed 9 years ago

f-andrey commented 9 years ago

Hello, I am faced with the fact that is not possible to build an image for RaspberryPi (r281940).

My system

# uname -a
FreeBSD des.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r278930: Wed Feb 18 05:34:27 MSK 2015     root@des.local:/usr/obj/usr/src/sys/GENERIC  amd64

Error

Failed to build FreeBSD ubldr
  Log in /usr/obj/ubldr-armv6-RPI-B/_.ubldr.armv6-RPI-B.build.log

Stop.
cc  -O -pipe  -mfloat-abi=softfp  -I/usr/src/sys/boot/efi/loader -I/usr/src/sys/boot/efi/loader/arch/arm -I/usr/src/sys/boot/efi/loader/../include -I/usr/src/sys/boot/efi/loader/../include/arm -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 -DNO_PCI -DEFI -DBOOT_FORTH -I/usr/src/sys/boot/efi/loader/../../ficl -I/usr/src/sys/boot/efi/loader/../../ficl/arm -I/usr/src/sys/boot/efi/loader/../../fdt -I/usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../fdt -DLOADER_FDT_SUPPORT -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -I/usr
/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat -msoft-float -std=gnu99   -Qunused-arguments  -Wl,-T/usr/src/sys/boot/efi/loader/arch/arm/ldscript.arm -Wl,-Bsymbolic -shared -nostdlib -o loader.sym autoload.o bootinfo.o conf.o copy.o devicename.o main.o reloc.o smbios.o vers.o exec.o start.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_elf32.o reloc_elf32.o disk.o part.o crc32.o bcache.o interp_forth.o /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../ficl/libficl.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../libefi/libefi.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../fdt/libfdt.a /usr/obj/arm.armv6/usr/src/sys/boot/efi/loader/../../efi/fdt/libefi_fdt.a /usr/lib/libstand.a
/usr/lib/libstand.a: could not read symbols: File format not recognized
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

In newsletter found here such a way, it helps https://lists.freebsd.org/pipermail/freebsd-arm/2015-April/011005.html

setenv LIBSTAND "/usr/obj/arm.armv6/usr/src/tmp/usr/lib/libstand.a"
kientzle commented 9 years ago

This seems to be a bug in FreeBSD, not in Crochet.

Based on discussion on freebsd-arm@, it appears that the efi and arm boot Makefiles do not correctly use the libstand built for the target architecture (as the other Makefiles in the boot portion of the tree do).

The correct fix seems to be to add the following line:

LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a

to both sys/boot/arm/uboot/Makefile and sys/boot/efi/loader/Makefile