Maybe it’s a good idea to start with that. Let’s see if we can get clang to replace gcc2 as a first step without touching anything else (or as little as possible). I think you already showed that this looks possible at least for a demonstration (I expect some more problems will show up if we try to run every BeOS app with a system entirely built this way?).
Once we have that part, we can decide if depreacting the itanium ABI for x86 32bit is desirable (cornering us into a non-standard ABI instead of what pretty much everyone else uses), or if the two ABIs can live side by side in a way that is easier to handle than the current option (which is: library path hacks and extra complexity in haikuporter recipes).
We will also at that point see if the current option is also useful in other cases: 32/64 bit hybrids, maybe R1/R2 hybrids when there is an ABI break someday, … this ends up touching a lot more topics than “let’s just get rid of gcc2”.
This isn’t correct, you can start a BeOS binary inside of a setarch environment and it will work just fine (or a gcc4 binary outside a setarch environment). The runtime_loader detects the ABI from a few fields in the ELF header and sets up the library search path for the executable accordingly.
setarch only changes the PATH environment variable so that when you run “gcc” it runs gcc from /bin/x86 instead of /bin/. Everything else is handled by having a different set of compiler tools (for example, a different version of pkg-config that will look for the “right” .pc files for the architecture). There isn’t so much a hack here, just adding your toolchain to the PATH wrapped in a convenient tool.
But that is already solved in the case of just replacing gcc2 with clang and otherwise keeping an hybrid setup, I think?