[haiku-commits] Change in haiku[master]: efi: Switch to direct EFI loader creation

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 9 Jul 2020 16:08:04 +0000

From Alex von Gluck IV <kallisti5@xxxxxxxxxxx>:

Alex von Gluck IV has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3016 ;)


Change subject: efi: Switch to direct EFI loader creation
......................................................................

efi: Switch to direct EFI loader creation

* efi-app-x86_64 is a undocumented legacy compatibility
  target from the early days of EFI.
* This opens the door to native arm,arm64 loaders without
  the gnu-efi 'fake pe' stubs in the future.
* This change also clairifies what's happening within the
  undocumented efi-app-x86_64
* Future as in binutils fixing these:
  https://sourceware.org/bugzilla/show_bug.cgi?id=26206
  https://sourceware.org/bugzilla/show_bug.cgi?id=26218

Change-Id: I60b4a4f5ceb36059033debbe6bf5b01928d6b223
---
M src/system/boot/Jamfile
1 file changed, 13 insertions(+), 4 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/16/3016/1

diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile
index c83002f..ce5037a 100644
--- a/src/system/boot/Jamfile
+++ b/src/system/boot/Jamfile
@@ -104,7 +104,7 @@

        switch $(TARGET_ARCH) {
                case x86_64 :
-                       OUTPUT_TARGET on $(efiLoader) = efi-app-x86_64 ;
+                       OUTPUT_TARGET on $(efiLoader) = pei-x86-64 ;
                case arm :
                        OUTPUT_TARGET on $(efiLoader) = binary ;
                case arm64 :
@@ -119,9 +119,18 @@
 actions BuildEFILoader
 {
        rm -f $(1)
-       $(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata -j .data \
-               -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j .dynstr \
-               --output-target=$(OUTPUT_TARGET) $(2) $(1)
+       if [ "$(OUTPUT_TARGET)" = "binary" ]; then
+               # no bfd support, fake efi Pe header
+               $(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata 
-j .data \
+                       -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j 
.dynstr \
+                       --output-target=$(OUTPUT_TARGET) $(2) $(1)
+       else
+               # bfd supports pe + efi for arch
+               $(TARGET_OBJCOPY_$(TARGET_PACKAGING_ARCH)) -j .text -j .sdata 
-j .data \
+                       -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc -j 
.dynstr \
+                       -j .debug* --output-target=$(OUTPUT_TARGET) \
+                       --subsystem=efi-app $(2) $(1)
+       fi
 }



--
To view, visit https://review.haiku-os.org/c/haiku/+/3016
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I60b4a4f5ceb36059033debbe6bf5b01928d6b223
Gerrit-Change-Number: 3016
Gerrit-PatchSet: 1
Gerrit-Owner: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: efi: Switch to direct EFI loader creation - Gerrit