luigi wrote:
> Hello,
>
> I am trying to cross compile and I have some (newbie) questions:
>
> -
> .bashrc:
> on my compiling host -->
> export CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | 
> cut -d- -f2)/cross/")" 
>
> I obtained i686-cross-linux-gnu
> export CLFS_HOST="i686-cross-linux-gnu" 
>
> For my target host I obtained with the same command:
>
> export CLFS_TARGET="i586-cross-linux-gnu"
>
> Is this ok or should I insert
>  i586-pc-linux-gnu
> in .bashrc?
>   
-cross- is only meant for the host triplet. the target triplet is 
supposed to be -pc- for x86, and -unknown- for virtually everything 
else. The type of build you're attempting will not achieve the goal 
you're looking for. You will obtain a i586 toolchain, but the final 
system's triplet is determined by the output of config.guess. Since 
you're host system is a p4, and you're host distro probably has a i686 
kernel, if you chroot you will end up with a i686 system. Pretty much 
what you want to happen is uname -m to report i586 instead of i686 so 
that when you compile the final system config.guess will report 
i586-pc-linux-gnu.

There's a couple of ways to go about doing this.

The first one is to install a uname hack into the kernel. Which modifies 
the uts machine name to be whatever you want, in your case, i586.
The second one is to wrap the uname program with a script or another 
program that modifies it's output.
The third is to pass arguments to each and every package you want to build.

I recommend the first one as it's the most transparent to the build. You 
just have to remember to remove the kernel module after you're done.

This tarball contains the sources to work with 2.6 kernels before the 
uts namespace changes, (I believe pre 2.16):
http://cross-lfs.org/~jciccone/uname_hack.tar.bz2

This source file works with kernels after the uts namespace changes 
(2.16 and on):
http://cross-lfs.org/~jciccone/uname_ix86.c
_______________________________________________
Clfs-support mailing list
[email protected]
http://lists.cross-lfs.org/cgi-bin/mailman/listinfo/clfs-support

Reply via email to