[edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable stack protector

Ard Biesheuvel posted 1 patch 4 years, 7 months ago
Failed in applying to current master (apply log)
ShellPkg/ShellPkg.dsc | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable stack protector
Posted by Ard Biesheuvel 4 years, 7 months ago
Incorporate the stack protector library into the AARCH64 build of
the Shell binaries as a NULL library resolution, to avoid build
errors when the compiler injects stack integrity checks.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ShellPkg/ShellPkg.dsc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index b2065dc028d8..91493400cab7 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -58,7 +58,7 @@
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
 
-[LibraryClasses.ARM]
+[LibraryClasses.ARM,LibraryClasses.AARCH64]
   #
   # It is not possible to prevent the ARM compiler for generic intrinsic functions.
   # This library provides the instrinsic functions generate by a given compiler.
@@ -69,9 +69,6 @@
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
-[LibraryClasses.AARCH64]
-  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46820): https://edk2.groups.io/g/devel/message/46820
Mute This Topic: https://groups.io/mt/33140662/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable stack protector
Posted by Leif Lindholm 4 years, 7 months ago
On Wed, Sep 04, 2019 at 09:34:34AM -0700, Ard Biesheuvel wrote:
> Incorporate the stack protector library into the AARCH64 build of
> the Shell binaries as a NULL library resolution, to avoid build
> errors when the compiler injects stack integrity checks.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Surprised we hadn't triggered this earlier.
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---
>  ShellPkg/ShellPkg.dsc | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
> index b2065dc028d8..91493400cab7 100644
> --- a/ShellPkg/ShellPkg.dsc
> +++ b/ShellPkg/ShellPkg.dsc
> @@ -58,7 +58,7 @@
>    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
>    ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
>  
> -[LibraryClasses.ARM]
> +[LibraryClasses.ARM,LibraryClasses.AARCH64]
>    #
>    # It is not possible to prevent the ARM compiler for generic intrinsic functions.
>    # This library provides the instrinsic functions generate by a given compiler.
> @@ -69,9 +69,6 @@
>    # Add support for GCC stack protector
>    NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
>  
> -[LibraryClasses.AARCH64]
> -  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> -
>  [PcdsFixedAtBuild]
>    gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
>    gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000
> -- 
> 2.17.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46821): https://edk2.groups.io/g/devel/message/46821
Mute This Topic: https://groups.io/mt/33140662/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable stack protector
Posted by Gao, Zhichao 4 years, 7 months ago
Acked-by: Zhichao Gao <zhichao.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Leif Lindholm
> Sent: Thursday, September 5, 2019 12:38 AM
> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: devel@edk2.groups.io; Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray
> <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable
> stack protector
> 
> On Wed, Sep 04, 2019 at 09:34:34AM -0700, Ard Biesheuvel wrote:
> > Incorporate the stack protector library into the AARCH64 build of the
> > Shell binaries as a NULL library resolution, to avoid build errors
> > when the compiler injects stack integrity checks.
> >
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> Surprised we hadn't triggered this earlier.
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> 
> > ---
> >  ShellPkg/ShellPkg.dsc | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index
> > b2065dc028d8..91493400cab7 100644
> > --- a/ShellPkg/ShellPkg.dsc
> > +++ b/ShellPkg/ShellPkg.dsc
> > @@ -58,7 +58,7 @@
> >    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> >
> >
> ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseR
> ep
> > ortStatusCodeLibNull.inf
> >
> > -[LibraryClasses.ARM]
> > +[LibraryClasses.ARM,LibraryClasses.AARCH64]
> >    #
> >    # It is not possible to prevent the ARM compiler for generic intrinsic
> functions.
> >    # This library provides the instrinsic functions generate by a given
> compiler.
> > @@ -69,9 +69,6 @@
> >    # Add support for GCC stack protector
> >    NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> >
> > -[LibraryClasses.AARCH64]
> > -  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > -
> >  [PcdsFixedAtBuild]
> >    gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> >    gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000
> > --
> > 2.17.1
> >
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46859): https://edk2.groups.io/g/devel/message/46859
Mute This Topic: https://groups.io/mt/33140662/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable stack protector
Posted by Ard Biesheuvel 4 years, 7 months ago
On Wed, 4 Sep 2019 at 19:20, Gao, Zhichao <zhichao.gao@intel.com> wrote:
>
> Acked-by: Zhichao Gao <zhichao.gao@intel.com>
>

Thanks

Pushed as 04d9d89b7dd4..23908d0f5cc6

> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Leif Lindholm
> > Sent: Thursday, September 5, 2019 12:38 AM
> > To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Cc: devel@edk2.groups.io; Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ray
> > <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Gao, Liming
> > <liming.gao@intel.com>
> > Subject: Re: [edk2-devel] [PATCH] ShellPkg/ShellPkg.dsc AARCH64: enable
> > stack protector
> >
> > On Wed, Sep 04, 2019 at 09:34:34AM -0700, Ard Biesheuvel wrote:
> > > Incorporate the stack protector library into the AARCH64 build of the
> > > Shell binaries as a NULL library resolution, to avoid build errors
> > > when the compiler injects stack integrity checks.
> > >
> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > Surprised we hadn't triggered this earlier.
> > Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> >
> >
> > > ---
> > >  ShellPkg/ShellPkg.dsc | 5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index
> > > b2065dc028d8..91493400cab7 100644
> > > --- a/ShellPkg/ShellPkg.dsc
> > > +++ b/ShellPkg/ShellPkg.dsc
> > > @@ -58,7 +58,7 @@
> > >    DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> > >
> > >
> > ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseR
> > ep
> > > ortStatusCodeLibNull.inf
> > >
> > > -[LibraryClasses.ARM]
> > > +[LibraryClasses.ARM,LibraryClasses.AARCH64]
> > >    #
> > >    # It is not possible to prevent the ARM compiler for generic intrinsic
> > functions.
> > >    # This library provides the instrinsic functions generate by a given
> > compiler.
> > > @@ -69,9 +69,6 @@
> > >    # Add support for GCC stack protector
> > >    NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> > >
> > > -[LibraryClasses.AARCH64]
> > > -  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> > > -
> > >  [PcdsFixedAtBuild]
> > >    gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> > >    gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000
> > > --
> > > 2.17.1
> > >
> >
> > 
>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46928): https://edk2.groups.io/g/devel/message/46928
Mute This Topic: https://groups.io/mt/33140662/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-