From owner-svn-src-stable@freebsd.org Wed Apr 19 14:07:36 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4953D45A77; Wed, 19 Apr 2017 14:07:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5592E660; Wed, 19 Apr 2017 14:07:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JE7Z8F018627; Wed, 19 Apr 2017 14:07:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JE7Zuu018624; Wed, 19 Apr 2017 14:07:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704191407.v3JE7Zuu018624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 19 Apr 2017 14:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317140 - in stable/11: share/mk sys/boot/efi sys/boot/efi/loader/arch/arm64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2017 14:07:36 -0000 Author: andrew Date: Wed Apr 19 14:07:35 2017 New Revision: 317140 URL: https://svnweb.freebsd.org/changeset/base/317140 Log: Fix the arm64 userland building with lld: MFC 308124: On arm64 build the efi loader with -fPIC. Without this clang 3.9 will generate relocation in the self relocation code. MFC 316608: Add -fPIC to the standalone build flags on arm64. This is needed as loader.efi is position independend, however we were not building it as such causing a build failure when building with lld. MFC 315452: Mark the EFI PE header as allocated. While ld.bfd doesn't seem to care about not having this flag ld.lld fails to link without it. Modified: stable/11/share/mk/bsd.stand.mk stable/11/sys/boot/efi/Makefile.inc stable/11/sys/boot/efi/loader/arch/arm64/start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.stand.mk ============================================================================== --- stable/11/share/mk/bsd.stand.mk Wed Apr 19 13:24:32 2017 (r317139) +++ stable/11/share/mk/bsd.stand.mk Wed Apr 19 14:07:35 2017 (r317140) @@ -17,7 +17,7 @@ CFLAGS+= -fPIC -mno-red-zone CFLAGS+= -Os .endif .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only +CFLAGS+= -fPIC -mgeneral-regs-only .endif .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -G0 -fno-pic -mno-abicalls Modified: stable/11/sys/boot/efi/Makefile.inc ============================================================================== --- stable/11/sys/boot/efi/Makefile.inc Wed Apr 19 13:24:32 2017 (r317139) +++ stable/11/sys/boot/efi/Makefile.inc Wed Apr 19 14:07:35 2017 (r317140) @@ -20,6 +20,7 @@ CFLAGS+= -mno-aes .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -fshort-wchar +CFLAGS+= -fPIC .endif .if ${MACHINE_CPUARCH} == "arm" Modified: stable/11/sys/boot/efi/loader/arch/arm64/start.S ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm64/start.S Wed Apr 19 13:24:32 2017 (r317139) +++ stable/11/sys/boot/efi/loader/arch/arm64/start.S Wed Apr 19 14:07:35 2017 (r317140) @@ -40,7 +40,7 @@ #define IMAGE_SCN_MEM_EXECUTE 0x20000000 #define IMAGE_SCN_MEM_READ 0x40000000 - .section .peheader + .section .peheader,"a" efi_start: /* The MS-DOS Stub, only used to get the offset of the COFF header */ .ascii "MZ"