adtools icon indicating copy to clipboard operation
adtools copied to clipboard

Enable ObjC and ObjC++

Open Midar opened this issue 7 years ago • 10 comments

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.

Midar avatar May 27 '17 11:05 Midar

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.

sba1 avatar Jun 04 '17 15:06 sba1

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 :).

Midar avatar Jun 04 '17 22:06 Midar

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).

sba1 avatar Jun 05 '17 05:06 sba1

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 avatar Jun 26 '17 20:06 Midar

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

Midar avatar Jun 09 '18 16:06 Midar

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

sba1 avatar Jun 11 '18 21:06 sba1

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

Midar avatar Jun 11 '18 23:06 Midar

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.

sba1 avatar Jun 17 '18 21:06 sba1

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

Midar avatar Jun 19 '18 21:06 Midar

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?

Midar avatar Apr 20 '19 21:04 Midar