Ситуация: нужно разобраться с eCos. Согласно http://ecos.sourceware.org/build-toolchain.html нужно собрать себе тулчейн. На шаге 4. Build and install GCC: make -w all install 2>&1 | tee make.out вываливается ошибка:
make: Entering directory `/tmp/build/gcc' make[1]: Entering directory `/tmp/build/gcc/libiberty' make[2]: Entering directory `/tmp/build/gcc/libiberty/testsuite' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/tmp/build/gcc/libiberty/testsuite' make[1]: Leaving directory `/tmp/build/gcc/libiberty' make[1]: Entering directory `/tmp/build/gcc/gcc' gcc -c -DIN_GCC -DCROSS_COMPILE -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FIL E -I. -I. -I/src/gcc-3.2.1/gcc -I/src/gcc-3.2.1/gcc/. -I/src/gcc-3.2.1/gcc/config -I/src/gcc-3.2.1/gcc/../include /src/gcc-3.2.1/gcc/read-rtl.c -o read-rtl.o In file included from /src/gcc-3.2.1/gcc/read-rtl.c:24: /src/gcc-3.2.1/gcc/rtl.h:125: warning: type of bit-field ‘code’ is a GCC extension /src/gcc-3.2.1/gcc/rtl.h:128: warning: type of bit-field ‘mode’ is a GCC extension /src/gcc-3.2.1/gcc/read-rtl.c: In function ‘fatal_with_file_and_line’: /src/gcc-3.2.1/gcc/read-rtl.c:61: warning: traditional C rejects ISO C style function definitions /src/gcc-3.2.1/gcc/read-rtl.c: In function ‘read_rtx’: /src/gcc-3.2.1/gcc/read-rtl.c:662: error: lvalue required as increment operand make[1]: *** [read-rtl.o] Error 1 make[1]: Leaving directory `/tmp/build/gcc/gcc' make: *** [all-gcc] Error 2 make: Leaving directory `/tmp/build/gcc'
Перепробовал и новые 13.10, и старую 9.10, как в руководстве, и debian, но всегда эта же ошибка, причем не один я такой :). Форумы пестрят, но вот что откопалось: http://gcc.gnu.org/ml/gcc-help/2008-01/msg00040.html
Add this patch: Index: system.h =================================================================== --- system.h (revision 131336) +++ system.h (working copy) @@ -578,6 +578,7 @@ #define really_call_calloc calloc #define really_call_realloc realloc + #if (GCC_VERSION >= 3000) /* Note autoconf checks for prototype declarations and includes @@ -589,7 +590,9 @@ #undef realloc #undef calloc #undef strdup +#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)) #pragma GCC poison malloc realloc calloc strdup +#endif /* Old target macros that have moved to the target hooks structure. */ #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \ @@ -628,4 +631,11 @@ #endif /* GCC >= 3.0 */ +#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC) +/* Flex and bison use malloc and realloc. Yuk. Note that this means + really_call_* cannot be used in a .l or .y file. */ +#define malloc xmalloc +#define realloc xrealloc +#endif + #endif /* ! GCC_SYSTEM_H */ Configure like this: CC='gcc -g -ansi -std=c89' /home/aph/gcc/gcc-3_2-branch/configure --enable-languages=c++ Build: make bootstrap
Подскажите, а как правильно «оформить» патч? Как использовать строку Configure like this:
CC='gcc -g -ansi -std=c89' /home/aph/gcc/gcc-3_2-branch/configure --enable-languages=c++
и что значит make bootstrap ?