public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
@ 2017-05-31 16:57 dann frazier
  2017-05-31 17:30 ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: dann frazier @ 2017-05-31 16:57 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel, Liming Gao, Yonghong Zhu, Leif Lindholm

v3:
* Drop -static, no longer needed after:
  00b00cc5 BaseTools/Scripts: discard .gnu.hash section in GCC builds
v2:
* Replace -no-pie w/ -static for compat with GCC 4.9

After Debian's toolchain switched to PIE by default, our edk2 builds began
to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
off PIE for both ARM and AARCH64 builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: dann frazier <dannf@debian.org>
---
 BaseTools/Conf/tools_def.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 4b1b7b548c..f68c836bca 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4339,9 +4339,9 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-builtin -fno-stri
 DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
 DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
 DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
-DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
+DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pie
 DEFINE GCC_ARM_CC_XIPFLAGS         = -mno-unaligned-access
-DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic
+DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie
 DEFINE GCC_AARCH64_CC_XIPFLAGS     = -mstrict-align
 DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
 DEFINE GCC_DLINK2_FLAGS_COMMON     = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
  2017-05-31 16:57 [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE dann frazier
@ 2017-05-31 17:30 ` Ard Biesheuvel
  2017-06-01  0:45   ` Gao, Liming
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2017-05-31 17:30 UTC (permalink / raw)
  To: dann frazier, Liming Gao, Yonghong Zhu
  Cc: edk2-devel@lists.01.org, Leif Lindholm

On 31 May 2017 at 16:57, dann frazier <dannf@debian.org> wrote:
> v3:
> * Drop -static, no longer needed after:
>   00b00cc5 BaseTools/Scripts: discard .gnu.hash section in GCC builds
> v2:
> * Replace -no-pie w/ -static for compat with GCC 4.9
>
> After Debian's toolchain switched to PIE by default, our edk2 builds began
> to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
> off PIE for both ARM and AARCH64 builds.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: dann frazier <dannf@debian.org>

Hi Dan,

This looks fine to me, although I only just spotted that ARM now uses
-fno-pie only, whereas AARCH64 uses -fno-pic -fno-pie. I'd prefer to
have the two aligned, but I can fix that up when committing.

Liming, Yonghong: any objections? If not, I will go ahead and merge it
(with -fno-pic added for ARM as well)

Thanks,
Ard.


> ---
>  BaseTools/Conf/tools_def.template | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 4b1b7b548c..f68c836bca 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -4339,9 +4339,9 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-wchar -fno-builtin -fno-stri
>  DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
>  DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
>  DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
> -DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
> +DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pie
>  DEFINE GCC_ARM_CC_XIPFLAGS         = -mno-unaligned-access
> -DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic
> +DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie
>  DEFINE GCC_AARCH64_CC_XIPFLAGS     = -mstrict-align
>  DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
>  DEFINE GCC_DLINK2_FLAGS_COMMON     = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
> --
> 2.11.0
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
  2017-05-31 17:30 ` Ard Biesheuvel
@ 2017-06-01  0:45   ` Gao, Liming
  2017-06-01  8:32     ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Gao, Liming @ 2017-06-01  0:45 UTC (permalink / raw)
  To: Ard Biesheuvel, dann frazier, Zhu, Yonghong
  Cc: edk2-devel@lists.01.org, Leif Lindholm

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>Sent: Thursday, June 01, 2017 1:31 AM
>To: dann frazier <dannf@debian.org>; Gao, Liming <liming.gao@intel.com>;
>Zhu, Yonghong <yonghong.zhu@intel.com>
>Cc: edk2-devel@lists.01.org <edk2-devel@ml01.01.org>; Leif Lindholm
><leif.lindholm@linaro.org>
>Subject: Re: [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
>
>On 31 May 2017 at 16:57, dann frazier <dannf@debian.org> wrote:
>> v3:
>> * Drop -static, no longer needed after:
>>   00b00cc5 BaseTools/Scripts: discard .gnu.hash section in GCC builds
>> v2:
>> * Replace -no-pie w/ -static for compat with GCC 4.9
>>
>> After Debian's toolchain switched to PIE by default, our edk2 builds began
>> to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
>> off PIE for both ARM and AARCH64 builds.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: dann frazier <dannf@debian.org>
>
>Hi Dan,
>
>This looks fine to me, although I only just spotted that ARM now uses
>-fno-pie only, whereas AARCH64 uses -fno-pic -fno-pie. I'd prefer to
>have the two aligned, but I can fix that up when committing.
>
>Liming, Yonghong: any objections? If not, I will go ahead and merge it
>(with -fno-pic added for ARM as well)
>
>Thanks,
>Ard.
>
>
>> ---
>>  BaseTools/Conf/tools_def.template | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/BaseTools/Conf/tools_def.template
>b/BaseTools/Conf/tools_def.template
>> index 4b1b7b548c..f68c836bca 100755
>> --- a/BaseTools/Conf/tools_def.template
>> +++ b/BaseTools/Conf/tools_def.template
>> @@ -4339,9 +4339,9 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-
>wchar -fno-builtin -fno-stri
>>  DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -
>malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-
>stack-arg-probe
>>  DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-
>zone -Wno-address -mno-stack-arg-probe
>>  DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-
>divide-min-latency
>> -DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -
>fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
>> +DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -
>fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
>-fno-pie
>>  DEFINE GCC_ARM_CC_XIPFLAGS         = -mno-unaligned-access
>> -DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections
>-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic
>> +DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections
>-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -
>fno-pie
>>  DEFINE GCC_AARCH64_CC_XIPFLAGS     = -mstrict-align
>>  DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
>>  DEFINE GCC_DLINK2_FLAGS_COMMON     = -Wl,--
>script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
>> --
>> 2.11.0
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
  2017-06-01  0:45   ` Gao, Liming
@ 2017-06-01  8:32     ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-06-01  8:32 UTC (permalink / raw)
  To: Gao, Liming
  Cc: dann frazier, Zhu, Yonghong, edk2-devel@lists.01.org,
	Leif Lindholm

On 1 June 2017 at 00:45, Gao, Liming <liming.gao@intel.com> wrote:
> Reviewed-by: Liming Gao <liming.gao@intel.com>
>

Pushed as a6b5380642c4

Thanks,
Ard.


>>-----Original Message-----
>>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>Sent: Thursday, June 01, 2017 1:31 AM
>>To: dann frazier <dannf@debian.org>; Gao, Liming <liming.gao@intel.com>;
>>Zhu, Yonghong <yonghong.zhu@intel.com>
>>Cc: edk2-devel@lists.01.org <edk2-devel@ml01.01.org>; Leif Lindholm
>><leif.lindholm@linaro.org>
>>Subject: Re: [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE
>>
>>On 31 May 2017 at 16:57, dann frazier <dannf@debian.org> wrote:
>>> v3:
>>> * Drop -static, no longer needed after:
>>>   00b00cc5 BaseTools/Scripts: discard .gnu.hash section in GCC builds
>>> v2:
>>> * Replace -no-pie w/ -static for compat with GCC 4.9
>>>
>>> After Debian's toolchain switched to PIE by default, our edk2 builds began
>>> to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
>>> off PIE for both ARM and AARCH64 builds.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: dann frazier <dannf@debian.org>
>>
>>Hi Dan,
>>
>>This looks fine to me, although I only just spotted that ARM now uses
>>-fno-pie only, whereas AARCH64 uses -fno-pic -fno-pie. I'd prefer to
>>have the two aligned, but I can fix that up when committing.
>>
>>Liming, Yonghong: any objections? If not, I will go ahead and merge it
>>(with -fno-pic added for ARM as well)
>>
>>Thanks,
>>Ard.
>>
>>
>>> ---
>>>  BaseTools/Conf/tools_def.template | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/BaseTools/Conf/tools_def.template
>>b/BaseTools/Conf/tools_def.template
>>> index 4b1b7b548c..f68c836bca 100755
>>> --- a/BaseTools/Conf/tools_def.template
>>> +++ b/BaseTools/Conf/tools_def.template
>>> @@ -4339,9 +4339,9 @@ DEFINE GCC_ALL_CC_FLAGS            = -g -Os -fshort-
>>wchar -fno-builtin -fno-stri
>>>  DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -
>>malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-
>>stack-arg-probe
>>>  DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-
>>zone -Wno-address -mno-stack-arg-probe
>>>  DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-
>>divide-min-latency
>>> -DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>>endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -
>>fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
>>> +DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>>endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -
>>fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
>>-fno-pie
>>>  DEFINE GCC_ARM_CC_XIPFLAGS         = -mno-unaligned-access
>>> -DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>>endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections
>>-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic
>>> +DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-
>>endian -fno-short-enums -fverbose-asm -funsigned-char  -ffunction-sections
>>-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -
>>fno-pie
>>>  DEFINE GCC_AARCH64_CC_XIPFLAGS     = -mstrict-align
>>>  DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
>>>  DEFINE GCC_DLINK2_FLAGS_COMMON     = -Wl,--
>>script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
>>> --
>>> 2.11.0
>>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-01  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-31 16:57 [PATCH v3] BaseTools/GCC ARM/AARCH64: Force disable PIE dann frazier
2017-05-31 17:30 ` Ard Biesheuvel
2017-06-01  0:45   ` Gao, Liming
2017-06-01  8:32     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox