ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.31k stars 227 forks source link

Cannot run statically linked program? #205

Closed ghost closed 1 year ago

ptitSeb commented 3 years ago

Yes, I'm aware, that why I have put the comments there (you have made more clear it's "TODO:" comment)

ghost commented 3 years ago

I don't quite understand what you mean, what do I need to do?

ptitSeb commented 3 years ago

I'll fix it, wait a few minute. But I wonder why you seems so focus on execvp function???

ptitSeb commented 3 years ago

done

ghost commented 3 years ago

If there is a little error in the code, I will be very uncomfortable.

ghost commented 3 years ago

Although it will not affect the program...

ghost commented 3 years ago

i think you do not need handle execve,execvp... execute x86 elf. binfmt has done it.

ptitSeb commented 3 years ago

Yes, but I still want to handle it for plateform that don't use binfmt, or to be able to use another box86 copy than the one setup on binfmt.

ghost commented 3 years ago

run static linked, box86 will call a lot of nanosleep and then crash.

ghost commented 3 years ago

Why is this happening?

ptitSeb commented 3 years ago

How would I know?! I don't know what you are launching. Also, static linked program are still not supported with box86.

ghost commented 3 years ago

I am running printf HelloWorld. I thought you know why it crashed...

ptitSeb commented 3 years ago

well, static linked program is not a good idea with box86, as it defeat the "wrapped" concept at is at the heart of box86. I will not work on any workaround for static link program for now.

ghost commented 3 years ago

If box86 cannot run static linked programs, it doesn't matter.If box86 cannot use x86 printf, there may be a problem in box86.

ptitSeb commented 3 years ago

launch ctest in you box86 build folder. Does the tests runs ok?

ptitSeb commented 3 years ago

If box86 cannot run static linked programs, it doesn't matter.If box86 cannot use x86 printf, there may be a problem in box86.

If the x86 printf is from a statically linked program, than no, it's not a problem as staticaly linked program are not supported by box86 for now.

ghost commented 3 years ago

it is ok.

ghost commented 3 years ago

If box86 cannot run static linked programs, it doesn't matter.If box86 cannot use x86 printf, there may be a problem in box86.

If the x86 printf is from a statically linked program, than no, it's not a problem as staticaly linked program are not supported by box86 for now.

You mean printf of x86 libc can run on box86?

ptitSeb commented 3 years ago

What I mean is that I don't want to waste my time working on statically linked program, as it is not the main target of box86. printf is a complex function, while it may work, I'm unsure all the syscall needed are wired and correctly emulated. And again, this is out of scope for now.

ptitSeb commented 3 years ago

To be clear:

If you can debug and point me to some obvious mystake, I'll fix it. But I don't want to debug that myself.

ghost commented 3 years ago

OK.