tkchia / gcc-ia16

Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16
GNU General Public License v2.0
177 stars 13 forks source link

ia16 with newer GCC? #148

Open Oichkatzelesfrettschen opened 3 months ago

Oichkatzelesfrettschen commented 3 months ago

It seems the last activity was 3 years ago (2021) and the compiler is the GCC 6.x branch. Now: I suppose there is only so much optimizing of GCC that can be performed.

But: what will it take to get the ia16 items in line with the latest gcc 13/14/15 branches? What would it take to upstream the changes into the main GCC project?

Retro PCs and Vintage PCs and repairs are growing in popularity, enthusiast and homebrew boards are booming; and products like the Book8086 and Book8088 for a modern take on the "Clamshell handheld" with ISA-out exist. Handhelds like the HP 100LX, HP 200LX, HP 1000LX and more exist as well for those into retro handhelds.

Additionally, the ELKS Embedded Linux project's users could benefit from a stable, up-to-date toolchain for software porting and "backporting" to this architecture.

A super-light toolchain is ideal for on-device compile jobs as well on 80286 devices with up to 16MB max RAM. All other 16-bit x86 CPUs support up to 1MB RAM, though some enterprising folks have found workarounds... but there is no virtual memory/memory paging there as far as I am aware.

asiekierka commented 3 months ago

ELKS already uses gcc-ia16 extensively; they're also adopting OpenWatcom as an alternative option as we speak. They have an issue open about alternate C compilers (see https://github.com/ghaerr/elks/issues/1443 ).

gcc-ia16 likewise has an issue open about updating past GCC 6.3.0: https://github.com/tkchia/gcc-ia16/issues/103 - but particularly far pointer support relies on many hacks which are not trivial to update. It would take someone highly knowledgeable in GCC internals to fix it properly.

Personally, if your goal is improving the 8086 compiler state, in addition to the option of updating gcc-ia16, I'd be thinking about taking advantage of LLVM, or fixing Walter Bright's Digital Mars C99/C++98 compiler from back in the day (which is open source) to compile on non-Win32 machines, depending on how many resources you have.

Also, if you want a "super-light toolchain" that will fit on a 1MB or 16MB RAM device, modern GCC is absolutely not what you're looking for.

Oichkatzelesfrettschen commented 3 months ago

ELKS already uses gcc-ia16 extensively; they're also adopting OpenWatcom as an alternative option as we speak. They have an issue open about alternate C compilers (see ghaerr/elks#1443 ).

gcc-ia16 likewise has an issue open about updating past GCC 6.3.0: #103 - but particularly far pointer support relies on many hacks which are not trivial to update. It would take someone highly knowledgeable in GCC internals to fix it properly.

Personally, if your goal is improving the 8086 compiler state, in addition to the option of updating gcc-ia16, I'd be thinking about taking advantage of LLVM, or fixing Walter Bright's Digital Mars C99/C++98 compiler from back in the day (which is open source) to compile on non-Win32 machines, depending on how many resources you have.

Also, if you want a "super-light toolchain" that will fit on a 1MB or 16MB RAM device, modern GCC is absolutely not what you're looking for.

I completely derped on OpenWatcom! Thanks!

Re: llvm/clang: was unaware of 16-bit support there, thank you!

And hey I guess worst case now is learning how to work with WBDM C99/C++98 and not just compile compilers, but build compilers. Check back in a few years for that! insert hearty belly laugh