mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
eglibc:
- simplyfing (remove toolchain target in install script) - use system CFLAGS and LDFLAGS - filter out problematic C/LDFLAGS - cleanups & cosmetics
This commit is contained in:
parent
be658e4e89
commit
84e0ee822e
@ -12,11 +12,9 @@ $SCRIPTS/build intltool
|
||||
|
||||
$SCRIPTS/install binutils
|
||||
$SCRIPTS/install gcc-core
|
||||
$SCRIPTS/install eglibc toolchain
|
||||
$SCRIPTS/build eglibc
|
||||
|
||||
if [ "c" != "$TOOLCHAIN_LANGUAGES" ]; then
|
||||
$SCRIPTS/install gcc-final toolchain
|
||||
fi
|
||||
$SCRIPTS/install gcc-final toolchain
|
||||
|
||||
# Tools needed to complete the toolchain
|
||||
|
||||
|
@ -2,16 +2,30 @@
|
||||
|
||||
. config/options
|
||||
|
||||
$SCRIPTS/install linux-headers
|
||||
$SCRIPTS/install gcc-core
|
||||
|
||||
# Fails to compile with GCC's link time optimization.
|
||||
CFLAGS=`echo $CFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||"`
|
||||
LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||" -e "s|-fwhole-program||"`
|
||||
|
||||
# Fails to compile using the gold linker.
|
||||
CFLAGS=`echo $CFLAGS | sed -e "s|-fuse-linker-plugin||" -e "s|-fuse-ld=gold||"`
|
||||
LDFLAGS=`echo $LDFLAGS | sed -e "s|-fuse-linker-plugin||" -e "s|-fuse-ld=gold||"`
|
||||
|
||||
# Filter out some problematic CFLAGS
|
||||
CFLAGS=`echo $CFLAGS | sed -e "s|-D_FILE_OFFSET_BITS=64||" -e "s|-D_LARGEFILE_SOURCE||"`
|
||||
CFLAGS=`echo $CFLAGS | sed -e "s|-ffast-math||"`
|
||||
|
||||
# set some CFLAGS we need
|
||||
CFLAGS="$CFLAGS -fno-stack-protector"
|
||||
|
||||
# dont do an parallel build
|
||||
MAKEFLAGS=-j1
|
||||
|
||||
export BUILD_CC=$HOST_CC
|
||||
export OBJDUMP_FOR_HOST=objdump
|
||||
|
||||
CFLAGS="-Os -fno-stack-protector"
|
||||
|
||||
# eglibc fails to compile with GCC 4.5.0's link time optimization.
|
||||
LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||" -e "s|-fwhole-program||" -e "s|-fuse-ld=gold||"`
|
||||
|
||||
if [ "$DEBUG" = yes ]; then
|
||||
DEBUG_CONFIG="--enable-debug"
|
||||
else
|
||||
@ -60,6 +74,11 @@ OPTION_POSIX_REGEXP_GLIBC = n
|
||||
$DEBUG_OPTIONS
|
||||
EOF
|
||||
|
||||
cat >configparms <<EOF
|
||||
install_root=$SYSROOT_PREFIX
|
||||
slibdir=/lib
|
||||
EOF
|
||||
|
||||
../configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
@ -79,4 +98,4 @@ EOF
|
||||
|
||||
make
|
||||
|
||||
#--enable-add-ons=nptl \
|
||||
make install
|
||||
|
@ -4,22 +4,6 @@
|
||||
|
||||
PKG_DIR=`find $PACKAGES -type d -name $1`
|
||||
|
||||
if [ "$2" = toolchain ]; then
|
||||
rm -rf "$SYSROOT_PREFIX/lib" "$SYSROOT_PREFIX/usr/lib" "$SYSROOT_PREFIX/usr/include"
|
||||
$SCRIPTS/install linux-headers
|
||||
|
||||
cd $PKG_BUILD/objdir-$1
|
||||
|
||||
# eglibc fails to compile with GCC 4.5.0's link time optimization.
|
||||
LDFLAGS=`echo $LDFLAGS | sed -e "s|-flto||" -e "s|-fuse-linker-plugin||" -e "s|-fwhole-program||" -e "s|-fuse-ld=gold||"`
|
||||
|
||||
cat >configparms <<EOF
|
||||
install_root=$SYSROOT_PREFIX
|
||||
EOF
|
||||
make install
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p $INSTALL/lib
|
||||
cp $PKG_BUILD/objdir-$1/elf/ld*.so.* $INSTALL/lib
|
||||
cp $PKG_BUILD/objdir-$1/libc.so.6 $INSTALL/lib
|
||||
@ -46,9 +30,7 @@ mkdir -p $INSTALL/bin
|
||||
cp -P $PKG_BUILD/objdir-$1/locale/locale $INSTALL/bin
|
||||
|
||||
mkdir -p $INSTALL/usr/lib/gconv
|
||||
cp -P $PKG_BUILD/iconvdata/gconv-modules $INSTALL/usr/lib/gconv
|
||||
cp -P $PKG_BUILD/iconvdata/gconv-modules $INSTALL/usr/lib/gconv
|
||||
# didn't yet find a way to separate only needed modules.
|
||||
# the way they are used is described within gconv-modules though
|
||||
cp -P $PKG_BUILD/objdir-$1/iconvdata/*.so $INSTALL/usr/lib/gconv
|
||||
|
||||
exit 0
|
||||
cp -P $PKG_BUILD/objdir-$1/iconvdata/*.so $INSTALL/usr/lib/gconv
|
||||
|
@ -10,7 +10,7 @@ $SCRIPTS/build mpc
|
||||
$SCRIPTS/build ppl
|
||||
$SCRIPTS/build cloog-ppl
|
||||
$SCRIPTS/build libelf
|
||||
$SCRIPTS/install eglibc toolchain
|
||||
$SCRIPTS/build eglibc
|
||||
$SCRIPTS/unpack gcc
|
||||
|
||||
setup_toolchain host
|
||||
|
Loading…
x
Reference in New Issue
Block a user