[Gllug] Debugging kernel loading initrd

John Edwards john at cornerstonelinux.co.uk
Tue Apr 29 19:40:19 UTC 2008


On Tue, Apr 29, 2008 at 08:20:32PM +0100, Nix wrote:
> On 27 Apr 2008, John Edwards told this:
> 
>> The glibc was being built on a i686 CPU with "-march=i486" and
>> "-mtune=generic" CFLAGS. I'm currently rebuilding the whole system
>> with "--host=i486-pc-linux-gnu" added to glibc configure options to
>> see if that helps.
> 
> Aha. You can't configure a glibc for specific targets (even specific CPU
> submodels like i586) by just setting CFLAGS. glibc's configure script
> needs to be told your actual --build system, so that it can look in the
> appropriate model-specific sysdeps subdirectories. (You should generally
> set that rather than --host if your build system can run binaries
> intended for the target glibc, so that it can use it during the build
> process.)
> 
> When you start building glibc, it says something like
> 
> checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/i386/i686 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
> 
> See those i686es in there?
> 
> If I were to configure it with --build=i586-pc-linux-gnu instead (by
> default I pass in --build=i686-pc-linux-gnu on that system), we see
> 
> checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i586 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix nptl/sysdeps/i386/i586 sysdeps/i386/i586 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
> 
> Note the differences.
> 
> (I submitted an entry to the glibc FAQ explaining this years ago when it
> bit me on sparcv9. Ulrich ignored it.)

Thanks again for sharing your deep knowledge of glibc.

That all makes sense to me, except that the glibc 2.7 INSTALL
appears to say the opposite (use --host and not --build):
------------------------------------------------------------------
`--build=BUILD-SYSTEM'
`--host=HOST-SYSTEM'
     These options are for cross-compiling.  If you specify both
     options and BUILD-SYSTEM is different from HOST-SYSTEM, `configure'
     will prepare to cross-compile glibc from BUILD-SYSTEM to be used
     on HOST-SYSTEM.  You'll probably need the `--with-headers' option
     too, and you may have to override CONFIGURE's selection of the
     compiler and/or binutils.

     If you only specify `--host', `configure' will prepare for a
     native compile but use what you specify instead of guessing what
     your system is. This is most useful to change the CPU submodel.
     For example, if `configure' guesses your machine as
     `i586-pc-linux-gnu' but you want to compile a library for 386es,
     give `--host=i386-pc-linux-gnu' or just `--host=i386-linux' and add
     the appropriate compiler flags (`-mcpu=i386' will do the trick) to
     CFLAGS.

     If you specify just `--build', `configure' will get confused.
------------------------------------------------------------------

So to clarify I'm building glibc using Linux From Scratch on an i686
machine but want to use it on CPUs from i486 upwards. So should I be
setting both build and host to "i486-pc-linux-gnu"?


ps. The CFLAGS were done by someone else and I've not touched them.


-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080429/c7c0e431/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list