On Thu, Mar 17, 2011 at 12:47 PM, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> wrote: > 17.3.2011 12:58, David Paterson kirjoitti: > >> I'm currently rebuilding using the methods you recommended, and so far >> it's working fine... :-) > > It seems that preinstalling the target headers into the > '$prefix/$target/include' and putting them to be seen > also in '$prefix/$target/sys-include' (the GCC build > expects to see them there for investigation) is always > obligatory! If putting only the 'newlib' and 'libgloss' > among the GCC sources, the C library will be built but > for instance the GCC's own 'limits.h' will not be fixed > to include the newlib's 'limits.h'. > > Don't ask me why the GCC build expects the target headers > in '$prefix/$target/sys-include' and not in the assumed > '$prefix/$target/include' for where the newlib install > will put the final headers... I have never got any answer > to this insanity. The '--with-headers=' will copy the > pointed headers into the '$prefix/$target/sys-include' > and if one uses this to copy the generic newlib headers > there, the result will be totally wrong :( When using > the compiler the '$prefix/$target/sys-include' will be > searched before the '$prefix/$target/include' for headers > and the possibly changed target-specific newlib headers > will never be found! So I suggest manual copying with > 'cp -r' and a symlink... Or knowing that what the > '--with-headers=' copied, must be removed after the GCC > installation! Odd. I don't seem to have a $prefix/$target/sys-include directory... I have :- $prefix/include $prefix/$target/include $prefix/$target/lib/gcc/$target/4.5.2/include $prefix/$target/lib/gcc/$target/4.5.2/include-fixed $prefix/$target/lib/gcc/$target/4.5.2/install-tools/include All of which contain different sets of files (and even different versions of some files e.g. limits.h) Should I be creating sys-include and copying the Newlib headers into it? I thought the directory structure in the install location was set up by the configure and build system to keep the host and target versions of things separate. Looks like I'll need to do a bit more investigation to get it all straight in my head... Cheers, David