humphd / browser-vm

A small Linux x86 VM meant for use in the browser
MIT License
175 stars 43 forks source link

How to add g++ package? #10

Open laptrinhvui000 opened 2 years ago

laptrinhvui000 commented 2 years ago

I'm able to re-config and add python, lua, qjs Ok but I can't add g++. I select must or glibc (for qjs), select gcc version 9 -> enable C++. But it's not work. How to add g++ compiler to the iso output? Thank you!

humphd commented 2 years ago

I don't have any useful insight beyond the recommend approach: https://stackoverflow.com/questions/8575949/how-to-add-g-support-in-toolchain.

mattpass commented 2 years ago

Hope it's OK to ask here (as the README.md didn't explain it) - how was Python added?

My process: docker run ... -ti --entrypoint "bash" ... to get a prompt make menuconfig -> Toolchain > Enable WCHAR support (checked) -> Target Packages -> Interpreter languages and scripting -> python 3 (checked) With those couple checked, I then need to re-run the Shell script to build it all (is this correct?), so run: ./../../../buildroot-v86/build-v86.sh

However, when it outputs a new v86-linux.iso, but it doesn't seem to contain Python.

If I then make menuconfig again, it seems to have unset the python 3 setting which seems odd.

mattpass commented 2 years ago

I discovered I need to add BR2_PACKAGE_PYTHON3=y to v86_defconfg ...that'll include Python.

However, it doesn't seem to produce a working ISO for v86, it panics with errors such as libv86.js:704 panicked at 'Unimplemented: #GP handler', src/rust/cpu/cpu.rs:730:13. What would be the recommended approach to include Python?

UPDATE: Figured it out. Didn't have enough RAM available at 32mb, so bumped it up to 64mb and it's working now.

DeepBhat commented 1 year ago

Hey @mattpass hope it's okay to ask, I have been trying to enable Python3 too but couldn't get it. Could you please give me the ISO file if you were able to generate it?

mattpass commented 1 year ago

@DeepBhat Sorry, this was work I did at a previous employer so don't have the files available anymore. Hope you end up being able to generate it using the above BR2_PACKAGE_PYTHON3=y setting.