GCC-Pack

Online Status

I finally managed to create easily deployable package with native GCC compiler (2.95.3) version. An Installer script creates a complete environment. After installation (and reboot, but I will fix it) GCC is ready to use. GCC-Pack optionally installs ixemul stuff (includes, linklibs, startup codes etc.) and/or libnix. It also extracts and installs OS includes from NDK (which has to be downloaded separately). A beta version 0.1 is available here.

Installer script also patches NDK includes as discussed by me in other thread.

I plan to add some examples, project skeletons and test project. I also think about optional installation of 3-rd party dev packages like MUI, XPK, AHI etc.

Patch applied to OS includes is in standard diff format (file "include_h.diff" in the pack), so is easy to review.

Online Status

0.2 (26.01.2024)

  • FIXED: installation script, parameter for confirm had no quotes.
  • FIXED: installation script, wrong filename of ixemul.library, when installing on 68060.
  • FIXED: when 68LC060 is detected, 68020 version of ixemul.library should be installed.

Online Status

Fine work, krashan - thanks for that!
I have two remarks for issues that appeared to me when testing your v0.2:
1) Shell stack should be around 100.000 ( my emulated A1200/040 crashes if stack is lower than that while using gcc)
2) Assign AmiTCP is missing - assign AmitTCP: GG: prevents Guru
Maybe you could include isuue 2 in the installer script?

Online Status

BTW - if however possible, please add support for Roadshow SDK, MUI and AHI. :)

Online Status

@micha_bpunkt I compile some nontrivial projects with default 4 kB stack and have no issues. Maybe when a single source file is large, problems may appear, I don't know. As for AmiTCP: assign, no it is not needed. At least I don't have it.

Online Status

GCC-Pack updated to version 0.3

When using GCC-Pack 0.2 I have discovered a bug in the compiler. When one compiled with -fbaserel and -fomit-frame-pointer resulting binary crashed. Investigation shoved that offset calculation for stack based function arguments is off by 4 bytes. Browsing GeekGadgets archive I've found the latest released 2.95.3-4 compiler revision. It turned out it has this bug fixed. GCC-Pack 0.3 has compiler binaries and libgcc updated to this revision.

C++ is coming

I have also succesfully tested C++ compiler. One serious issue is with NDK inline files for system API calls. For GCC they use feature of placing function arguments in specified processor registers. Unfortunately for GCC 2.95.3 this feature is supported only by C compiler, but not C++ compiler.

Then I changed inlines to use feature of local registered variables placed in specified processor registers. Such inlines are universal, work with both C and C++. The next GCC-Pack will use them instead of ones from NDK.

On the quest of using GCC compilers with no standard library (both C and C++) I've made a small wrapper linklib which makes them to use system mathieee libraries for floating point math.

C++ compiler without stdlibc++ produces really small and nice executables. Two C++ features have to be disabled however: exceptions and RTTI (runtime type information) used in dynamic_cast and typeof. These features rely on stdlibc++ and there is no point to reimplement them. I plan to release my stdlibless C and C++ app skeleton with the pack.

Online Status

nice work

dynamic_cast would be a priority for me but so would a lot of stdlib++

Online Status

Linking without stdlib is optional. GCCPack contains both libgcc and libstdc++, as well as C++ standard headers, so one can install them and use g++ the "normal" way. With default startup code and linker options, exceptions and RTTI should work (have not tested them however). Anyway, if you code in modern C++ profesionally, using this compiler still be painfull. GCC 2.95.3 is obviously far behind current standards. It (almost) implements C++98, and that's all.

I remember talks about efficiency and overhead of exceptions implementation in GCC in early 2000s. Even Firefox has been intentionally compiled with -fno-exceptions those days. AFAIR turning on exceptions made the code slower even when no exception was thrown.