From: Christopher Clark <christopher.w.clark@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v5] binutils : enable x86_64-pep for producing EFI binaries on x86-64
Date: Sat, 28 Jul 2018 23:06:48 -0700 [thread overview]
Message-ID: <1532844408-25210-1-git-send-email-christopher.w.clark@gmail.com> (raw)
Add x86_64-pep emulation support to those enabled for x86_64 targets
to enable the linker to produce Portable Executables for EFI binaries.
Enables building the x86-64 EFI variant of the Xen hypervisor for
the OpenXT Project.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
Changes since v4: Apply a patch to extend the set of emulations for x86-64,
instead of supplying the "enable-targets" flag via the recipe.
Reasoning: this looks like the least invasive way to add the needed emulation
only when required. It will add the extra support to any builds that have
x86-64 target enabled and not modify others.
binutils uses autoconf and the AC_ARG_ENABLE macro for handling the
"--enable-targets" option to the generated configure script. It doesn't allow
for repeating the parameter with additional arguments to extend the list:
it's a one-shot flag. That seems to be standard practice for autoconf.
binutils source contains config files that map from the target identifiers
to lists of emulations to enable. This patch extends some of those lists.
Tested with x86-64 build to produce Xen EFI.
meta/recipes-devtools/binutils/binutils-2.31.inc | 1 +
.../0016-add-i386pep-emulation-for-x86_64.patch | 39 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 meta/recipes-devtools/binutils/binutils/0016-add-i386pep-emulation-for-x86_64.patch
diff --git a/meta/recipes-devtools/binutils/binutils-2.31.inc b/meta/recipes-devtools/binutils/binutils-2.31.inc
index ec9e9c3..02d5bca 100644
--- a/meta/recipes-devtools/binutils/binutils-2.31.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.31.inc
@@ -35,6 +35,7 @@ SRC_URI = "\
file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
file://0014-Detect-64-bit-MIPS-targets.patch \
file://0015-sync-with-OE-libtool-changes.patch \
+ file://0016-add-i386pep-emulation-for-x86_64.patch \
"
S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0016-add-i386pep-emulation-for-x86_64.patch b/meta/recipes-devtools/binutils/binutils/0016-add-i386pep-emulation-for-x86_64.patch
new file mode 100644
index 0000000..159f6b4
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0016-add-i386pep-emulation-for-x86_64.patch
@@ -0,0 +1,39 @@
+binutils : enable x86_64-pep for producing EFI binaries on x86-64
+
+Add x86_64-pep emulation support to the set enabled for x86_64 targets
+to enable the linker to produce Portable Executables for EFI binaries.
+
+Enables building the x86-64 EFI variant of the Xen hypervisor for
+the OpenXT Project.
+
+Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
+---
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index c882421..dc705b6 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -688,7 +688,7 @@ case "${targ}" in
+ ;;
+ x86_64-*-linux-*)
+ targ_defvec=x86_64_elf64_vec
+- targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
++ targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec x86_64_pe_vec x86_64_pe_be_vec i386_pe_vec"
+ want64=true
+ ;;
+ x86_64-*-nacl*)
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index a1db7ad..65a984a 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -253,8 +253,9 @@ x86_64-*-linux-gnux32) targ_emul=elf32_x86_64
+ tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'` ;;
+ x86_64-*-linux-*) targ_emul=elf_x86_64
+- targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om"
+- targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
++ targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pe i386pep"
++ targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om i386pep"
++ targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o"
+ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
+ i[3-7]86-*-redox*) targ_emul=elf_i386
+ targ_extra_emuls=elf_x86_64 ;;
--
2.7.4
next reply other threads:[~2018-07-29 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-29 6:06 Christopher Clark [this message]
2018-07-29 6:32 ` ✗ patchtest: failure for binutils : enable x86_64-pep for producing EFI binaries on x86-64 Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1532844408-25210-1-git-send-email-christopher.w.clark@gmail.com \
--to=christopher.w.clark@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox