Fourth shot at moving arch/ into config/arch/ .
/trunk/scripts/crosstool.sh | 2 1 1 0 +-
1 file changed, 1 insertion(+), 1 deletion(-)
1 See http://gcc.gnu.org/PR22541
5 When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX,
6 the configure script happily copies the glibc include files from include to sys-include;
7 here's the line from the log file (with $PREFIX instead of the real prefix):
9 Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include
11 But later, when running fixincludes, it gives the error message
12 The directory that should contain system headers does not exist:
13 $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include
15 Nevertheless, it continues building; the header files it installs in
16 $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include
17 do not include the boilerplate that would cause it to #include_next the
18 glibc headers in the system header directory.
19 Thus the resulting toolchain can't compile the following program:
22 because its limits.h doesn't include the glibc header.
24 The problem is that gcc/Makefile.in assumes that
25 it can refer to $PREFIX/i686-unknown-linux-gnu with the path
26 $PREFIX/lib/../i686-unknown-linux-gnu, but
27 that fails because the directory $PREFIX/lib doesn't exist during 'make all';
28 it is only created later, during 'make install'. (Which makes this problem
29 confusing, since one only notices the breakage well after 'make install',
30 at which point the path configure complained about does exist, and has the
33 A fix that I've been using for a while is to use sed to canonicalize
34 the path. The sed syntax is a bit obtuse, but it works.
36 (hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq
37 for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.)
39 [rediffed against gcc-4.1-20060210]
41 --- gcc-4.1-20060210/gcc/Makefile.in.old 2006-01-11 06:29:29.000000000 -0800
42 +++ gcc-4.1-20060210/gcc/Makefile.in 2006-02-14 16:08:54.000000000 -0800
44 CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
46 # autoconf sets SYSTEM_HEADER_DIR to one of the above.
47 -SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
48 +# Purge it of unneccessary internal relative paths
49 +# to directories that might not exist yet.
50 +# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
51 +SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`
53 # Control whether to run fixproto and fixincludes.
54 STMP_FIXPROTO = @STMP_FIXPROTO@
55 @@ -3167,13 +3170,15 @@
56 ../$(build_subdir)/fixincludes/fixincl: ; @ :
58 # Build fixed copies of system files.
59 +# Abort if no system headers available, unless building a crosscompiler.
60 +# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works
61 stmp-fixinc: gsyslimits.h macro_list \
62 $(build_objdir)/fixincludes/fixincl \
63 $(build_objdir)/fixincludes/fixinc.sh
64 @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
65 echo The directory that should contain system headers does not exist: >&2 ; \
66 echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
67 - if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
68 + if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \
69 then sleep 1; else exit 1; fi; \
71 rm -rf include; mkdir include