Skip to content

Commit

Permalink
Fix toolchain build
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalmiel committed Dec 2, 2023
1 parent 7ba0055 commit 3238375
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
sudo add-apt-repository --yes ppa:deadsnakes/ppa
sudo apt-get update
apt-fast -y install nasm meson ninja-build bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo xorriso autotools-dev automake autoconf autoconf-archive gettext pkgconf autopoint gcc-12 g++-12 gperf linux-libc-dev python3.11 groff gengetopt libunistring-dev
apt-fast -y install nasm meson ninja-build bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo xorriso autotools-dev automake autoconf autoconf-archive gettext pkgconf autopoint gcc-12 g++-12 gperf linux-libc-dev python3.11 groff gengetopt cmake git rsync wget help2man
- name: Configure gcc
run: |
Expand Down
24 changes: 15 additions & 9 deletions sysroot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ CROSS=$CYKUSZ_DIR/sysroot/cross
TRIPLE=x86_64-cykusz

export PATH=$CYKUSZ_DIR/sysroot/bin:$CROSS/bin:$PATH
export ACLOCAL_PATH=$CROSS/share/aclocal
export PKG_CONFIG_PATH=$SYSROOT/usr/lib/pkgconfig

function _prepare_mlibc {
if [ ! -d $MLIBC_SRC_DIR ]; then
Expand Down Expand Up @@ -258,7 +260,7 @@ function _prepare_libidn2 {
function _prepare_pcre2 {
if [ ! -d $PCRE2_SRC_DIR ]; then
mkdir -p $SRC_DIR
git clone --depth 1 -b cykusz https://github.com/rafalmiel/libpsl.git $PCRE2_SRC_DIR
git clone --depth 1 -b cykusz https://github.com/rafalmiel/pcre2.git $PCRE2_SRC_DIR

pushd .
cd $PCRE2_SRC_DIR
Expand Down Expand Up @@ -407,7 +409,7 @@ function _binutils {
pushd .

cd $BINUTILS_BUILD_DIR
$BINUTILS_SRC_DIR/configure --target=$TRIPLE --prefix="$CROSS" --with-sysroot=$SYSROOT --disable-werror --disable-gdb --enable-shared
PKG_CONFIG_PATH=/usr/lib/pkgconfig $BINUTILS_SRC_DIR/configure --target=$TRIPLE --prefix="$CROSS" --with-sysroot=$SYSROOT --disable-werror --disable-gdb --enable-shared

popd

Expand All @@ -424,7 +426,7 @@ function _gcc {
pushd .

cd $GCC_BUILD_DIR
$GCC_SRC_DIR/configure --target=$TRIPLE --prefix="$CROSS" --with-sysroot=$SYSROOT --enable-languages=c,c++ --enable-threads=posix --enable-shared
PKG_CONFIG_PATH=/usr/lib/pkgconfig $GCC_SRC_DIR/configure --target=$TRIPLE --prefix="$CROSS" --with-sysroot=$SYSROOT --enable-languages=c,c++ --enable-threads=posix --enable-shared

popd

Expand All @@ -440,7 +442,7 @@ function _libtool {
pushd .

cd $LIBTOOL_BUILD_DIR
$LIBTOOL_SRC_DIR/configure --prefix=$CROSS
PKG_CONFIG_PATH=/usr/lib/pkgconfig $LIBTOOL_SRC_DIR/configure --prefix=$CROSS

make -j4
make install
Expand Down Expand Up @@ -604,7 +606,7 @@ function _cykusz_nano {
pushd .

cd $NANO_CYKUSZ_BUILD_DIR
CFLAGS="-O0 -g" $NANO_SRC_DIR/configure --host=$TRIPLE --target=$TRIPLE --prefix=/usr --disable-nanorc
$NANO_SRC_DIR/configure --host=$TRIPLE --target=$TRIPLE --prefix=/usr --disable-nanorc

popd

Expand Down Expand Up @@ -692,7 +694,7 @@ function _cykusz_libpsl {

cd $LIBPSL_CYKUSZ_BUILD_DIR

$LIBPSL_SRC_DIR/configure --host=$TRIPLE --prefix=/usr --disable-static --disable-asan --disable-cfi --disable-ubsan --disable-man --disable-runtime
$LIBPSL_SRC_DIR/configure --host=$TRIPLE --with-sysroot=$SYSROOT --prefix=/usr --disable-static --disable-asan --disable-cfi --disable-ubsan --disable-man --disable-runtime

make DESTDIR=$SYSROOT -j4
make DESTDIR=$SYSROOT install
Expand Down Expand Up @@ -777,10 +779,14 @@ function _cykusz_libidn2 {

cd $LIBIDN2_CYKUSZ_BUILD_DIR

$LIBIDN2_SRC_DIR/configure --disable-doc --disable-nls
PKG_CONFIG_PATH=/usr/lib/pkgconfig $LIBIDN2_SRC_DIR/configure --disable-doc --disable-nls
#cp $LIBIDN2_SRC_DIR/lib/idna-tables-properties.csv ./lib/
cp ./lib/idn2.h $LIBIDN2_SRC_DIR/lib/
make -j4

cd lib
make gendata
make gentr46map
cd ../

cp ./lib/gendata $LIBIDN2_SRC_DIR/lib/gendata
cp ./lib/gentr46map $LIBIDN2_SRC_DIR/lib/gentr46map
Expand All @@ -789,7 +795,7 @@ function _cykusz_libidn2 {

cp ./lib/idn2.h $LIBIDN2_SRC_DIR/lib/

make DESTDIR=$SYSROOT -j4
VERBOSE=1 make DESTDIR=$SYSROOT -j4
make DESTDIR=$SYSROOT install

popd
Expand Down
3 changes: 3 additions & 0 deletions sysroot/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ $SPATH/build.sh linux_headers > $LOGDIR/linux_headers.log 2>&1
echo "Creating sysroot..."
$SPATH/build.sh sysroot > $LOGDIR/sysroot.log 2>&1

echo "Building libtool..."
$SPATH/build.sh libtool > $LOGDIR/libtool.log 2>&1

echo "Building binutils..."
$SPATH/build.sh binutils > $LOGDIR/binutils.log 2>&1

Expand Down

0 comments on commit 3238375

Please sign in to comment.