Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: leehui on June 10, 2015, 10:51:38 PM

Title: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: leehui on June 10, 2015, 10:51:38 PM
Hi, all
I have met a problem here.
I am now using Bochs as host system of TinyCore
I successfully installed the CorePlus-crrent.iso(32bit) into the disk(created by bochs tool named bximage),  then I complied a simple "hello world" c program for tiny core on my ubuntu  and copied it under the root dir of the disk. Finally it ran well.
But when I boot the 32bit Tiny core directly from iso file, and mounted the disk that held the binary file. the program could not run.  Similarly, a 64-bit program could not run when directly boot from a 64-bit iso.
Then, I install a pure 32bit tinycore into another disk without any extensions, and substituded the core.gz and vmlinuz with 64bit version, and tried to run the program, failed again.
I am new of TinyCore, Please help!
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: curaga on June 11, 2015, 04:50:20 AM
Please post the error message you get.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: leehui on June 11, 2015, 05:08:27 AM
the error message is very strange:
      hello: line 1: syntax error: unexpected "("
where "hello" is the name of the binary, and ran well on my ubuntu.

is there any experience of running binaries on 64 bit TinyCore???
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: Juanito on June 11, 2015, 05:16:47 AM
Often that error means that the bash extension is required.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: curaga on June 11, 2015, 06:13:14 AM
Then it is not a binary, you copied a script.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: leehui on June 11, 2015, 07:06:48 AM
Hi, Juanito

I installed the bash.tcz, this time the bash shows that "hello: cannot execute binary file".

It seems that the hello is not recognised
But I am sure that the hello is compiled by gcc of my ubuntu(64bit), I do not know why.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: curaga on June 11, 2015, 07:07:33 AM
For best compatibility, you should compile on TinyCore.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: Rich on June 11, 2015, 10:51:59 AM
Hi leehui
Quote
... bash shows that "hello: cannot execute binary file".
That sounds like you entered something like this to try to execute your file:
Code: [Select]
bash helloIs the program located in a directory that's listed in the  PATH  environmental variable? If it is, then just  hello  should allow
it to execute. If it's not in the path, but in the directory you are currently in, then  ./hello  should work. If it's not in the path, but
in a different directory, then  /path/to/program/hello  should work.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: Juanito on June 11, 2015, 11:09:17 AM
"ldd /path-to-file/hello" might also be worth trying.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: leehui on June 11, 2015, 08:51:12 PM
Hi Rich

I have tried all the methods you mentioned, it did not work. It seems because the incompatibility between two platforms

Hi  Juanito

I have tried "ldd /home/tc/hello", it echoed :
linux-vdso.so.1 (0x00007f7f076b5000)
libc.so.6 = > /lib/libc.so.6 (0x00007f7f076b5000)
/lib64/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x00007f7f076b5000)

any problem?
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: Juanito on June 12, 2015, 02:47:02 AM
CorePure64 does not have /lib64. You could create a symlink, but the best would be to compile locally
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: leehui on June 12, 2015, 03:08:38 AM
Hi,Juanito

I think that the /lib64 stands for the dir of my 64bit Ubuntu from where the binary is generated. Now that the ldd can link /lib64 to /lib(stands for the dir of the running TinyCore), symlink should not be needed.
I will Try to install GCC and to compile program locally.

thanks for your reply.
Title: Re: run binary file(compile on other platform) on TinyCore directly boot from iso
Post by: Juanito on June 12, 2015, 07:14:27 AM
OK - be sure to load the compiletc extension rather than gcc alone.