Skip to contentSkip to conversation

binutils : enable x86_64-pep for producing EFI binaries

PATCH Superseded Christopher Clark 3 participants 3 messages Jul 25, 2018 – Jul 26, 2018

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 binutils : enable x86_64-pep for producing EFI binaries

From: Christopher Clark <[email protected]>

On EFI architectures (arm/x86/x86_64/aarch64) add the x86_64-pep emulation support to the linker to enable production of Portable Executables for EFI binaries.

Enables building the EFI variant of the Xen hypervisor.

---
 meta/recipes-devtools/binutils/binutils.inc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/recipes-devtools/binutils/binutils.inc +8 -1
index 37813dd..b3efbad 100644
@@ -69,12 +69,19 @@ python do_package_prepend() {
 
 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
 
+def enable_efi_targets(d):
+    translated_arch = d.getVar('TRANSLATED_TARGET_ARCH')
+    if translated_arch in ["x86-64", "i586", "i686", "arm", "aarch64"]:
+        return "--enable-targets=x86_64-pep"
+    return ""
+
 EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
                 --disable-werror \
                 --enable-deterministic-archives \
                 --enable-plugins \
                 ${LDGOLD} \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
+                ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
+                ${@enable_efi_targets(d)}"
 
 LDGOLD_class-native = ""
 LDGOLD_class-crosssdk = ""
Signature · 1 line
2.7.4
#1 lore raw
Quoted 26 lines · Christopher Clark

From: Christopher Clark <[email protected]>

On EFI architectures (arm/x86/x86_64/aarch64) add the x86_64-pep emulation support to the linker to enable production of Portable Executables for EFI binaries.

Enables building the EFI variant of the Xen hypervisor.

---
 meta/recipes-devtools/binutils/binutils.inc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/recipes-devtools/binutils/binutils.inc +3 -0
index 37813dd..b3efbad 100644
@@ -69,12 +69,19 @@ python do_package_prepend() {
 
 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
 
+def enable_efi_targets(d):
+    translated_arch = d.getVar('TRANSLATED_TARGET_ARCH')
+    if translated_arch in ["x86-64", "i586", "i686", "arm",

"aarch64"]:

meta/recipes-devtools/binutils/binutils.inc python do_package_prepend() { · line 76

Quoted 2 lines
meta/recipes-devtools/binutils/binutils.inc +2 -0
+        return "--enable-targets=x86_64-pep"
+    return ""

Just to double check, is "x86_64-pep" the right value even on arm?

Cheers,

Richard

#2 lore raw
Quoted 22 lines · Richard Purdie
Quoted 20 lines · Christopher Clark

From: Christopher Clark <[email protected]>

On EFI architectures (arm/x86/x86_64/aarch64) add the x86_64-pep emulation support to the linker to enable production of Portable Executables for EFI binaries.

Enables building the EFI variant of the Xen hypervisor.

---
 meta/recipes-devtools/binutils/binutils.inc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/recipes-devtools/binutils/binutils.inc +0 -0
index 37813dd..b3efbad 100644
@@ -69,12 +69,19 @@ python do_package_prepend() {
 
Quoted 8 lines

meta/recipes-devtools/binutils/binutils.inc python do_package_prepend() { · line 76

Quoted 8 lines
meta/recipes-devtools/binutils/binutils.inc +3 -0
 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
 
+def enable_efi_targets(d):
+    translated_arch = d.getVar('TRANSLATED_TARGET_ARCH')
+    if translated_arch in ["x86-64", "i586", "i686", "arm",

"aarch64"]:

meta/recipes-devtools/binutils/binutils.inc +2 -0
+        return "--enable-targets=x86_64-pep"
+    return ""

may be we can just use overrides instead of function

Quoted 3 lines

Just to double check, is "x86_64-pep" the right value even on arm?

right, It should be PE emulation for the given arch I believe

Quoted 9 lines

Cheers,

Richard

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core