This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
"Marshall, Hunter" wrote: > > 2) I tried to make the gcc (2.95.2) build aware of the glibc headers by > doing > "../gcc2.95.2/configure --target=arm-linux > --with-headers=/usr/local/src/glibc-2.1.3/include". This got me farther > (further?) than I had gotten on my previous attempt (i THINK), but still > failed as shown below. What is the right way to do this? The generic instructions for a cross-compiler are: 1. Get the target headers and libs, if available, then preinstall them into $prefix/$target/include and $prefix/$target/lib 2. Build binutils for the target and install them into $prefix/bin and $prefix/$target/bin (the 'make install' does this) 3. Build GCC using the same values for $prefix and $target as with binutils (and when preinstalling the target headers and libs) There may be bugs preventing everything to work while building, but this is just the 'official' way described in the GCC manual. For gcc-2.95.2 the pre-creation of the '$prefix/lib/gcc-lib/$target/2.95.2' may be necessary because all the search paths to the target stuff go through it... This is the reason for many problems and toying with the '--with-headers=...' for the purpose of finding the standard C headers for the target. The use of '--with-headers' is recommended to be used for the Linux kernel headers while building glibc, but using it while configuring GCC is questionable. Although the important 'the' is missing from the 'www.gnu.org' instructions for 'configure', this has mislead quite many to think that the standard headers are talked about, while 'headers' without 'the' should say that 'some unspecified headers' can be pointed to and fixed for GCC using the '--with-headers' or preinstalling them into the $prefix/$target/sys-include'. Ok here is the original purpose for the 'sys-include', taken from the GCC manual: -------------------------- clip ------------------------------------------ SYSTEM_INCLUDE_DIR Define this macro as a C string constant if you wish to specify a system- specific directory to search for header files before the standard directory. SYSTEM_INCLUDE_DIR comes before STANDARD_INCLUDE_DIR in the search order. -------------------------- clip ------------------------------------------ The standard C headers in the STANDARD_INCLUDE_DIR, '$prefix/$target/include', could be meaned if there would be a 'the headers' in the gnu.org instructions. BTW, seeing the gnu.org description for the '--with-newlib', will help everyone the 'eprintf' hates... Ok, back to the subject... For the 'arm-linux' case this means that some prebuilt glibc-2.1.x stuff is preferred for the 'target headers and libs' for the 1st stage bootstrap compiler, but even using the newlib headers may succeed... If building under Linux/x86 with glibc-2.1.x, copying the native headers from '/usr/include' for the Linux/ARM toolset will be fine after some fixes to the copies, like changing the 'asm' symlink to '/usr/src/linux/include/asm-arm' from its original '.../include/asm-x86'. Then the '.../include/bits' might have had some differences between x86 and ARM... I used this method for my 'arm-linux' toolset... Some 'arm-linux' glibc-2.1.x distribution, like the HardHat (www.mvista.com), searching via 'http://www.arm.linux.org.uk' etc. should lead to some prebuilt glibc... Then building even a full GCC with libiberty and libstdc++ may succeed (but for using the toolset mainly with the prebuilt glibc-2.1.x). Having only some suitable headers enables one to build only GCC (make all-gcc) in the '.../gcc' subdirectory. Perhaps it isn't clear for everybody, but GCC is really built and ready when the 'gcc' subdirectory has been handled!!!! The 'libiberty', 'libobjc', 'libf2c', 'libstdc++' etc. are just extra stuff and can be built after both GCC and the C library, glibc in this case, have been built and they work... When the 'bootstrap-GCC', built with some headers which enable it to be built, is ready and installed, building glibc-2.1.3 (or the new '2.2' ?) for 'arm-linux' with it should succeed. After the new glibc for 'arm-linux' has been built and installed, rebuilding the 'libgcc.a' and continuing to build the 'libiberty' etc. should succeed. Forcing to rebuild 'libgcc.a' happens by removing the stamps 'libgcc2.ready' and 'stmp-multilib' in the 'gcc' subdir. The target headers don't have any influence to the resulted 'arm-linux' target compiler, only to the libraries it creates, so only rebuilding 'libgcc.a' and all the other libs after it is necessary. The rules for all Linux targets are quite the same, so the 'www.penguinppc.org' Mini-FAQ about cross-compiling for Linux/PPC will be fine for Linux/ARM too. The main principles only, not taking everything as written (the Mini-FAQ has bugs too in the kernel-headers symlink commands...) Cheers, Kai ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |