Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I tried to compile qemu with gcc4 but I get a lot of weird compiler errors. Same happens if I try to use gcc2. How can I fix this?

0
Posted

I tried to compile qemu with gcc4 but I get a lot of weird compiler errors. Same happens if I try to use gcc2. How can I fix this?

0

• A: Good luck. gcc2 should work fine but some older versions have problems with register allocation. It is recommended to use gcc3 (specificly gcc 3.3) to compile qemu. gcc4 has significant changes to the way it structures the code it generates. This makes it incompatible with the way qemu handles dynamic translation of guest machine codes, and this is really difficult to work around. A long term solution known as qop is in the works, but for now just use gcc3 to compile qemu. If you really want to try making gcc4 work with qemu, see this thread, which includes several patches that you can use to try make this work. Note that gcc4 may still have register allocation problems (amd64 should have no issues but 32bit x86 will). See this bug for more information. This can be worked around by disabling the use of global register variables in qemu, but this has a significant performance hit. Using gcc3 is strongly recommended.

0

Good luck. gcc2 should work fine but some older versions have problems with register allocation. It is recommended to use gcc3 (specificly gcc 3.3) to compile qemu. gcc4 has significant changes to the way it structures the code it generates. This makes it incompatible with the way qemu handles dynamic translation of guest machine codes, and this is really difficult to work around. A long term solution known as qop is in the works, but for now just use gcc3 to compile qemu. If you really want to try making gcc4 work with qemu, see this thread, which includes several patches that you can use to try make this work. Note that gcc4 may still have register allocation problems (amd64 should have no issues but 32bit x86 will). See this bug for more information. This can be worked around by disabling the use of global register variables in qemu, but this has a significant performance hit. Using gcc3 is strongly recommended. Thanks to Paul Brook for providing the above information.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123