From Alex von Gluck IV <kallisti5@xxxxxxxxxxx>:
Alex von Gluck IV has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/2280 ;)
Change subject: efi: link libgcc static on 32-bit builds
......................................................................
efi: link libgcc static on 32-bit builds
Change-Id: Ied0de8caeb942295faaeec4d35a108ef146f5982
---
M src/system/boot/Jamfile
M src/system/boot/loader/Jamfile
M src/system/boot/platform/efi/Jamfile
3 files changed, 26 insertions(+), 7 deletions(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/80/2280/1
diff --git a/src/system/boot/Jamfile b/src/system/boot/Jamfile
index 826c677..85fc8d7 100644
--- a/src/system/boot/Jamfile
+++ b/src/system/boot/Jamfile
@@ -223,19 +223,21 @@
for platform in [ MultiBootSubDirSetup ] {
on $(platform) {
- if $(TARGET_ARCH) = x86_64 && $(TARGET_BOOT_PLATFORM) = efi {
- SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot
os arch
- x86_64 ] ;
- } else {
- SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot
os arch
-
$(TARGET_KERNEL_ARCH) ] ;
- }
+ SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot os arch
$(TARGET_KERNEL_ARCH) ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix
string ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix
stdlib ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix
locale ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) kernel lib ] ;
+ local extraLibs = ;
+ if $(TARGET_BOOT_PLATFORM) = efi {
+ if $(TARGET_KERNEL_ARCH) in arm x86 {
+ # 32-bit builds need sw 64-bit div calls
+ extraLibs += [ TargetStaticLibgcc ] ;
+ }
+ }
+
BootMergeObject boot_libroot_$(platform:G=).o :
abs.c
ctype.cpp
@@ -262,6 +264,8 @@
strtol.c
strtoul.c
$(extraSources)
+ : :
+ $(extraLibs)
;
AddResources haiku_loader.$(TARGET_BOOT_PLATFORM) :
boot_loader.rdef ;
@@ -300,6 +304,7 @@
]
# libroot functions needed by the stage2 boot loader
boot_libroot_$(platform:G=).o
+ $(extraLibs)
:
$(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(platform:G=).ld
: $(ldflags)
diff --git a/src/system/boot/loader/Jamfile b/src/system/boot/loader/Jamfile
index c27db4e..d91cf14 100644
--- a/src/system/boot/loader/Jamfile
+++ b/src/system/boot/loader/Jamfile
@@ -94,6 +94,13 @@
SubDirC++Flags -fno-rtti -include $(kernelC++Header) ;
}
+ local extraLibs = ;
+ if $(TARGET_BOOT_PLATFORM) = efi {
+ if $(TARGET_KERNEL_ARCH) in arm x86 {
+ # 32-bit builds need sw 64-bit div calls
+ extraLibs += [ TargetStaticLibgcc ] ;
+ }
+ }
BootStaticLibrary [ MultiBootGristFiles boot_loader ] :
PathBlacklist.cpp
@@ -125,6 +132,8 @@
DataIO.cpp
Referenceable.cpp
+ : :
+ $(extraLibs)
;
# The partition support is built in an extra static library
diff --git a/src/system/boot/platform/efi/Jamfile
b/src/system/boot/platform/efi/Jamfile
index 2a92d9c..9ca8ec5 100644
--- a/src/system/boot/platform/efi/Jamfile
+++ b/src/system/boot/platform/efi/Jamfile
@@ -37,6 +37,11 @@
support_libs += boot_fdt.a ;
}
+if $(TARGET_KERNEL_ARCH) in arm x86 {
+ # 32-bit builds need sw 64-bit div calls
+ support_libs += [ TargetStaticLibgcc ] ;
+}
+
local platform ;
for platform in [ MultiBootSubDirSetup efi ] {
on $(platform) {
--
To view, visit https://review.haiku-os.org/c/haiku/+/2280
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Ied0de8caeb942295faaeec4d35a108ef146f5982
Gerrit-Change-Number: 2280
Gerrit-PatchSet: 1
Gerrit-Owner: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
Gerrit-MessageType: newchange