sba1 / adtools

Experimental GNU toolchain for AmigaOS
31 stars 18 forks source link

Enable ObjC and ObjC++ #31

Open Midar opened 7 years ago

Midar commented 7 years ago

Currently, GCC is built with --enable-languages=c,c++. Can you please change this to --enable-languages=c,c++,objc,obj-c++? The overhead is minimal, but it allows using ObjC and ObjC++ on AmigaOS 4.

sba1 commented 7 years ago

Did you try it the compiling process works with that and if so, if you can create binaries? I would assume that at least some adaptions need to be done, but I haven't tried it myself yet.

Midar commented 7 years ago

Nope, I haven't - I haven't it gotten to build yet (even without changing it). However, there shouldn't really be any changes necessary. It uses the thread-model provided by GCC. And you can even decide to not build libobjc at all, since nobody is using it anyway (everything using ObjC is usually using a different runtime). So essentially, just let it build cc1objc and nothing more. That shouldn't require changes :).

sba1 commented 7 years ago

I'll try it locally, when I find the time. Currently, the travis job that produces the binaries is at the limit, so it probably cannot be enabled by default unless we can speed up the process (or split it).

Midar commented 7 years ago

This should not significantly change build time, so I'd actually suggest you give it a try to see if you actually hit any limits :).

Midar commented 6 years ago

Forgot to update: I got the compiled in the meantime and it works.

sba1 commented 6 years ago

What does "it works" means? Can you add a small example? Are calls to AmigaOS functions possible?

Midar commented 6 years ago

Oh, sorry, I actually used amigaos-cross-toolchain, where I just added objc to --enable-languages and everything just worked.

sba1 commented 6 years ago

It is still not clear what "everything" means :) If you could post a small example that works with amigaos-cross-toolchain, then I can investigate whether enabling objc for adtools is also a possibility. Thanks.

Midar commented 6 years ago

I successfully compiled and run all tests of https://github.com/ObjFW/ObjFW compiled with amigaos-cross-toolchain. :)

Midar commented 5 years ago

Ping? I just did another build (with c,objc, though, as c,c++ would not build for me because it suddenly tried using the system C++ headers and then obviously failed due to threads) and this is working fine (except I manually have to link in $prefix/lib/gcc/ppc-amigaos/8.3.0/gthr-amigaos-native.o for libgcc to have all symbols resolved).

In fact, people on the internet are already writing instructions that include this change, so it could be great if this could be included upstream: http://www.os4coding.net/blog/kas1e/how-build-amigaos4-cross-compiler-binutils-2232-gcc-820-msys2

Can we please fix this upstream and ideally even include in the released binaries?