[Clfs-support] Binaries from CLFS toolchain do not execute in Linux.

Joe Ciccone jciccone at gmail.com
Mon Nov 24 15:13:23 PST 2008


Brian Szmyd wrote:
>
> Hey all,
>
> I just finished building a toolchain from the PowerPC 32 book. I
> followed it almost exactly, except I substituted Binutils 2.19 so I
> wouldn't need the branch update patch.
>
> Anyways, everything came out nice and clean and I was able to compile
> u-boot, Linux and all my userspace applications with it. Both u-boot
> and the kernel are running fine, but nothing within userspace is
> working at all, it's really strange. I loaded a root filesystem with
> busybox and glibc 2.3.6 which I had built from a previous cross
> compiler and it is working with the kernel built from the clfs
> toolchain. when I try and drop a binary built from clfs (like
> libc-2.7.so or just a simple 'hello world') on this filesystem i get
> "not found" as an error from the shell:
>
> root: # ls -l
> -rwxr-xr-x    1 root     root        10406 Nov 24 02:20 hello
> root: # ./hello
> -ash: ./hello: not found
> root: # strace ./hello
> execve("./hello", ["./hello"], [/* 16 vars */]) = -1 ENOENT (No such
> file or directory)
> dup(2)                                  = 3
> fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
> fstat64(3, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 71), ...}) = 0
> ioctl(3, TCGETS, {B115200 opost isig icanon echo ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = 0x48017000
> _llseek(3, 0, 0xbfa2ca38, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
> write(3, "strace: exec: No such file or dir"..., 40strace: exec: No
> such file or directory
> ) = 40
> close(3)                                = 0
> munmap(0x48017000, 4096)                = 0
> exit_group(1)                           = ?
>
> I'm completely lost...I don't get the ENOENT error from execve at all.
> If I try to load an executable built for the wrong architecture (like
> x86) I at least get a meaningful ENOEXEC return value. Anyone seen
> anything like this?
>
Yea, when you have an unexpected ld.so. If you want to toss binaries
around between systems running different versions of various *libc, your
best bet would be to build static binaries.



More information about the Clfs-support mailing list