LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   -bash: ./z80-asm: No such file or directory: inexplicable message when I try to run (http://www.linuxquestions.org/questions/slackware-14/bash-z80-asm-no-such-file-or-directory-inexplicable-message-when-i-try-to-run-4175471378/)

stf92 07-29-2013 05:49 PM

-bash: ./z80-asm: No such file or directory: inexplicable message when I try to run
 
Hi: I ran 'make' with a file Makefile, under Slackware 12.0, which produced the binary z80-asm. I can run it under Slackware 12.0 but, if I try to run it under Slackware 14.0 I get
Code:

semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$ ls -l z80-asm
-rwxr-xr-x 1 semoi semoi 53091 2013-03-10 19:56 z80-asm*
semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$ z80-asm     
-bash: ./z80-asm: No such file or directory

What can be the cause? I can post the Makefile if you want. This is the output of the file command:
Code:

z80-asm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

Ser Olmy 07-29-2013 05:53 PM

What do the file and ldd commands have to say about this executable?

stf92 07-29-2013 05:56 PM

The file output I already posted it. Here it is again, along with that of ldd:
Code:

semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$ file z80-asm
z80-asm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$ ldd z80-asm
        not a dynamic executable
semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$

Using ldd with other options I get the same output.

Ser Olmy 07-29-2013 06:01 PM

Sorry about missing the file output.

Are you trying to run this file under a 32-bit or a 64-bit version of Slackware 14?

My guess is the executable is trying to open a file that doesn't exist on your new system. You could try strace ./z80-asm.

volkerdi 07-29-2013 06:11 PM

Almost certainly this binary was compiled on a 32-bit system, and you're trying to run it on a 64-bit x86_64 system without the supporting libraries installed.

stf92 07-29-2013 06:11 PM

It's the 64-bit version of Slackware. Running the ldd command under Slackware 12.0 I get
Code:

semoi@local:/usr/local/bin$ ldd -v z80-mon
        linux-gate.so.1 =>  (0xffffe000)
        libc.so.6 => /lib/libc.so.6 (0xb7d8d000)
        /lib/ld-linux.so.2 (0xb7eec000)

        Version information:
        ./z80-mon:
                libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libc.so.6:
                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
semoi@local:/usr/local/bin$

Under Slackware 14.0:
Code:

semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$ strace z80-asm
execve("./z80-asm", ["z80-asm"], [/* 53 vars */]) = -1 ENOENT (No such file or directory)
dup(2)                                  = 3
fcntl(3, F_GETFL)                      = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbb7199a000
lseek(3, 0, SEEK_CUR)                  = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
close(3)                                = 0
munmap(0x7fbb7199a000, 4096)            = 0
exit_group(1)                          = ?
semoi@server:~/z80_2013/assemblers/z80-asm-2.3.7$

Under 12.0:
Code:

semoi@local:/usr/local/bin$ strace z80-asm
execve("/usr/local/bin/z80-asm", ["z80-asm"], [/* 35 vars */]) = 0
brk(0)                                  = 0x8074000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fad000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=113193, ...}) = 0
mmap2(NULL, 113193, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f91000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@_\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1528742, ...}) = 0
mmap2(NULL, 1316260, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e4f000
mmap2(0xb7f8b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13c) = 0xb7f8b000
mmap2(0xb7f8e000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f8e000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e4e000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e4e6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7f8b000, 4096, PROT_READ)  = 0
munmap(0xb7f91000, 113193)              = 0
exit_group(0)                          = ?
Process 8267 detached
semoi@local:/usr/local/bin$


stf92 07-29-2013 06:13 PM

Quote:

Originally Posted by volkerdi (Post 4999222)
Almost certainly this binary was compiled on a 32-bit system, and you're trying to run it on a 64-bit x86_64 system without the supporting libraries installed.

You are right. I think that is the case. My mistake. Thanks.

volkerdi 07-29-2013 06:14 PM

Copy those libraries that you see listed from the ldd output on Slackware 12.0 into your /usr/local/lib and it should start working (maybe after running ldconfig).

stf92 07-29-2013 06:31 PM

Thanks Patrick.


All times are GMT -5. The time now is 01:58 PM.