2017-12-09 21:51:48 +01:00
|
|
|
# inherit package details from first stage GCC
|
2018-02-15 23:47:54 +01:00
|
|
|
source "$SCRIPTDIR/pkg/tc-gcc1/build"
|
2019-02-27 14:22:03 +01:00
|
|
|
DEPENDS="tc-gcc1 libc-dev linux-dev"
|
2019-02-28 09:11:07 +01:00
|
|
|
SUBPKG="crt libstdc++ libstdc++-dev libgcc libgcc-dev crt-dev"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
build() {
|
2018-10-20 12:52:06 +02:00
|
|
|
local extra="--disable-libssp"
|
2018-10-19 13:02:06 +02:00
|
|
|
|
|
|
|
if [ "x$TC_HARDENING" = "xyes" ]; then
|
2018-10-20 12:52:06 +02:00
|
|
|
extra="$extra --enable-default-pie"
|
2018-10-19 13:02:06 +02:00
|
|
|
extra="$extra --enable-default-ssp"
|
|
|
|
fi
|
|
|
|
|
2018-02-16 23:22:04 +01:00
|
|
|
$1/configure --prefix="$TCDIR" --target="$TARGET" \
|
|
|
|
--build="$HOSTTUPLE" --host="$HOSTTUPLE" \
|
|
|
|
--with-sysroot="$TCDIR/$TARGET" \
|
|
|
|
--disable-nls --enable-languages=c,c++ \
|
|
|
|
--enable-c99 --enable-long-long \
|
2018-10-08 22:05:04 +02:00
|
|
|
--enable-libmudflap --disable-multilib \
|
2018-10-20 22:17:04 +02:00
|
|
|
--disable-libsanitizer --disable-libquadmath \
|
2018-10-19 13:02:06 +02:00
|
|
|
--with-arch="$GCC_CPU" $extra $GCC_EXTRACFG \
|
2018-02-16 23:22:04 +01:00
|
|
|
--with-native-system-header-dir="/include"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
make -j $NUMJOBS
|
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
2018-02-16 00:53:38 +01:00
|
|
|
local SOURCE="$1"
|
2018-02-16 23:22:04 +01:00
|
|
|
local DEPLOY="$2"
|
2018-02-16 00:53:38 +01:00
|
|
|
|
2017-12-09 21:51:48 +01:00
|
|
|
make install
|
2018-02-16 00:53:38 +01:00
|
|
|
|
|
|
|
local f dep
|
|
|
|
|
|
|
|
for f in $(ls ${TCDIR}/${TARGET}/include); do
|
|
|
|
for dep in $DEPENDS; do
|
2018-06-17 13:28:18 +02:00
|
|
|
if [ -e ${PKGDEPLOYDIR}/${dep}/include/$f ]; then
|
2018-02-16 00:53:38 +01:00
|
|
|
rm -rf "$TCDIR/$TARGET/include/$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in $(ls ${TCDIR}/${TARGET}/lib); do
|
|
|
|
for dep in $DEPENDS; do
|
|
|
|
if [ -e ${PKGDEPLOYDIR}/${dep}/lib/$f ]; then
|
|
|
|
rm -rf "$TCDIR/$TARGET/lib/$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p "$DEPLOY/lib"
|
2018-06-17 13:28:18 +02:00
|
|
|
mv ${TCDIR}/${TARGET}/{include,lib} "$DEPLOY"
|
|
|
|
rm ${DEPLOY}/lib/*.la
|
2019-02-03 17:13:28 +01:00
|
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$DEPLOY"
|
2019-02-27 21:36:51 +01:00
|
|
|
|
2019-02-28 09:11:07 +01:00
|
|
|
cat >> "$DEPLOY/libstdc++-dev.files" <<_EOF
|
|
|
|
dir include 0755 0 0
|
|
|
|
dir include/c++ 0755 0 0
|
|
|
|
dir include/c++/8.2.0 0755 0 0
|
2019-02-27 21:36:51 +01:00
|
|
|
dir include/c++/8.2.0/$TARGET 0775 0 0
|
|
|
|
dir include/c++/8.2.0/$TARGET/bits 0775 0 0
|
|
|
|
dir include/c++/8.2.0/$TARGET/ext 0775 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/stdtr1c++.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/gthr-single.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/ctype_inline.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/gthr-posix.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/ctype_base.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/c++io.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/gthr.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/c++locale.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/cpu_defines.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/c++config.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/atomic_word.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/os_defines.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/time_members.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/basic_file.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/gthr-default.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/cxxabi_tweaks.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/opt_random.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/extc++.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/stdc++.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/c++allocator.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/error_constants.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/bits/messages_members.h 0644 0 0
|
|
|
|
file include/c++/8.2.0/$TARGET/ext/opt_random.h 0644 0 0
|
|
|
|
_EOF
|
|
|
|
|
|
|
|
if [ -f "$DEPLOY/lib/libmpx.a" ]; then
|
|
|
|
cat >> "$DEPLOY/libgcc-dev.files" <<_EOF
|
|
|
|
file lib/libmpx.a 0644 0 0
|
|
|
|
file lib/libmpxwrappers.a 0644 0 0
|
|
|
|
_EOF
|
|
|
|
fi
|
2017-12-09 21:51:48 +01:00
|
|
|
}
|