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 \
|
2019-03-03 15:51:22 +01:00
|
|
|
--with-as="$TCDIR/bin/$TARGET-as" \
|
|
|
|
--with-ld="$TCDIR/bin/$TARGET-ld" \
|
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() {
|
|
|
|
make install
|
2018-02-16 00:53:38 +01:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
mkdir -p "$PKGDEPLOYDIR/lib"
|
|
|
|
mv ${TCDIR}/${TARGET}/{include,lib} "$PKGDEPLOYDIR"
|
|
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
|
2019-02-27 21:36:51 +01:00
|
|
|
|
2019-03-10 15:47:33 +01:00
|
|
|
find -H "$PKGDEPLOYDIR/include/c++" -type d -printf "dir %p 0%m 0 0\\n" |\
|
|
|
|
tail -n +2 | sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
|
|
|
|
|
|
|
|
find -H "$PKGDEPLOYDIR/include/c++" -type l -printf "slink %p 0%m 0 0 %l\\n" |\
|
|
|
|
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
|
|
|
|
|
|
|
|
find -H "$PKGDEPLOYDIR/include/c++" -type f -printf "file %p 0%m 0 0\\n" |\
|
|
|
|
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
|
2019-02-27 21:36:51 +01:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
if [ -f "$PKGDEPLOYDIR/lib/libmpx.a" ]; then
|
|
|
|
cat >> "$PKGDEPLOYDIR/libgcc-dev.files" <<_EOF
|
2019-02-27 21:36:51 +01:00
|
|
|
file lib/libmpx.a 0644 0 0
|
|
|
|
file lib/libmpxwrappers.a 0644 0 0
|
|
|
|
_EOF
|
|
|
|
fi
|
2017-12-09 21:51:48 +01:00
|
|
|
}
|