configure & build: make use of 64-bit libgcc and libsupc++ for EFI/x86_64

Change-Id: I7636530d927843d155b9d7dada2db4f67c875290
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5139
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Jérôme Duval 2022-03-23 13:08:47 +01:00
parent 69b5103b54
commit 4df4b48fc6
3 changed files with 31 additions and 9 deletions

View File

@ -626,6 +626,8 @@ for var in $(archDependentBuildVars)_$(TARGET_PACKAGING_ARCHS) {
TARGET_BOOT_LIBGCC = $(HAIKU_BOOT_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
TARGET_BOOT_LIBSUPC++ = $(HAIKU_BOOT_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
TARGET_BOOT_32_LIBGCC = $(HAIKU_BOOT_32_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
TARGET_BOOT_32_LIBSUPC++ = $(HAIKU_BOOT_32_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
TARGET_KERNEL_PLATFORM ?= $(HAIKU_KERNEL_PLATFORM) ;

View File

@ -121,9 +121,13 @@ rule TargetBootLibsupc++ asPath
if $(TARGET_PLATFORM) = haiku {
if $(TARGET_PACKAGING_ARCH) = x86_64 {
# we need to use the 32-bit libsupc++.a built by the cross-compiler
return $(TARGET_BOOT_LIBSUPC++) ;
if $(TARGET_BOOT_PLATFORM) = efi {
# we need to use the 64-bit libsupc++.a built by the cross-compiler
return $(TARGET_BOOT_LIBSUPC++) ;
} else {
# we need to use the 32-bit libsupc++.a built by the cross-compiler
return $(TARGET_BOOT_32_LIBSUPC++) ;
}
# TODO: ideally, we would build this as part of gcc_syslibs_devel,
# but that isn't currently possible, as that would require
# 32-bit support (libraries and glue-code) on x86_64-Haiku.
@ -239,9 +243,13 @@ rule TargetBootLibgcc architecture : asPath
if $(TARGET_PLATFORM) = haiku {
if $(architecture) = x86_64 {
# we need to use the 32-bit libgcc.a built by the cross-compiler
return $(TARGET_BOOT_LIBGCC) ;
if $(TARGET_BOOT_PLATFORM) = efi {
# we need to use the 64-bit libgcc.a built by the cross-compiler
return $(TARGET_BOOT_LIBGCC) ;
} else {
# we need to use the 32-bit libgcc.a built by the cross-compiler
return $(TARGET_BOOT_32_LIBGCC) ;
}
# TODO: ideally, we would build this as part of gcc_syslibs_devel,
# but that isn't currently possible, as that would require
# 32-bit support (libraries and glue-code) on x86_64-Haiku.

18
configure vendored
View File

@ -314,18 +314,24 @@ standard_gcc_settings()
local bootLibgcc
local bootLibSupCxx
local bootCxxHeaders
local boot32Libgcc
local boot32LibSupCxx
local boot32CxxHeaders
case $gccMachine in
x86_64-*)
# Boot loader is 32-bit, need the 32-bit libs and c++ config
bootLibgcc=`$gcc -m32 -print-file-name=libgcc.a`
bootLibSupCxx=`$gcc -m32 -print-file-name=libsupc++.a`
boot32Libgcc=`$gcc -m32 -print-file-name=libgcc.a`
boot32LibSupCxx=`$gcc -m32 -print-file-name=libsupc++.a`
bootLibgcc=`$gcc -print-file-name=libgcc.a`
bootLibSupCxx=`$gcc -print-file-name=libsupc++.a`
local headersBase=$gccdir/../../../..
local headers=$headersBase/$gccMachine/include/c++/$gccRawVersion
if [ ! -d $headers ]; then
headers=$headersBase/include/c++/$gccRawVersion
fi
bootCxxHeaders="$headers/$gccMachine/32"
boot32CxxHeaders="$headers/$gccMachine/32"
bootCxxHeaders="$headers/$gccMachine"
;;
esac
@ -355,6 +361,9 @@ standard_gcc_settings()
set_variable HAIKU_BOOT_CXX_HEADERS_DIR_$targetArch "$bootCxxHeaders"
set_variable HAIKU_BOOT_LIBSUPCXX_$targetArch "$bootLibSupCxx"
set_variable HAIKU_BOOT_LIBGCC_$targetArch $bootLibgcc
set_variable HAIKU_BOOT_32_CXX_HEADERS_DIR_$targetArch "$boot32CxxHeaders"
set_variable HAIKU_BOOT_32_LIBSUPCXX_$targetArch "$boot32LibSupCxx"
set_variable HAIKU_BOOT_32_LIBGCC_$targetArch $boot32Libgcc
set_variable HAIKU_USE_GCC_GRAPHITE_$targetArch $useGraphite
standard_gcc_settings_targetArch=$targetArch
@ -1132,6 +1141,8 @@ for targetArch in $HAIKU_PACKAGING_ARCHS; do
HAIKU_GCC_LIB_DIR HAIKU_GCC_LIB_DIR
HAIKU_BOOT_LIBGCC HAIKU_BOOT_LIBGCC
HAIKU_BOOT_LIBSUPC++ HAIKU_BOOT_LIBSUPCXX
HAIKU_BOOT_32_LIBGCC HAIKU_BOOT_32_LIBGCC
HAIKU_BOOT_32_LIBSUPC++ HAIKU_BOOT_32_LIBSUPCXX
HAIKU_AR HAIKU_AR
HAIKU_LD HAIKU_LD
HAIKU_OBJCOPY HAIKU_OBJCOPY
@ -1157,6 +1168,7 @@ for targetArch in $HAIKU_PACKAGING_ARCHS; do
# lines so that jam doesn't hit the maximum line length.
variables="
HAIKU_BOOT_C++_HEADERS_DIR HAIKU_BOOT_CXX_HEADERS_DIR
HAIKU_BOOT_32_C++_HEADERS_DIR HAIKU_BOOT_32_CXX_HEADERS_DIR
"
set -- $variables
while [ $# -ge 2 ]; do