I can bootstrap a cross-compiler with no target system library with GCC 4.3.3, but using the same configuration options causes a failure when building GCC 4.4.3. It appears to be attempting to build the regex function of libiberty for the target, and failing because there isn't a target system library available. I'm not sure why 4.4.3 wants to build that when 4.3.3 did not. My configuration options are based on what Codesourcery uses for arm-none-eabi in their 2009q3 toolchain. Configuration: ../gcc-%{version}/configure \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --target=arm-none-eabi \ --disable-libmudflap \ --disable-libssp \ --disable-libstdcxx-pch \ --enable-extra-sgxxlite-multilibs \ --with-gnu-as \ --with-gnu-ld \ '--with-specs=%{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' \ --enable-languages=c \ --enable-shared \ --disable-lto \ --with-newlib \ --disable-nls \ --disable-libgomp \ --without-headers \ --disable-decimal-float \ --disable-libffi \ --with-system-zlib \ --enable-version-specific-runtime-libs \ --enable-interwork \ --enable-poison-system-directories Failure when building 4.4.3: checking for a 64-bit type... unsigned long long checking for pid_t... no checking for working strncmp... no updating cache ./config.cache configure: creating ./config.status config.status: creating Makefile config.status: creating testsuite/Makefile config.status: creating config.h config.status: executing default commands Adding multilib support to Makefile in ../../../../gcc-4.4.3/libiberty with_multisubdir=thumb make[2]: Entering directory `/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/arm-none-eabi/libiberty' if [ x"-fPIC" != x ] && [ ! -d pic ]; then \ mkdir pic; \ else true; fi touch stamp-picdir if [ x"-fPIC" != x ]; then \ /home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/./gcc/xgcc -B/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include -c -DHAVE_CONFIG_H -g -O2 -I. -I../../../gcc-4.4.3/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fPIC ../../../gcc-4.4.3/libiberty/regex.c -o pic/regex.o; \ else true; fi ../../../gcc-4.4.3/libiberty/regex.c:51:25: error: sys/types.h: No such file or directory [...lots more errors due to missing sys/types.h omitted here...] ../../../gcc-4.4.3/libiberty/regex.c:8112: warning: incompatible implicit declaration of built-in function 'free' ../../../gcc-4.4.3/libiberty/regex.c:8121: error: 'regex_t' has no member named 'fastmap_accurate' make[2]: *** [regex.o] Error 1 make[2]: Leaving directory `/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi/arm-none-eabi/libiberty' make[1]: *** [all-target-libiberty] Error 2 make[1]: Leaving directory `/home/eric/rpmbuild/BUILD/arm-none-eabi-gcc-bootstrap-4.4.3/gcc-arm-none-eabi' make: *** [all] Error 2
What happens if you use make all-gcc all-target-libgcc on the top level of your object tree rather than using make all. Also, it's not necessary that all options supported by the Codesourcery toolchain should work with the FSF toolchain. For instance using this with the FSF toolchain is not correct and will create more problems for you later. --enable-extra-sgxxlite-multilibs \ --with-specs=%{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}} \
Did you download gcc-4.4.3-core.tar only? Or the full gcc-4.4.3?
*** Bug 43446 has been marked as a duplicate of this bug. ***
The problem shows up with gcc-core only.
I obtain a similar error message when building a gcc-4.5.0 cross compiler: /media/data/linux/sources/gcc-4.4.4-build/./gcc/xgcc -B/media/data/linux/sources/gcc-4.4.4-build/./gcc/ -B/media/data/linux/tools/usr/x86_64-unknown-linux-gnu/bin/ -B/media/data/linux/tools/usr/x86_64-unknown-linux-gnu/lib/ -isystem /media/data/linux/tools/usr/x86_64-unknown-linux-gnu/include -isystem /media/data/linux/tools/usr/x86_64-unknown-linux-gnu/sys-include -c -DHAVE_CONFIG_H -g -O2 -march=core2 -I. -I../../../gcc-4.4.4/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic ../../../gcc-4.4.4/libiberty/regex.c -o regex.o ../../../gcc-4.4.4/libiberty/regex.c:51:25: error: sys/types.h: No such file or directory ../../../gcc-4.4.4/libiberty/regex.c:130: warning: function declaration isn’t a prototype ../../../gcc-4.4.4/libiberty/regex.c:130: warning: conflicting types for built-in function ‘malloc’ ../../../gcc-4.4.4/libiberty/regex.c:131: warning: function declaration isn’t a prototype ../../../gcc-4.4.4/libiberty/regex.c:131: warning: conflicting types for built-in function ‘realloc’ ../../../gcc-4.4.4/libiberty/regex.c:158:25: error: strings.h: No such file or directory In file included from ../../../gcc-4.4.4/libiberty/../include/xregex.h:26, from ../../../gcc-4.4.4/libiberty/regex.c:193: ../../../gcc-4.4.4/libiberty/../include/xregex2.h:360: error: expected specifier-qualifier-list before ‘size_t’ ../../../gcc-4.4.4/libiberty/../include/xregex2.h:447: error: expected declaration specifiers or ‘...’ before ‘size_t’ ../../../gcc-4.4.4/libiberty/../include/xregex2.h:543: error: expected declaration specifiers or ‘...’ before ‘size_t’ ../../../gcc-4.4.4/libiberty/../include/xregex2.h:547: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘xregerror’ ../../../gcc-4.4.4/libiberty/regex.c:196:20: error: ctype.h: No such file or directory ../../../gcc-4.4.4/libiberty/regex.c: In function ‘init_syntax_once’: ../../../gcc-4.4.4/libiberty/regex.c:284: warning: implicit declaration of function ‘bzero’ ../../../gcc-4.4.4/libiberty/regex.c:284: warning: incompatible implicit declaration of built-in function ‘bzero’ ../../../gcc-4.4.4/libiberty/regex.c:287: warning: implicit declaration of function ‘isalnum’ ../../../gcc-4.4.4/libiberty/regex.c: At top level: ../../../gcc-4.4.4/libiberty/regex.c:408: error: expected declaration specifiers or ‘...’ before ‘size_t’ In file included from ../../../gcc-4.4.4/libiberty/regex.c:638: ../../../gcc-4.4.4/libiberty/regex.c:2283: error: expected declaration specifiers or ‘...’ before ‘size_t’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘byte_regex_compile’: ../../../gcc-4.4.4/libiberty/regex.c:2318: error: ‘size’ undeclared (first use in this function) ../../../gcc-4.4.4/libiberty/regex.c:2318: error: (Each undeclared identifier is reported only once ../../../gcc-4.4.4/libiberty/regex.c:2318: error: for each function it appears in.) ../../../gcc-4.4.4/libiberty/regex.c:2401: error: ‘struct re_pattern_buffer’ has no member named ‘fastmap_accurate’ ../../../gcc-4.4.4/libiberty/regex.c:2402: error: ‘struct re_pattern_buffer’ has no member named ‘not_bol’ ../../../gcc-4.4.4/libiberty/regex.c:2402: error: ‘struct re_pattern_buffer’ has no member named ‘not_eol’ ../../../gcc-4.4.4/libiberty/regex.c:2410: error: ‘struct re_pattern_buffer’ has no member named ‘re_nsub’ ../../../gcc-4.4.4/libiberty/regex.c:2439: warning: implicit declaration of function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:2439: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:2500: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:2533: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:2640: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:3124: warning: incompatible implicit declaration of built-in function ‘bzero’ ../../../gcc-4.4.4/libiberty/regex.c:3253: warning: implicit declaration of function ‘strcmp’ ../../../gcc-4.4.4/libiberty/regex.c:3280: warning: implicit declaration of function ‘isalpha’ ../../../gcc-4.4.4/libiberty/regex.c:3282: warning: implicit declaration of function ‘iscntrl’ ../../../gcc-4.4.4/libiberty/regex.c:3284: warning: implicit declaration of function ‘isdigit’ ../../../gcc-4.4.4/libiberty/regex.c:3285: warning: implicit declaration of function ‘isprint’ ../../../gcc-4.4.4/libiberty/regex.c:3285: warning: implicit declaration of function ‘isspace’ ../../../gcc-4.4.4/libiberty/regex.c:3286: warning: implicit declaration of function ‘islower’ ../../../gcc-4.4.4/libiberty/regex.c:3289: warning: implicit declaration of function ‘ispunct’ ../../../gcc-4.4.4/libiberty/regex.c:3291: warning: implicit declaration of function ‘isupper’ ../../../gcc-4.4.4/libiberty/regex.c:3292: warning: implicit declaration of function ‘isxdigit’ ../../../gcc-4.4.4/libiberty/regex.c:3643: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:3657: error: ‘struct re_pattern_buffer’ has no member named ‘re_nsub’ ../../../gcc-4.4.4/libiberty/regex.c:4150: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘byte_re_compile_fastmap’: ../../../gcc-4.4.4/libiberty/regex.c:4582: warning: incompatible implicit declaration of built-in function ‘bzero’ ../../../gcc-4.4.4/libiberty/regex.c:4583: error: ‘struct re_pattern_buffer’ has no member named ‘fastmap_accurate’ ../../../gcc-4.4.4/libiberty/regex.c:4584: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:4593: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:4618: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:4696: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:4790: warning: implicit declaration of function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:4790: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:4797: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:4835: warning: implicit declaration of function ‘abort’ ../../../gcc-4.4.4/libiberty/regex.c:4835: warning: incompatible implicit declaration of built-in function ‘abort’ ../../../gcc-4.4.4/libiberty/regex.c:4850: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘byte_re_search_2’: ../../../gcc-4.4.4/libiberty/regex.c:5046: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:5066: error: ‘struct re_pattern_buffer’ has no member named ‘fastmap_accurate’ ../../../gcc-4.4.4/libiberty/regex.c:5152: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c:5191: error: ‘struct re_pattern_buffer’ has no member named ‘can_be_null’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘byte_re_match_2_internal’: ../../../gcc-4.4.4/libiberty/regex.c:5612: error: ‘size_t’ undeclared (first use in this function) ../../../gcc-4.4.4/libiberty/regex.c:5612: error: expected ‘;’ before ‘num_regs’ ../../../gcc-4.4.4/libiberty/regex.c:5615: warning: ISO C90 forbids mixed declarations and code ../../../gcc-4.4.4/libiberty/regex.c:5691: error: ‘struct re_pattern_buffer’ has no member named ‘re_nsub’ ../../../gcc-4.4.4/libiberty/regex.c:5693: error: ‘num_regs’ undeclared (first use in this function) ../../../gcc-4.4.4/libiberty/regex.c:5975: error: ‘struct re_pattern_buffer’ has no member named ‘no_sub’ ../../../gcc-4.4.4/libiberty/regex.c:5978: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:5990: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:5992: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:6747: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:6812: warning: implicit declaration of function ‘bcmp’ ../../../gcc-4.4.4/libiberty/regex.c:6831: error: ‘struct re_pattern_buffer’ has no member named ‘not_bol’ ../../../gcc-4.4.4/libiberty/regex.c:6833: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:6847: error: ‘struct re_pattern_buffer’ has no member named ‘not_eol’ ../../../gcc-4.4.4/libiberty/regex.c:6852: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:6901: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:6958: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:7021: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:7187: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:7200: warning: incompatible implicit declaration of built-in function ‘bcopy’ ../../../gcc-4.4.4/libiberty/regex.c:7421: warning: incompatible implicit declaration of built-in function ‘abort’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xre_set_registers’: ../../../gcc-4.4.4/libiberty/regex.c:4894: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:4901: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c: At top level: ../../../gcc-4.4.4/libiberty/regex.c:7765: error: expected declaration specifiers or ‘...’ before ‘size_t’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xre_compile_pattern’: ../../../gcc-4.4.4/libiberty/regex.c:7772: error: ‘struct re_pattern_buffer’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:7777: error: ‘struct re_pattern_buffer’ has no member named ‘no_sub’ ../../../gcc-4.4.4/libiberty/regex.c:7780: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:7787: error: ‘length’ undeclared (first use in this function) ../../../gcc-4.4.4/libiberty/regex.c:7787: warning: passing argument 3 of ‘byte_regex_compile’ makes pointer from integer without a cast ../../../gcc-4.4.4/libiberty/regex.c:2282: note: expected ‘struct re_pattern_buffer *’ but argument is of type ‘reg_syntax_t’ ../../../gcc-4.4.4/libiberty/regex.c:7787: error: too many arguments to function ‘byte_regex_compile’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xre_comp’: ../../../gcc-4.4.4/libiberty/regex.c:7839: error: ‘struct re_pattern_buffer’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:7846: warning: implicit declaration of function ‘strlen’ ../../../gcc-4.4.4/libiberty/regex.c:7846: warning: incompatible implicit declaration of built-in function ‘strlen’ ../../../gcc-4.4.4/libiberty/regex.c:7846: warning: passing argument 3 of ‘byte_regex_compile’ makes pointer from integer without a cast ../../../gcc-4.4.4/libiberty/regex.c:2282: note: expected ‘struct re_pattern_buffer *’ but argument is of type ‘reg_syntax_t’ ../../../gcc-4.4.4/libiberty/regex.c:7846: error: too many arguments to function ‘byte_regex_compile’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xre_exec’: ../../../gcc-4.4.4/libiberty/regex.c:7862: warning: incompatible implicit declaration of built-in function ‘strlen’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xregcomp’: ../../../gcc-4.4.4/libiberty/regex.c:7936: warning: implicit declaration of function ‘tolower’ ../../../gcc-4.4.4/libiberty/regex.c:7947: error: ‘regex_t’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:7950: error: ‘regex_t’ has no member named ‘newline_anchor’ ../../../gcc-4.4.4/libiberty/regex.c:7952: error: ‘regex_t’ has no member named ‘no_sub’ ../../../gcc-4.4.4/libiberty/regex.c:7961: warning: incompatible implicit declaration of built-in function ‘strlen’ ../../../gcc-4.4.4/libiberty/regex.c:7961: warning: passing argument 3 of ‘byte_regex_compile’ makes pointer from integer without a cast ../../../gcc-4.4.4/libiberty/regex.c:2282: note: expected ‘struct re_pattern_buffer *’ but argument is of type ‘reg_syntax_t’ ../../../gcc-4.4.4/libiberty/regex.c:7961: error: too many arguments to function ‘byte_regex_compile’ ../../../gcc-4.4.4/libiberty/regex.c:7975: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c: At top level: ../../../gcc-4.4.4/libiberty/regex.c:8002: error: expected declaration specifiers or ‘...’ before ‘size_t’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xregexec’: ../../../gcc-4.4.4/libiberty/regex.c:8008: warning: incompatible implicit declaration of built-in function ‘strlen’ ../../../gcc-4.4.4/libiberty/regex.c:8009: error: ‘regex_t’ has no member named ‘no_sub’ ../../../gcc-4.4.4/libiberty/regex.c:8009: error: ‘nmatch’ undeclared (first use in this function) ../../../gcc-4.4.4/libiberty/regex.c:8013: error: ‘regex_t’ has no member named ‘not_bol’ ../../../gcc-4.4.4/libiberty/regex.c:8014: error: ‘regex_t’ has no member named ‘not_eol’ ../../../gcc-4.4.4/libiberty/regex.c:8019: error: ‘regex_t’ has no member named ‘regs_allocated’ ../../../gcc-4.4.4/libiberty/regex.c:8050: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c: At top level: ../../../gcc-4.4.4/libiberty/regex.c:8065: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘xregerror’ ../../../gcc-4.4.4/libiberty/regex.c: In function ‘xregfree’: ../../../gcc-4.4.4/libiberty/regex.c:8112: warning: incompatible implicit declaration of built-in function ‘free’ ../../../gcc-4.4.4/libiberty/regex.c:8121: error: ‘regex_t’ has no member named ‘fastmap_accurate’ make[2]: *** [regex.o] Error 1 make[2]: Leaving directory `/media/data/linux/sources/gcc-4.4.4-build/x86_64-unknown-linux-gnu/libiberty' make[1]: *** [all-target-libiberty] Error 2 make[1]: Leaving directory `/media/data/linux/sources/gcc-4.4.4-build' make: *** [all] Error 2 I used full gcc sources, not gcc-core. I also managed to find a workaround to this problem, that is, adding --disable-libgomp to the configure argument list.
This still turns up in 4.6 trunk downloaded from yesterday. doing a make all-gcc fixes the problem.
Building a cross compiler is complex unless you already have a sysroot. Using an semi-supported script from say crosstoolng is better idea. Plus I build cross toolchains all the time with different source bases.
Much more importantly, gcc-core doesn't exist anymore (so WORKSFORME is a strange resolution). Using the documented build procedures is recommended, and is what is supported here (not any cross tool whatever thing).