adtools
adtools copied to clipboard
Enable ObjC and ObjC++
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.
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.
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 :).
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).
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 :).
Forgot to update: I got the compiled in the meantime and it works.
What does "it works" means? Can you add a small example? Are calls to AmigaOS functions possible?
Oh, sorry, I actually used amigaos-cross-toolchain, where I just added objc to --enable-languages and everything just worked.
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.
I successfully compiled and run all tests of https://github.com/ObjFW/ObjFW compiled with amigaos-cross-toolchain. :)
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?