我尝试使用更新的工具链(如4.8.3或4.9.1)从4.6构建libgcc,libsupc ++。当我尝试使用比4.6.4更新的gcc构建时,我收到了错误:
/home/user/toolchain/arm-linux-gnueabi-linaro_4.8.3-2014.04/bin/arm-linux-gnueabi-g++ -Os -fno-builtin -fno-common -ffreestanding -isystem ../libbase/include -isystem include -Ilibsupc++ -Ilibgcc -DIN_LIBGCC2 -mfloat-abi=soft -marm -march=armv7-a -c /home/user/project/lxx/libsupc++/array_type_info.cc -o libsupc++/array_type_info.pic.o -fPIC -DPIC
In file included from /home/user/toolchain/arm-linux-gnueabi-linaro_4.8.3-2014.04/arm-linux-gnueabi/include/c++/4.8.3/arm-linux-gnueabi/bits/c++config.h:426:0,
from libsupc++/exception:39,
from /home/user/project/lxx/libsupc++/typeinfo:36,
from /home/user/project/lxx/libsupc++/tinfo.h:26,
from /home/user/project/lxx/libsupc++/array_type_info.cc:25:
/home/user/toolchain/arm-linux-gnueabi-linaro_4.8.3-2014.04/arm-linux-gnueabi/include/c++/4.8.3/arm-linux-gnueabi/bits/os_defines.h:44:19: error: missing binary operator before token "("
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
我尝试添加标志-nostdinc ++,但是我收到了错误:
/home/user/toolchain/arm-linux-gnueabi-linaro_4.8.3-2014.04/bin/arm-linux-gnueabi-g++ -Os -fno-builtin -fno-common -ffreestanding -isystem ../libbase/include -isystem include -Ilibsupc++ -Ilibgcc -DIN_LIBGCC2 -mfloat-abi=soft -marm -march=armv7-a -nostdinc++ -c /home/user/project/lxx/libsupc++/array_type_info.cc -o libsupc++/array_type_info.pic.o -fPIC -DPIC
In file included from /home/user/project/lxx/libsupc++/typeinfo:36:0,
from /home/user/project/lxx/libsupc++/tinfo.h:26,
from /home/user/project/lxx/libsupc++/array_type_info.cc:25:
libsupc++/exception:39:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
我的旗帜
CFLAGS = -Os -fno-builtin -fno-common -ffreestanding -isystem ../libbase/include -isystem include -Ilibsupc++ -Ilibgcc -DIN_LIBGCC2 \
-mfloat-abi=soft -marm -march=armv7-a