Вопрос

Edit: Used gcc-version is 4.6.

I'm trying to build a toolchain for which I have a buildscript to build the required libraries.

I'm trying to build binutils and since warnings are seen as errors, and stop the buildprocess, I have the following part in the buildscript:

build_binutils() {
echo "Building binutils..."
if [ ! -e .binutils_extracted ] ; then
    tar -xjf ${FILES}/binutils-${BINUTILS_VER}.tar.bz2
    touch .binutils_extracted
fi
    CFLAGS="-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter"
    echo "echoing cflags..."
    echo $CFLAGS
    rm -rf binutils-build && mkdir -p binutils-build && cd binutils-build &&
    ../binutils-${BINUTILS_VER}/configure --target=arm-elf --prefix=${PREFIX} --enable-interwork --enable-multilib &&
make ${MAKE_THREADS} all CFLAGS=${CFLAGS} &&
    make install &&
    cd ${GNUARM_BUILDDIR}
}

When I run the buildscript, it'll stop on an error which is coming from a unused-but-set-parameter warning, because the gcc runs only with the first supplied -Wno-error switch, which can be seen in the log i.e.

gcc -c -DHAVE_CONFIG_H -Wno-error=unused-but-set-variable  -I. -I../../binutils-2.20.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  ../../binutils-2.20.1/libiberty/safe-ctype.c -o safe-ctype.o

My question would be how I can make gcc realize both switches?

Edit: I know that CFLAGS indeed is containing both switches, since the echo brings both out.

Это было полезно?

Решение

It looks like a quoting problem to me.

Try using CFLAGS="${CFLAGS}"

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top