[haiku-commits] Change in haiku[master]: efi: Ensure MultiBootSubDirSetup runs in arch directories

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 28 Jun 2020 21:03:02 +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/+/2965 ;)


Change subject: efi: Ensure MultiBootSubDirSetup runs in arch directories
......................................................................

efi: Ensure MultiBootSubDirSetup runs in arch directories

* Otherwise, important HAIKU_BOOT_* flags don't make it into
  the build commands.
* Ensure any external sources used by EFI get recompiled
  vs reused due to potential differences in wchar length
  (EFI dictates short-wchar, but no wchar's in our code)

Change-Id: I7a4a0347d39239c73fa510378e048f51be1cd360
---
M src/system/boot/arch/arm/Jamfile
M src/system/boot/platform/efi/arch/arm/Jamfile
M src/system/boot/platform/efi/arch/riscv64/Jamfile
M src/system/boot/platform/efi/arch/x86_64/Jamfile
4 files changed, 76 insertions(+), 50 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/65/2965/1

diff --git a/src/system/boot/arch/arm/Jamfile b/src/system/boot/arch/arm/Jamfile
index 3830c34..dd9c260 100644
--- a/src/system/boot/arch/arm/Jamfile
+++ b/src/system/boot/arch/arm/Jamfile
@@ -2,15 +2,17 @@

 UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;

-# TODO: Is there any reason to recompile arch_string.S here?
-local librootArchObjects =
-#      <src!system!libroot!posix!string!arch!$(TARGET_ARCH)>arch_string.o
+# These must be recompiled due to differing wchar lengths in EFI
+local librootArchSources =
        arch_string.S
 ;

+local librootGenericSources =
+       memset.c
+;
+
 local kernelLibArchObjects =
        <src!system!kernel!lib!arch!$(TARGET_ARCH)>byteorder.o
-       <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
 ;

 local kernelArchSources =
@@ -43,21 +45,28 @@
                        kernel_stubs.cpp
                        $(kernelDebugSources)

-                       $(librootArchObjects)
+                       $(librootGenericSources)
+                       $(librootArchSources)
                        :
                        :
                        $(kernelLibArchObjects)
                ;

+               SEARCH on [ FGristFiles $(kernelGenericSources) ]
+                       = [ FDirName $(HAIKU_TOP) src system kernel arch 
$(TARGET_KERNEL_ARCH) ] ;
+
                SEARCH on [ FGristFiles $(kernelArchSources) ]
                        = [ FDirName $(HAIKU_TOP) src system kernel arch 
$(TARGET_KERNEL_ARCH) ] ;

                SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
                        = [ FDirName $(HAIKU_TOP) src system kernel arch 
generic ] ;

-               SEARCH on [ FGristFiles $(librootArchObjects) ]
+               SEARCH on [ FGristFiles $(librootArchSources) ]
                        = [ FDirName $(HAIKU_TOP) src system libroot posix 
string arch $(TARGET_ARCH) ] ;

+               SEARCH on [ FGristFiles $(librootGenericSources) ]
+                       = [ FDirName $(HAIKU_TOP) src system libroot posix 
string arch generic ] ;
+
                SEARCH on [ FGristFiles $(kernelDebugSources) ]
                        = [ FDirName $(HAIKU_TOP) src system kernel debug ] ;
        }
diff --git a/src/system/boot/platform/efi/arch/arm/Jamfile 
b/src/system/boot/platform/efi/arch/arm/Jamfile
index 830735c..64563a9 100644
--- a/src/system/boot/platform/efi/arch/arm/Jamfile
+++ b/src/system/boot/platform/efi/arch/arm/Jamfile
@@ -5,16 +5,22 @@
 UsePrivateHeaders [ FDirName kernel platform ] ;
 UsePrivateHeaders [ FDirName kernel boot platform efi ] ;

-local arch_src =
-       crt0-efi-$(TARGET_ARCH).S
-       #entry.S
-       relocation_func.cpp
-       arch_smp.cpp
-       arch_start.cpp
-       arch_mmu.cpp
-       arch_timer.cpp
-       ;
+local platform ;
+for platform in [ MultiBootSubDirSetup efi ] {
+    on $(platform) {

-BootMergeObject boot_platform_efi_arm.o :
-       $(arch_src)
-       ;
+       local arch_src =
+               crt0-efi-$(TARGET_ARCH).S
+               #entry.S
+               relocation_func.cpp
+               arch_smp.cpp
+               arch_start.cpp
+               arch_mmu.cpp
+               arch_timer.cpp
+               ;
+
+       BootMergeObject boot_platform_efi_arm.o :
+               $(arch_src)
+               ;
+       }
+}
diff --git a/src/system/boot/platform/efi/arch/riscv64/Jamfile 
b/src/system/boot/platform/efi/arch/riscv64/Jamfile
index 9e5a2ed..b14e789 100644
--- a/src/system/boot/platform/efi/arch/riscv64/Jamfile
+++ b/src/system/boot/platform/efi/arch/riscv64/Jamfile
@@ -5,15 +5,21 @@
 UsePrivateHeaders [ FDirName kernel platform ] ;
 UsePrivateHeaders [ FDirName kernel boot platform efi ] ;

-local arch_src =
-       crt0-efi-$(TARGET_ARCH).S
-       #entry.S
-       relocation_func.cpp
-       #arch_smp.cpp
-       #arch_mmu.cpp
-       #arch_timer.cpp
-       ;
+local platform ;
+for platform in [ MultiBootSubDirSetup efi ] {
+    on $(platform) {

-BootMergeObject boot_platform_efi_riscv64.o :
-       $(arch_src)
-       ;
+       local arch_src =
+               crt0-efi-$(TARGET_ARCH).S
+               #entry.S
+               relocation_func.cpp
+               #arch_smp.cpp
+               #arch_mmu.cpp
+               #arch_timer.cpp
+               ;
+
+       BootMergeObject boot_platform_efi_riscv64.o :
+               $(arch_src)
+               ;
+       }
+}
diff --git a/src/system/boot/platform/efi/arch/x86_64/Jamfile 
b/src/system/boot/platform/efi/arch/x86_64/Jamfile
index c477fd3..0db1b82 100644
--- a/src/system/boot/platform/efi/arch/x86_64/Jamfile
+++ b/src/system/boot/platform/efi/arch/x86_64/Jamfile
@@ -5,25 +5,30 @@
 UsePrivateHeaders [ FDirName kernel platform ] ;
 UsePrivateHeaders [ FDirName kernel boot platform efi ] ;

-{
-       local defines = _BOOT_MODE _BOOT_PLATFORM_EFI ;
-       defines = [ FDefines $(defines) ] ;
-       SubDirCcFlags $(defines) ;
-       SubDirC++Flags $(defines) -fno-rtti ;
+local platform ;
+for platform in [ MultiBootSubDirSetup efi ] {
+    on $(platform) {
+       {
+               local defines = _BOOT_MODE _BOOT_PLATFORM_EFI ;
+               defines = [ FDefines $(defines) ] ;
+               SubDirCcFlags $(defines) ;
+               SubDirC++Flags $(defines) -fno-rtti ;
+       }
+
+       local arch_src =
+               crt0-efi-$(TARGET_ARCH).S
+               entry.S
+               smp_trampoline.S
+               support.S
+               relocation_func.cpp
+               arch_start.cpp
+               arch_smp.cpp
+               arch_mmu.cpp
+               arch_timer.cpp
+               ;
+
+       BootMergeObject boot_platform_efi_x86_64.o :
+               $(arch_src)
+               ;
+       }
 }
-
-local arch_src =
-       crt0-efi-$(TARGET_ARCH).S
-       entry.S
-       smp_trampoline.S
-       support.S
-       relocation_func.cpp
-       arch_start.cpp
-       arch_smp.cpp
-       arch_mmu.cpp
-       arch_timer.cpp
-       ;
-
-BootMergeObject boot_platform_efi_x86_64.o :
-       $(arch_src)
-       ;

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

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

Other related posts:

  • » [haiku-commits] Change in haiku[master]: efi: Ensure MultiBootSubDirSetup runs in arch directories - Gerrit