Created
June 30, 2020 22:02
-
-
Save kallisti5/a921cad055b775a2fdc147158b73c09a to your computer and use it in GitHub Desktop.
Haiku arm-soft-float
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sys-devel/gcc_bootstrap/gcc_bootstrap-5.4.0_2016_06_04.recipe b/sys-devel/gcc_bootstrap/gcc_bootstrap-5.4.0_2016_06_04.recipe | |
index fe9c724..35379bd 100644 | |
--- a/sys-devel/gcc_bootstrap/gcc_bootstrap-5.4.0_2016_06_04.recipe | |
+++ b/sys-devel/gcc_bootstrap/gcc_bootstrap-5.4.0_2016_06_04.recipe | |
@@ -11,7 +11,7 @@ SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" | |
CHECKSUM_SHA256="535376dc64d2247b5cb8c70af9c7b952d4391a1485acca80d2779ab431f1a222" | |
REVISION="1" | |
-ARCHITECTURES="!x86_gcc2 x86 x86_64 ppc arm m68k" | |
+ARCHITECTURES="!x86_gcc2 x86 x86_64 ppc arm arm64 m68k" | |
SECONDARY_ARCHITECTURES="x86" | |
libstdcxxSoVersion="6" | |
@@ -82,7 +82,7 @@ BUILD() | |
# 32-bit libraries, too, which fails as no 32-bit libroot is available | |
additionalConfigureFlags+=" --disable-multilib" | |
fi | |
- if [ $effectiveTargetArchitecture == arm ]; then | |
+ if [ $effectiveTargetArchitecture == arm ] || [ $effectiveTargetArchitecture == arm64 ]; then | |
# disable multilib support, as x86_64 by default tries to build the | |
# soft-float libraries, too, which fails as no soft float libroot is | |
# available | |
@@ -126,8 +126,16 @@ BUILD() | |
make clean | |
ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h | |
make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" | |
- mv libgcc.a libgcc-kernel.a | |
- mv libgcc_eh.a libgcc_eh-kernel.a | |
+ mv libgcc.a saved/libgcc-kernel.a | |
+ mv libgcc_eh.a saved/libgcc_eh-kernel.a | |
+ if [ $effectiveTargetArchitecture == arm ] || [ $effectiveTargetArchitecture == arm64 ]; then | |
+ # EFI on ARM requires soft-float until we get into the kernel. | |
+ make clean | |
+ ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.ha | |
+ make CFLAGS="-O2 $kernelCcFlags -msoft-float" CXXFLAGS="-O2 $kernelCcFlags -msoft-float" | |
+ mv libgcc.a saved/libgcc-boot.a | |
+ mv libgcc_eh.a saved/libgcc_eh-boot.a | |
+ fi | |
mv saved/* . | |
rmdir saved | |
cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ | |
@@ -143,7 +151,13 @@ BUILD() | |
sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ | |
"../config.h" | |
make CFLAGS="-O2 $kernelCcFlags" CXXFLAGS="-O2 $kernelCcFlags" | |
- mv .libs/libsupc++.a .libs/libsupc++-kernel.a | |
+ mv .libs/libsupc++.a saved/libsupc++-kernel.a | |
+ if [ $effectiveTargetArchitecture == arm ] || [ $effectiveTargetArchitecture == arm64 ]; then | |
+ # EFI on ARM requires soft-float until we get into the kernel. | |
+ make clean | |
+ make CFLAGS="-O2 $kernelCcFlags -msoft-float" CXXFLAGS="-O2 $kernelCcFlags -msoft-float" | |
+ mv .libs/libsupc++.a saved/libsupc++-boot.a | |
+ fi | |
mv saved/* .libs/ | |
rmdir saved | |
} | |
@@ -180,6 +194,10 @@ INSTALL() | |
libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 | |
cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ | |
$gccLibDir/ | |
+ if [ $effectiveTargetArchitecture == arm ] || [ $effectiveTargetArchitecture == arm64 ]; then | |
+ cp $libstdcxxDir/libsupc++/.libs/libsupc++-boot.a \ | |
+ $gccLibDir/ | |
+ fi | |
ln -s libstdc++.so $installDestDir$libDir/libsupc++.so | |
cp $gccLibDir/libsupc++*.a $installDestDir$developLibDir/ | |
@@ -187,6 +205,11 @@ INSTALL() | |
cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ | |
$objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ | |
$gccLibDir/ | |
+ if [ $effectiveTargetArchitecture == arm ] || [ $effectiveTargetArchitecture == arm64 ]; then | |
+ cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-boot.a \ | |
+ $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-boot.a \ | |
+ $gccLibDir/ | |
+ fi | |
$effectiveTargetMachineTriple-strip --strip-debug \ | |
$gccLibDir/libgcc_s.so.$libgccSoVersion | |
cp -d $gccLibDir/libgcc_s.so \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment