1 |
> I've been thinking about this recently. What qemu does is compile a C |
2 |
> implementation of the target processor's instruction set into an object |
3 |
> file when qemu is built, then at run-time (JIT time) it cut-n-pastes |
4 |
> bits of that object file when it "compiles" the target executable into |
5 |
> native code that can be executed directly in the emulator. This is |
6 |
> pretty cool, as it means you have a cross-platform target emulator that |
7 |
> is fast because it leverages the compiler to write the emulation code, |
8 |
> without having to maintain separate implementations for each target. |
9 |
> |
10 |
> However it does rely on the ability to snip the function |
11 |
> prologue/epilogue reliably so you can stitch stuff together (in |
12 |
> particular the return instruction is eliminated), and with gcc-4 this is |
13 |
> no longer possible because the return is not always and only at the end |
14 |
> of the function. I think the change to gcc that causes this is one of |
15 |
> the reasons the major revision number was increased. |
16 |
> |
17 |
> The reason for describing this is to illustrate that qemu is not |
18 |
> "broken" as such; it just relies on implementation detail of the pre-4 |
19 |
> gcc series. Since gcc-4 doesn't provide any option to force code |
20 |
> generation to fit the requirements of qemu, the compilation of the |
21 |
> affected code must use gcc-3 (which it does with a very specific set |
22 |
> of CFLAGS). Note; the majority of qemu can be compiled with gcc-4 just |
23 |
> fine, however the target implementation objects have to be built with |
24 |
> gcc-3 because gcc-4 does not provide an option to get the old gcc-3 |
25 |
> behaviour. |
26 |
|
27 |
You take the words out of my mouth. That is exactly, what i'm after. |
28 |
|
29 |
Actually i know, that there are aware of problems that may be caused by |
30 |
using different compilers for different parts of software. But for qemu, |
31 |
this is possibly a must. |
32 |
|
33 |
While gentoo-ebuilds will still complain and force people to switch gcc |
34 |
by hand, other distros may simply offer a qemu built with a different |
35 |
gcc-version than the system-wide one. |
36 |
|
37 |
> Since we already have slotted gcc working just fine, it seems |
38 |
> reasonable to me that we could support packages requiring the existence |
39 |
> of more than one compiler version (although I'm not sure portage |
40 |
> DEPENDs will cope - I'm guessing: |
41 |
> |
42 |
> DEPEND="<sys-devel/gcc-4 |
43 |
> >=sys-devel/gcc-4" |
44 |
> |
45 |
> won't be interpreted to mean both a pre-4 and a post-4 compiler are |
46 |
> required). |
47 |
|
48 |
I think, this does what you don't expect it to do. |
49 |
|
50 |
I remember a bug, where a maintainer wanted to depend on a package, but |
51 |
only a certain version-interval. He used exactly something like you |
52 |
wrote it above. In the end, two versions of the package were installed, |
53 |
and some people agreed on the necessity for a syntax for a |
54 |
version-interval. (which is still not in portage 2.1 afaik) |