* [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking
@ 2017-10-25 20:08 Ard Biesheuvel
2017-10-26 2:18 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2017-10-25 20:08 UTC (permalink / raw)
To: edk2-devel; +Cc: leif.lindholm, liming.gao, yonghong.zhu, Ard Biesheuvel
Some prebuilt GCC toolchains targeting aarch64 (e.g., the Debian Stretch
one) will default to building PIE executables. This has been observed to
corrupt ACPI tables built from .aslc sources, so disable PIE linking
altogether when using the GCC toolchain to build for AARCH64 or ARM.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
v2: - apply to both AARCH64 and ARM
- apply to GCC5 (and up) only - older versions of GCC don't support this
option
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 e93c2a0bf1ef..df7c109438fd 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4494,9 +4494,9 @@ DEFINE GCC5_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS)
DEFINE GCC5_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS)
DEFINE GCC5_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS)
DEFINE GCC5_AARCH64_CC_XIPFLAGS = DEF(GCC49_AARCH64_CC_XIPFLAGS)
-DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS)
+DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS) -no-pie
DEFINE GCC5_ARM_DLINK2_FLAGS = DEF(GCC49_ARM_DLINK2_FLAGS) -Wno-error
-DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS)
+DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -no-pie
DEFINE GCC5_AARCH64_DLINK2_FLAGS = DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-error
DEFINE GCC5_ARM_ASLDLINK_FLAGS = DEF(GCC49_ARM_ASLDLINK_FLAGS)
DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking
2017-10-25 20:08 [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking Ard Biesheuvel
@ 2017-10-26 2:18 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-10-26 2:18 UTC (permalink / raw)
To: Ard Biesheuvel, edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, Zhu, Yonghong
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>Sent: Thursday, October 26, 2017 4:08 AM
>To: edk2-devel@lists.01.org
>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
><ard.biesheuvel@linaro.org>
>Subject: [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking
>
>Some prebuilt GCC toolchains targeting aarch64 (e.g., the Debian Stretch
>one) will default to building PIE executables. This has been observed to
>corrupt ACPI tables built from .aslc sources, so disable PIE linking
>altogether when using the GCC toolchain to build for AARCH64 or ARM.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>---
>v2: - apply to both AARCH64 and ARM
> - apply to GCC5 (and up) only - older versions of GCC don't support this
> option
>
> 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 e93c2a0bf1ef..df7c109438fd 100755
>--- a/BaseTools/Conf/tools_def.template
>+++ b/BaseTools/Conf/tools_def.template
>@@ -4494,9 +4494,9 @@ DEFINE GCC5_ARM_CC_FLAGS =
>DEF(GCC49_ARM_CC_FLAGS)
> DEFINE GCC5_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS)
> DEFINE GCC5_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS)
> DEFINE GCC5_AARCH64_CC_XIPFLAGS =
>DEF(GCC49_AARCH64_CC_XIPFLAGS)
>-DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS)
>+DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS) -
>no-pie
> DEFINE GCC5_ARM_DLINK2_FLAGS = DEF(GCC49_ARM_DLINK2_FLAGS) -
>Wno-error
>-DEFINE GCC5_AARCH64_DLINK_FLAGS =
>DEF(GCC49_AARCH64_DLINK_FLAGS)
>+DEFINE GCC5_AARCH64_DLINK_FLAGS =
>DEF(GCC49_AARCH64_DLINK_FLAGS) -no-pie
> DEFINE GCC5_AARCH64_DLINK2_FLAGS =
>DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-error
> DEFINE GCC5_ARM_ASLDLINK_FLAGS =
>DEF(GCC49_ARM_ASLDLINK_FLAGS)
> DEFINE GCC5_AARCH64_ASLDLINK_FLAGS =
>DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
>--
>2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-26 2:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25 20:08 [PATCH v2] BaseTools/tools_def AARCH64 ARM: disable PIE linking Ard Biesheuvel
2017-10-26 2:18 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox