error: cannot execute binary file

Matt Darcy lfs-list at
Thu Nov 3 08:00:03 PST 2005

Stan Sander wrote:
> OK, I've messed up something else.  I'm following through the multilib 
> x86_64 build.  The only difference from the book has been I built kernel 
>  I went through the steps in chapter 7 to make the temporary 
> system bootable and have booted into it.  Now I am at chapter 9.6 trying 
> to build the 32 bit perl 5.8.7.  The configure aborts with the following 
> error message:
> /bin/sh: ./try: cannot execute binary file
> The program compiled OK but exited with status 126.
> Any idea where I went wrong?  Some other info that may or may not be 
> useful I get the same error message from the host system bash when I try 
> to do:
> /tools/bin/gcc -v

Hello Stan.

It would appear that you are trying to use the wrong version of the 
programs on the wrong host.

eg: your trying to use the 64bit programs on a 32bit host.

This is obviously not the case as you've booted into your 64bit machine.
However there are obviously serious problems if you cannot do gcc -v

For arguments sake could you post the output from

uname -a when you are booted into 64bit system
echo $PATH

try gcc -v again



More information about the cross-lfs mailing list