Added bundle to build GCC support library

This commit is contained in:
Tobias Faller 2021-07-04 18:26:30 +02:00
parent 64925fb7ec
commit 03389d4b37
4 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# You can find the latest nano source bundles here:
#
# https://ftpmirror.gnu.org/gcc/
#
GCC_SOURCE_URL=https://ftpmirror.gnu.org/gcc/gcc-11.1.0/gcc-11.1.0.tar.xz

View File

@ -0,0 +1,38 @@
#!/bin/sh
set -e
. ../../common.sh
# Read the common configuration properties.
DOWNLOAD_URL=`read_property GCC_SOURCE_URL`
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd $MAIN_SRC_DIR/source/overlay
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading gcc source bundle file. The '-c' option allows the download to resume.
echo "Downloading gcc source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL
else
echo "Using local gcc source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted gcc.
echo "Removing gcc work area. This may take a while."
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME
mkdir $WORK_DIR/overlay/$BUNDLE_NAME
# Extract gcc to folder 'work/overlay/gcc'.
# Full path will be something like 'work/overlay/gcc/gcc-11.1.0'.
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME
cd $SRC_DIR

View File

@ -0,0 +1,45 @@
#!/bin/sh
set -e
. ../../common.sh
cd $WORK_DIR/overlay/$BUNDLE_NAME
# Change to the gcc source directory which ls finds, e.g. 'gcc-11.1.0'.
cd $(ls -d gcc-*)
if [ -f Makefile ] ; then
echo "Preparing '$BUNDLE_NAME' work area. This may take a while."
make -j $NUM_JOBS clean || true
else
echo "The clean phase for '$BUNDLE_NAME' has been skipped."
fi
rm -rf $DEST_DIR
echo "Configuring '$BUNDLE_NAME'."
CFLAGS="$CFLAGS" ./configure \
--prefix=/usr \
--enable-languages=c \
--disable-multilib \
--disable-static \
--disable-libquadmath \
--enable-shared
echo "Building '$BUNDLE_NAME'."
make -j $NUM_JOBS all-gcc
make -j $NUM_JOBS all-target-libgcc
echo "Installing '$BUNDLE_NAME'."
make -j $NUM_JOBS install-target-libgcc DESTDIR=$DEST_DIR
mkdir -p $OVERLAY_ROOTFS/lib
# With '--remove-destination' all possibly existing soft links in
# '$OVERLAY_ROOTFS' will be overwritten correctly.
cp -r --remove-destination $DEST_DIR/usr/lib64/libgcc_s.so* \
$OVERLAY_ROOTFS/lib/
echo "Bundle '$BUNDLE_NAME' has been installed."
cd $SRC_DIR

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
. ../../common.sh
./01_get.sh
./02_build.sh
cd $SRC_DIR