Has Haiku abandoned BeOS compatibility?

Forum thread started by Luposian on Fri, 2009-07-03 08:20

The reason I ask is because, in the GCC4 version of Haiku, I can't use Firefox (it won't start) and Circus Linux won't run either. As so much has changed (such as: no more /beos folder (now called /system) and a lot of stuff is in /common now, etc.), it makes me wonder just how much BeOS software will still even work! I assume the GCC2 version of Haiku has the name folder changes and such.

It appears, from what I've seen, the GCC4 version of Haiku is gaining more and more prominence. Is this to be the new path Haiku is taking? If, so, great (I'm all for anti-legacy and forward-thinking and all whatnot)... but I think we need to have people rewriting programs so they'll work in Haiku again...

Comments

Re: Has Haiku abandoned BeOS compatibility?

A pure GCC4 version of Haiku is not binary compatible with BeOS. This is due simply to the developers of GCC not caring about backwards compatibility.

However, Haiku supports running as a GCC Hybrid, which retains binary compatibility with BeOS. There are two possible hybrids: X86 GCC 2.95 Hybrid and X86 GCC 4.x Hybrid. The "GCC --" indicates which version Haiku was compiled with. The "Hybrid" refers to a set of alternative libraries, translators, etc.

Re: Has Haiku abandoned BeOS compatibility?

One more point - you don't really have to rewrite programs to run them in GCC4 Haiku - you basically just recompile them. This is not Haiku's fault, it is GCC's.

Re: Has Haiku abandoned BeOS compatibility?

Almost. GCC4 is stricter about certain language constructs. Sometimes code that compiles just fine for GCC2 needs a little tweaking to compile under GCC4, but nothing major is required. :)

Re: Has Haiku abandoned BeOS compatibility?

The hybrid builds will run the Firefox available on BeBits. As it is, the BeZillaBrowser is just Firefox without the branding. A purely GCC4 build is kind of a pain in the neck, but the GCC2 and hybrid builds run stuff from BeBits and Haikuware without a hitch.

The filesystem changes took me by surprise, too, but they really aren't a problem. In R5, there is a function called find_directory() which asks the system for the location of a particular kind of folder. For example, find_directory(B_BEOS_DIRECTORY) on R5 gives /boot/beos, but on Haiku, it should return /boot/system. Everything in the /boot/common folder is supported under R5, too. It just wasn't put into place in R5 or Zeta.

The break in compatibility between the two compiler versions, as was mentioned above, was actually the result of changes made by the guys responsible for GCC compiler itself. If I understand things correctly, the compatibility breakage only applies to code written in C++, so C-based libraries compiled for GCC2, for example, will drop into place and work just fine.

The newer compiler is necessary for work down the road, though. CLucene, the base for the desktop search project that Ankur Sethi is working on, needs the new compiler. So do Firefox 3 and Ryan Leavengood's Webkit browser project.

Re: Has Haiku abandoned BeOS compatibility?

darkwyrm wrote:

As it is, the BeZillaBrowser is just Firefox without the branding.

The newer compiler is necessary for work down the road, though. CLucene, the base for the desktop search project that Ankur Sethi is working on, needs the new compiler. So do Firefox 3 and Ryan Leavengood's Webkit browser project.

The BeZilla builds are actual Haiku binaries. The also include numerous patches that aren't in Mozilla's codebase -- particularly tqh's new NSPR (NetScape Portable Runtime), which basically is the glue that binds Mozilla together. There a few other patches as well. Basically, if you're running Haiku you should be using the BeZilla builds. There's a closed ticket on Trac that even includes links for MailNews (Thunderbird), Calendar (Sunbird), and Suite(Seamonkey).

IIRC, the issue with Firefox 3 isn't gcc4, but rather a port of Cairo that passes all of the tests. There's been a few people claiming that Cairo has been ported. Those attempts contain non-functional stubbed out code, which allows it only to compile and not function properly.

Re: Has Haiku abandoned BeOS compatibility?

umccullough wrote:

One more point - you don't really have to rewrite programs to run them in GCC4 Haiku - you basically just recompile them. This is not Haiku's fault, it is GCC's.

No blame attaches to the GCC team. Stroustrup's C++ language is/ was under-specified. The GCC authors had two equally unpalatable choices, either implement some arbitrary flavour of C++ from say 1995 and then stick to that no matter what happened with language standardisation, or else repeatedly break compatibility.

The most egregious ABI problem was the name-mangling. The linker works by taking many references to the same symbol and merging them. To do this it must be able to uniquely identify each symbol. In C this is easy, each symbol has a unique name. In C++ many symbols can share the same name and are made unique by context such as the types of the parameters to a method. Thus the compiler needs a "name mangling" strategy which reflects low level language decisions by assigning each such symbol a unique string which reflects only the relevant contextual information. Any change to these decisions (and there were many) requires changes to the name mangling, which in turn means compiled objects are no longer compatible.

You might reasonably blame Stroustrup (for the lack of a defined ABI) or those who popularised C++, or Be Inc. for choosing it as the system language for BeOS, but the GCC developers just did their best with what was available.

Be Inc. at the time asserted that the problem with C++ was unimportant, because they felt that compatibility was over-rated, JLG's big idea was you should break older software in order to avoid accumulating "cruft". This is quite a contrast to the situation today where Haiku is implementing APIs that have been deep frozen for almost a decade.

Re: Has Haiku abandoned BeOS compatibility?

NoHaikuForMe wrote:

Be Inc. at the time asserted that the problem with C++ was unimportant, because they felt that compatibility was over-rated, JLG's big idea was you should break older software in order to avoid accumulating "cruft". This is quite a contrast to the situation today where Haiku is implementing APIs that have been deep frozen for almost a decade.

From day #1, Haiku developers stated that the primary reason they wanted to keep binary compatibility for R1 was to focus the developers on a common goal. Otherwise, everyone would be out doing their own thing (this is a volunteer effort after all), and we'd never have a final product. Ever. In retrospect, this was a brilliant strategy, when compared to what happened to all the other BeOS inspired projects from 6-7 years ago which got nowhere fast.

With R2, the developers will revisit and change the API, which obviously means that we'll lose the "cruft" sooner than most people think.

Re: Has Haiku abandoned BeOS compatibility?

In the latest GCC4 build I created (r31495, I believe), I have tried a bunch of games and various tactics to make them work. Nothing worked. Files can't be found and games/apps won't run. At this point, I'm wondering if HaikuWare needs to dump it's current repository, as I'm not sure if ANY of the software there will work on Haiku today, without recompiling. That means everything there is unusable to any Haiku user today, because of changes made.

If recompiling is the necessary route in order to make what used to work, work again, I think it would be wise to start ASAP. As long as the changes to the directory structure (and/or whatever else has broken BeOS R5 software compatibility) aren't going to be changing too much more from here on out, then I think a concerted effort should be undertaken to get apps recompiled so Haiku has usable apps once again. Naturally, those same apps will probably not be BeOS compatible any longer, but HaikuWare is for Haiku software, not BeOS. The cross-compatibility was simply a convenience, but methinks that's gotten seriously broken somewhere.

Is the GCC2 build of Haiku in the same software predicament, or is this whole thing less to do with directory structure and all to do with which version of GCC is being used? We gotta start getting things figured out, so these kinda things don't happen and frustrate end-users.

Re: Has Haiku abandoned BeOS compatibility?

mmadia wrote:

A pure GCC4 version of Haiku is not binary compatible with BeOS. This is due simply to the developers of GCC not caring about backwards compatibility.

However, Haiku supports running as a GCC Hybrid, which retains binary compatibility with BeOS. There are two possible hybrids: X86 GCC 2.95 Hybrid and X86 GCC 4.x Hybrid. The "GCC --" indicates which version Haiku was compiled with. The "Hybrid" refers to a set of alternative libraries, translators, etc.

Oh, wait a sec... you mean that NO BeOS software will work in pure GCC4 (i.e. non-hybrid) builds of Haiku, regardless of what you do? If that's the case, then my apologies for my misunderstanding. I was under the impression that GCC4 Haiku built apps, etc. wouldn't run in BeOS, but that BeOS software would still run in GCC4 Haiku. But it goes both ways, eh? GCC4 Haiku can't run BeOS software and BeOS can't run GCC4 Haiku apps.

So, then, if I want ANYTHING to run in GCC4 Haiku... I better get to recompiling 'em, eh? :-)

Re: Has Haiku abandoned BeOS compatibility?

Now you've got it. :)
You need a hybrid image to run programs compiled with gcc2.95 as well as those that need gcc4.

I use a gcc4 image with additional 2.95 libs, but vice versa should work the same. Never tried though.