Working toolchain
This commit is contained in:
parent
bd5cd5a011
commit
a9db73e443
|
@ -1,2 +1,7 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
cmake -B builddbg/ -G Ninja -D CMAKE_CXX_COMPILER=x86_64-elf-gcc -D CMAKE_ASM-ATT_COMPILER=x86_64-elf-gcc -D CMAKE_AR=`which x86_64-elf-ar` -D CMAKE_BUILD_TYPE=Debug
|
|
||||||
|
CWD="$(pwd)"
|
||||||
|
BIN=$CWD/toolchain/local/bin
|
||||||
|
GCC=$BIN/x86_64-pc-acadia-gcc
|
||||||
|
AR=$BIN/x86_64-pc-acadia-ar
|
||||||
|
cmake -B builddbg/ -G Ninja -D CMAKE_CXX_COMPILER=${GCC} -D CMAKE_ASM-ATT_COMPILER=${GCC} -D CMAKE_AR=${AR} -D CMAKE_BUILD_TYPE=Debug
|
||||||
|
|
|
@ -18,11 +18,6 @@ BINUTILS_NAME="binutils-$BINUTILS_VERSION"
|
||||||
BINUTILS_PKG="${BINUTILS_NAME}.tar.xz"
|
BINUTILS_PKG="${BINUTILS_NAME}.tar.xz"
|
||||||
BINUTILS_BASE_URL="https://ftp.gnu.org/gnu/binutils"
|
BINUTILS_BASE_URL="https://ftp.gnu.org/gnu/binutils"
|
||||||
|
|
||||||
NEWLIB_VERSION="4.1.0"
|
|
||||||
NEWLIB_NAME="newlib-$NEWLIB_VERSION"
|
|
||||||
NEWLIB_PKG="${NEWLIB_NAME}.tar.gz"
|
|
||||||
NEWLIB_BASE_URL="ftp://sourceware.org/pub/newlib"
|
|
||||||
|
|
||||||
GCC_VERSION="13.1.0"
|
GCC_VERSION="13.1.0"
|
||||||
GCC_NAME="gcc-$GCC_VERSION"
|
GCC_NAME="gcc-$GCC_VERSION"
|
||||||
GCC_PKG="${GCC_NAME}.tar.xz"
|
GCC_PKG="${GCC_NAME}.tar.xz"
|
||||||
|
@ -38,18 +33,14 @@ pushd "$TOOLCHAIN/srcs"
|
||||||
if [ ! -d "$BINUTILS_NAME" ]; then
|
if [ ! -d "$BINUTILS_NAME" ]; then
|
||||||
tar -xJf ${BINUTILS_PKG}
|
tar -xJf ${BINUTILS_PKG}
|
||||||
pushd $BINUTILS_NAME
|
pushd $BINUTILS_NAME
|
||||||
|
# Set up a baseline to make it easier to create patches in the future.
|
||||||
|
git init
|
||||||
|
git add .
|
||||||
|
git commit -m "base"
|
||||||
patch -p1 <$TOOLCHAIN/patches/binutils/00-first.patch
|
patch -p1 <$TOOLCHAIN/patches/binutils/00-first.patch
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $NEWLIB_PKG ]; then
|
|
||||||
curl -LO $NEWLIB_BASE_URL/$NEWLIB_PKG
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $NEWLIB_NAME ]; then
|
|
||||||
tar -xzf $NEWLIB_PKG
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "$GCC_PKG" ]; then
|
if [ ! -e "$GCC_PKG" ]; then
|
||||||
curl -LO "$GCC_BASE_URL/$GCC_NAME/$GCC_PKG"
|
curl -LO "$GCC_BASE_URL/$GCC_NAME/$GCC_PKG"
|
||||||
fi
|
fi
|
||||||
|
@ -57,7 +48,12 @@ pushd "$TOOLCHAIN/srcs"
|
||||||
if [ ! -d "$GCC_NAME" ]; then
|
if [ ! -d "$GCC_NAME" ]; then
|
||||||
tar -xJf $GCC_PKG
|
tar -xJf $GCC_PKG
|
||||||
pushd $GCC_NAME
|
pushd $GCC_NAME
|
||||||
|
# Set up a baseline to make it easier to create patches in the future.
|
||||||
|
git init
|
||||||
|
git add .
|
||||||
|
git commit -m "base"
|
||||||
patch -p1 <$TOOLCHAIN/patches/gcc/00-first.patch
|
patch -p1 <$TOOLCHAIN/patches/gcc/00-first.patch
|
||||||
|
patch -p1 <$TOOLCHAIN/patches/gcc/01-libstdc++.patch
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -66,8 +62,7 @@ popd
|
||||||
|
|
||||||
mkdir -p "$TOOLCHAIN/build"
|
mkdir -p "$TOOLCHAIN/build"
|
||||||
pushd "$TOOLCHAIN/build"
|
pushd "$TOOLCHAIN/build"
|
||||||
# rm -rf binutils
|
rm -rf binutils
|
||||||
if [ ! -d binutils ]; then
|
|
||||||
mkdir -p binutils
|
mkdir -p binutils
|
||||||
pushd binutils
|
pushd binutils
|
||||||
# skip building documentation
|
# skip building documentation
|
||||||
|
@ -82,20 +77,6 @@ pushd "$TOOLCHAIN/build"
|
||||||
make MAKEINFO=true -j 8
|
make MAKEINFO=true -j 8
|
||||||
make install MAKEINFO=true -j 8
|
make install MAKEINFO=true -j 8
|
||||||
popd
|
popd
|
||||||
fi
|
|
||||||
|
|
||||||
# rm -rf newlib
|
|
||||||
if [ ! -d newlib ]; then
|
|
||||||
mkdir -p newlib
|
|
||||||
pushd newlib
|
|
||||||
$TOOLCHAIN/srcs/$NEWLIB_NAME/configure \
|
|
||||||
--prefix=$SYSROOT/usr \
|
|
||||||
--target=x86_64-elf \
|
|
||||||
--with-sysroot=$SYSROOT
|
|
||||||
make -j 8
|
|
||||||
make -j 8 install
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf gcc
|
rm -rf gcc
|
||||||
mkdir -p gcc
|
mkdir -p gcc
|
||||||
|
@ -104,6 +85,7 @@ pushd "$TOOLCHAIN/build"
|
||||||
--prefix=$PREFIX \
|
--prefix=$PREFIX \
|
||||||
--target=$TARGET \
|
--target=$TARGET \
|
||||||
--with-sysroot=$SYSROOT \
|
--with-sysroot=$SYSROOT \
|
||||||
|
--with-newlib \
|
||||||
--disable-nls \
|
--disable-nls \
|
||||||
--enable-languages=c,c++
|
--enable-languages=c,c++
|
||||||
|
|
||||||
|
@ -112,8 +94,6 @@ pushd "$TOOLCHAIN/build"
|
||||||
make -j 8 all-target-libgcc
|
make -j 8 all-target-libgcc
|
||||||
|
|
||||||
make -j 8 install-gcc install-target-libgcc
|
make -j 8 install-gcc install-target-libgcc
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -35,10 +35,10 @@ index df90720b7..ae12e48d1 100755
|
||||||
i?86-*-mingw32* | \
|
i?86-*-mingw32* | \
|
||||||
x86_64-*-mingw32* | \
|
x86_64-*-mingw32* | \
|
||||||
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
diff --git a/gcc/config.gcc b/gcc/config.gcc
|
||||||
index 6fd159448..f8b4f29bc 100644
|
index 6fd159448..e2fb4b52c 100644
|
||||||
--- a/gcc/config.gcc
|
--- a/gcc/config.gcc
|
||||||
+++ b/gcc/config.gcc
|
+++ b/gcc/config.gcc
|
||||||
@@ -690,6 +690,11 @@ x86_cpus="generic intel"
|
@@ -690,6 +690,12 @@ x86_cpus="generic intel"
|
||||||
|
|
||||||
# Common parts for widely ported systems.
|
# Common parts for widely ported systems.
|
||||||
case ${target} in
|
case ${target} in
|
||||||
|
@ -46,11 +46,12 @@ index 6fd159448..f8b4f29bc 100644
|
||||||
+ gas=yes
|
+ gas=yes
|
||||||
+ gnu_ld=yes
|
+ gnu_ld=yes
|
||||||
+ default_use_cxa_atexit=yes
|
+ default_use_cxa_atexit=yes
|
||||||
|
+ use_gcc_stdint=provide
|
||||||
+ ;;
|
+ ;;
|
||||||
*-*-darwin*)
|
*-*-darwin*)
|
||||||
tmake_file="t-darwin "
|
tmake_file="t-darwin "
|
||||||
tm_file="${tm_file} darwin.h"
|
tm_file="${tm_file} darwin.h"
|
||||||
@@ -1126,6 +1131,9 @@ case ${target} in
|
@@ -1126,6 +1132,9 @@ case ${target} in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case ${target} in
|
case ${target} in
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue