diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 56e7408e22..2f6c735fde 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -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) ; diff --git a/build/jam/SystemLibraryRules b/build/jam/SystemLibraryRules index 4299a164d8..ea4b90a7da 100644 --- a/build/jam/SystemLibraryRules +++ b/build/jam/SystemLibraryRules @@ -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. diff --git a/configure b/configure index 53c84d1cbe..1de4f74286 100755 --- a/configure +++ b/configure @@ -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