From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9E08A21A134B8 for ; Fri, 19 May 2017 10:02:18 -0700 (PDT) Received: by mail-io0-x232.google.com with SMTP id k91so51057097ioi.1 for ; Fri, 19 May 2017 10:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WR6iffV0qTA8Hwo3QUBcKQ9cQdZeY0uTYNz+b/eYHPI=; b=Zl6G12v99Gh405JnAG1S1XvHNW2jyygGcWQrfc3o1mvMdV0SCWipvv8XwXnzIGKpvB G7w02+7fEfxCWZ8YPvE7tNhtIRCYq/LCby1QR8OiVEUd/pP1otAARhPjYDE6BzXmnBBt LOkPJjqcaZQHlrqKSNaeY+nowZN8cdah/CRLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WR6iffV0qTA8Hwo3QUBcKQ9cQdZeY0uTYNz+b/eYHPI=; b=Lte+lep9DB8LuwMUGjl5KZyBc8V+AZOkP6lYpMpLeheIeSobhY9QnchcYTMFBUepLS 2wEHLao6JwnI+knyvsnoOaw+ATmfkXokk+iGinaZ/QMJbIvgfmVWSWTrg2sHgoOoKN1W JqzaTUjCloLCvoV6ES2LH1yYVC+NS7PZEw3iKR/dQJU/CmtJRdB80rthaMrpmNMP4i/j CHTpX4dj8FOL79REwT5ujOUu0VLx8wUTQiP0MITMqech0j19qycILqAeKntFo+KElYyI JqvMJkATZK1Ql+8RevlRsWbi/+AhrXLKhCcvGoTbwj+F99RqTRGpGx/68vVBYZozyPHq vzOg== X-Gm-Message-State: AODbwcCSlbSNmTKmdwViXUdC2hJ1CyZrZw9JPH5sD80ZnHCT3uq/m9F1 BIjAUHnws9diuGSsCKeYtSCcHvGhLj3ks+A= X-Received: by 10.107.180.130 with SMTP id d124mr10816851iof.47.1495213337785; Fri, 19 May 2017 10:02:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.24 with HTTP; Fri, 19 May 2017 10:02:17 -0700 (PDT) In-Reply-To: References: <1495175456-4880-1-git-send-email-michael.d.kinney@intel.com> From: Ard Biesheuvel Date: Fri, 19 May 2017 18:02:17 +0100 Message-ID: To: "Kinney, Michael D" Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Andrew Fish Subject: Re: [Patch] OvmfPkg: Add XCODE5 statements to fix build break X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 May 2017 17:02:18 -0000 Content-Type: text/plain; charset="UTF-8" On 19 May 2017 at 17:45, Kinney, Michael D wrote: > Hi Ard, > > The order of assignment does not matter. I have tried it > both ways and both orders use the XCODE option instead of the > GCC option when the XCODE5 tool chain is used. > Interesting. Is this fully specified in any of the EDK2 specs? If not, we are relying on an implementation detail of our BaseTools, which I guess we'd rather avoid. > I have tried to adjust the XCODE family build flags to do 4KB > alignment of PE/COFF sections for RT and SMM modules. This > appears to work, but is not compatible firmware based page > protections. Here are the flags I tried: > > XCODE:*_*_*_DLINK_FLAGS = -segalign 0x1000 -seg1addr 0x1000 > XCODE:*_*_*_MTOC_FLAGS = -align 0x1000 > > I have not had a chance to root cause the reason why this > is failing yet, so the initial fix here is to get XCODE5 > to work without enabling 4KB alignment of RT and SMM > modules. > Fair enough. > I have entered a Bugzilla for the boot failure when I > attempted to enable 4KB aligned PE/COFF images for the > XCODE5 tool chain. > > https://bugzilla.tianocore.org/show_bug.cgi?id=564 > > Thanks, > > Mike > > >> -----Original Message----- >> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> Sent: Friday, May 19, 2017 1:32 AM >> To: Kinney, Michael D >> Cc: edk2-devel@lists.01.org; Laszlo Ersek ; Andrew Fish >> >> Subject: Re: [edk2] [Patch] OvmfPkg: Add XCODE5 statements to fix build break >> >> On 19 May 2017 at 07:30, Michael Kinney wrote: >> > https://bugzilla.tianocore.org/show_bug.cgi?id=559 >> > >> > The XCODE5 tool chain has a FAMILY of GCC. The >> > GCC statements in the [BuildOptions] section add >> > flags that are not compatible with XCODE5. Add >> > empty XCODE5 statements in [BuildOptions] sections >> > to prevent the use of the GCC flags in XCODE5 >> > builds. >> > >> > Cc: Laszlo Ersek >> > Cc: Andrew Fish >> > Contributed-under: TianoCore Contribution Agreement 1.0 >> > Signed-off-by: Michael D Kinney >> >> Does XCODE not have a way to set the section alignment? This way, the >> DXE memory protection and OS memory attribute table protection is >> defeated. Also, does this rely on the order of assignment? >> >> > --- >> > OvmfPkg/OvmfPkgIa32.dsc | 2 ++ >> > OvmfPkg/OvmfPkgIa32X64.dsc | 2 ++ >> > OvmfPkg/OvmfPkgX64.dsc | 2 ++ >> > 3 files changed, 6 insertions(+) >> > >> > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc >> > index bd115c9..a0ea5db 100644 >> > --- a/OvmfPkg/OvmfPkgIa32.dsc >> > +++ b/OvmfPkg/OvmfPkgIa32.dsc >> > @@ -75,11 +75,13 @@ >> > >> > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > # Force PE/COFF sections to be aligned at 4KB boundaries to support page level >> > # protection of DXE_SMM_DRIVER/SMM_CORE modules >> > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > ################################################################################ >> > # >> > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc >> > index 9727db8..9ab58aa 100644 >> > --- a/OvmfPkg/OvmfPkgIa32X64.dsc >> > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc >> > @@ -80,11 +80,13 @@ >> > >> > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > # Force PE/COFF sections to be aligned at 4KB boundaries to support page level >> > # protection of DXE_SMM_DRIVER/SMM_CORE modules >> > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > ################################################################################ >> > # >> > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc >> > index 61aaed7..88060cd 100644 >> > --- a/OvmfPkg/OvmfPkgX64.dsc >> > +++ b/OvmfPkg/OvmfPkgX64.dsc >> > @@ -80,11 +80,13 @@ >> > >> > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > # Force PE/COFF sections to be aligned at 4KB boundaries to support page level >> > # protection of DXE_SMM_DRIVER/SMM_CORE modules >> > [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE] >> > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 >> > + XCODE:*_*_*_DLINK_FLAGS = >> > >> > ################################################################################ >> > # >> > -- >> > 2.6.3.windows.1 >> > >> > _______________________________________________ >> > edk2-devel mailing list >> > edk2-devel@lists.01.org >> > https://lists.01.org/mailman/listinfo/edk2-devel