coverity: add coverity-scan.sh; cross/init.sh generate dynamically linked gcc/binutils

Coverity use an LD_PRELOAD library to intercept syscalls, so it cannot work with
a statically linked cross-compiler
This commit is contained in:
Giacomo Tesio 2016-11-26 16:23:29 +01:00
parent dc7ca89d09
commit bcce8f4499
2 changed files with 38 additions and 2 deletions

36
coverity-scan.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
set -e
cd `dirname $0`
cd ..
export JEHANNE=`pwd`
export PATH="$JEHANNE/hacking/bin:$PATH"
export PATH="$JEHANNE/hacking/cross/toolchain/bin:$PATH"
export ARCH=amd64
git clean -xdf arch/ sys/ qa/ usr/
if [ ! -f "$JEHANNE/hacking/bin/ufs" ]; then
echo "Cannot find build tools in $JEHANNE/hacking/bin"
$JEHANNE/hacking/buildtools.sh
fi
if [ ! -f "$JEHANNE/hacking/cross/toolchain/bin/x86_64-jehanne-gcc" ]; then
echo "Cannot find cross-compiling toolchain in $JEHANNE/hacking/bin"
if [ -f "$JEHANNE/tmp/toolchain/bin/x86_64-jehanne-gcc" ]; then
echo "Found cross-compiling toolchain in $JEHANNE/tmp/toolchain/"
mv $JEHANNE/tmp/toolchain/ $JEHANNE/hacking/cross/toolchain
else
echo "Creating cross-compiling toolchain..."
(cd $JEHANNE/hacking/cross/; ./init.sh)
fi
fi
export TOOLPREFIX=x86_64-jehanne-
export CC=gcc
echo
build all
if [ "$TRAVIS_BUILD_DIR" != "" ]; then
echo "Move cross-compiling toolchain to $JEHANNE/tmp/toolchain for Travis caches"
mv $JEHANNE/hacking/cross/toolchain $JEHANNE/tmp/toolchain/
fi

View File

@ -149,7 +149,7 @@ if [ ! -f toolchain/bin/x86_64-jehanne-ar ]; then
(grep 'eelf_x86_64_jehanne.c \\' src/binutils/ld/Makefile.am || sed -i 's/.*ALL_64_EMULATION_SOURCES = \\.*/&\n\teelf_x86_64_jehanne.c \\/' src/binutils/ld/Makefile.am) &&
cd src/binutils/ld && automake && cd ../ &&
cd $BINUTILS_BUILD_DIR &&
$CROSS_DIR/src/binutils/configure --disable-shared --enable-static --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --target=x86_64-jehanne --enable-interwork --enable-multilib --disable-nls --disable-werror &&
$CROSS_DIR/src/binutils/configure --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --target=x86_64-jehanne --enable-interwork --enable-multilib --disable-nls --disable-werror &&
cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/bfd/doc/Makefile &&
cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/bfd/po/Makefile &&
cp $CROSS_DIR/patch/MakeNothing.in $CROSS_DIR/src/binutils/gas/doc/Makefile &&
@ -182,7 +182,7 @@ fi
) &&
dynpatch 'gcc/fixincludes/mkfixinc.sh' 'i\?86-\*-cygwin\*' &&
cd $GCC_BUILD_DIR &&
$CROSS_DIR/src/gcc/configure --disable-shared --enable-static --target=x86_64-jehanne --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --enable-languages=c,c++ &&
$CROSS_DIR/src/gcc/configure --target=x86_64-jehanne --prefix=$JEHANNE/hacking/cross/toolchain --with-sysroot=$JEHANNE --enable-languages=c,c++ &&
make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true all-gcc all-target-libgcc &&
make MAKEINFO=true MAKEINFOHTML=true TEXI2DVI=true TEXI2PDF=true DVIPS=true install-gcc install-target-libgcc
# &&