Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2016 02:02:33 +0100
From:      Oliver Pinter <oliver.pinter@hardenedbsd.org>
To:        Ed Maste <emaste@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   Re: svn commit: r293297 - in stable/10/sys/boot/efi: . boot1 loader loader/arch loader/arch/amd64
Message-ID:  <CAPQ4fft3iYc8974b6pa-QHk-bc1HQdobbYY9FxoPK5jLe_VDyg@mail.gmail.com>
In-Reply-To: <201601070222.u072MjTs098126@repo.freebsd.org>
References:  <201601070222.u072MjTs098126@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/7/16, Ed Maste <emaste@freebsd.org> wrote:
> Author: emaste
> Date: Thu Jan  7 02:22:45 2016
> New Revision: 293297
> URL: https://svnweb.freebsd.org/changeset/base/293297
>
> Log:
>   MFC r280950: Move the efi loaders to be under sys/boot/efi
>
>   In HEAD this was done to support UEFI on arm64. Merging to stable/10 to
>   facilitate the merging of later UEFI changes.
>
> Added:
>   stable/10/sys/boot/efi/boot1/
>   stable/10/sys/boot/efi/boot1/Makefile   (contents, props changed)
>   stable/10/sys/boot/efi/boot1/Makefile.fat   (contents, props changed)
>   stable/10/sys/boot/efi/boot1/boot1.c   (contents, props changed)
>   stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu   (contents, props changed)
>   stable/10/sys/boot/efi/boot1/generate-fat.sh   (contents, props changed)
>   stable/10/sys/boot/efi/loader/
>   stable/10/sys/boot/efi/loader/Makefile   (contents, props changed)
>   stable/10/sys/boot/efi/loader/arch/
>   stable/10/sys/boot/efi/loader/arch/amd64/
>   stable/10/sys/boot/efi/loader/arch/amd64/Makefile.inc   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/amd64_tramp.S   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c   (contents,
> props changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.h   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/ldscript.amd64   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/reloc.c   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/arch/amd64/start.S   (contents, props
> changed)
>   stable/10/sys/boot/efi/loader/autoload.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/bootinfo.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/conf.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/copy.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/devicename.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/loader_efi.h   (contents, props changed)
>   stable/10/sys/boot/efi/loader/main.c   (contents, props changed)
>   stable/10/sys/boot/efi/loader/version   (contents, props changed)
> Modified:
>   stable/10/sys/boot/efi/Makefile
>   stable/10/sys/boot/efi/Makefile.inc
>
> Modified: stable/10/sys/boot/efi/Makefile
> ==============================================================================
> --- stable/10/sys/boot/efi/Makefile	Thu Jan  7 02:06:14 2016	(r293296)
> +++ stable/10/sys/boot/efi/Makefile	Thu Jan  7 02:22:45 2016	(r293297)
> @@ -2,4 +2,8 @@
>
>  SUBDIR=		libefi
>
> +.if ${MACHINE_CPUARCH} == "amd64"
> +SUBDIR+=	loader boot1
> +.endif
> +
>  .include <bsd.subdir.mk>
>
> Modified: stable/10/sys/boot/efi/Makefile.inc
> ==============================================================================
> --- stable/10/sys/boot/efi/Makefile.inc	Thu Jan  7 02:06:14 2016	(r293296)
> +++ stable/10/sys/boot/efi/Makefile.inc	Thu Jan  7 02:22:45 2016	(r293297)
> @@ -7,7 +7,10 @@ CFLAGS+=        -march=i386
>  .endif
>
>  # Options used when building app-specific efi components
> +# See conf/kern.mk for the correct set of these
>  CFLAGS+=	-ffreestanding -fshort-wchar -Wformat
> +CFLAGS+=	-mno-red-zone
> +CFLAGS+=	-mno-mmx -mno-sse -mno-aes -mno-avx -msoft-float
>  LDFLAGS+=	-nostdlib
>
>  .include "../Makefile.inc"
>
> Added: stable/10/sys/boot/efi/boot1/Makefile
> ==============================================================================
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ stable/10/sys/boot/efi/boot1/Makefile	Thu Jan  7 02:22:45
> 2016	(r293297)
> @@ -0,0 +1,84 @@
> +# $FreeBSD$
> +
> +MAN=
> +
> +.include <bsd.own.mk>
> +
> +# In-tree GCC does not support __attribute__((ms_abi)).
> +.if ${COMPILER_TYPE} != "gcc"
> +
> +MK_SSP=		no
> +
> +PROG=		loader.sym
> +INTERNALPROG=
> +
> +# architecture-specific loader code
> +SRCS=	boot1.c reloc.c start.S
> +
> +CFLAGS+=	-fPIC
> +CFLAGS+=	-I.
> +CFLAGS+=	-I${.CURDIR}/../include
> +CFLAGS+=	-I${.CURDIR}/../include/${MACHINE_CPUARCH}
> +CFLAGS+=	-I${.CURDIR}/../../../contrib/dev/acpica/include
> +CFLAGS+=	-I${.CURDIR}/../../..
> +
> +# Always add MI sources and REGULAR efi loader bits
> +.PATH:		${.CURDIR}/../loader/arch/amd64 ${.CURDIR}/../../common
> +CFLAGS+=	-I${.CURDIR}/../../common
> +
> +FILES=	boot1.efi boot1.efifat
> +FILESMODE_boot1.efi=	${BINMODE}
> +
> +LDSCRIPT=	${.CURDIR}/../loader/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH}
> +LDFLAGS=	-Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc
> +
> +${PROG}:	${LDSCRIPT}
> +
> +OBJCOPY?=	objcopy
> +OBJDUMP?=	objdump
> +
> +.if ${MACHINE_CPUARCH} == "amd64"
> +EFI_TARGET=	efi-app-x86_64
> +.elif ${MACHINE_CPUARCH} == "i386"
> +EFI_TARGET=	efi-app-ia32
> +.endif
> +
> +boot1.efi: loader.sym
> +	if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
> +		${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \

New build warning on this ^ lines:

sh: -t: not found
/usr/obj/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/sys/boot/efi/boot1
66+1 records in
66+1 records out
33811 bytes transferred in 0.000617 secs (54832354 bytes/sec)

See the jenkins log:
http://jenkins.hardenedbsd.org:8180/jenkins/job/HardenedBSD-stable-10-STABLE-master-amd64/lastSuccessfulBuild/consoleFull

Possible solution to add objdump to bootstrap utils.


> +		exit 1; \
> +	fi
> +	${OBJCOPY} -j .text -j .sdata -j .data \
> +		-j .dynamic -j .dynsym -j .rel.dyn \
> +		-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
> +		--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
> +
> +boot1.o: ${.CURDIR}/../../common/ufsread.c
> +
> +# The following inserts out objects into a template FAT file system
> +# created by generate-fat.sh
> +
> +.include "${.CURDIR}/Makefile.fat"
> +
> +boot1.efifat: boot1.efi
> +	echo ${.OBJDIR}
> +	uudecode ${.CURDIR}/fat.tmpl.bz2.uu
> +	mv fat.tmpl.bz2 ${.TARGET}.bz2
> +	bzip2 -f -d ${.TARGET}.bz2
> +	dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
> +
> +CLEANFILES= boot1.efifat
> +
> +.endif # ${COMPILER_TYPE} != "gcc"
> +
> +.include <bsd.prog.mk>
> +
> +beforedepend ${OBJS}: machine x86
> +
> +CLEANFILES+=   machine x86 boot1.efi
> +
> +machine:
> +	ln -sf ${.CURDIR}/../../../amd64/include machine
> +
> +x86:
> +	ln -sf ${.CURDIR}/../../../x86/include x86
>
> Added: stable/10/sys/boot/efi/boot1/Makefile.fat
> ==============================================================================
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ stable/10/sys/boot/efi/boot1/Makefile.fat	Thu Jan  7 02:22:45
> 2016	(r293297)
> @@ -0,0 +1,3 @@
> +# This file autogenerated by generate-fat.sh - DO NOT EDIT
> +# $FreeBSD$
> +BOOT1_OFFSET=0x2d
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4fft3iYc8974b6pa-QHk-bc1HQdobbYY9FxoPK5jLe_VDyg>