Slimelite BBS

gcc-mos2wos.lha

Back to gcc

Make MorphOS GCC output WarpOS binaries

Size
8.8M (9,273,994 bytes)
Added
2026-11-20 02:43
Downloads
2
Long Description
IT IS RECOMMENDED TO USE A CLEANLY INSTALLED MORPHOS SDK 3.14! The files in this archive will let you develop for WarpOS on a MorphOS machine. When looking at the warpup/powerup gcc compiler version 2.95.3 I noticed that it was actually a powerup compiler with the warpup extensions bolted on top of it using a custom gcc spec file. As powerup evolved into MorphOS, they actually use the same ABI. The only difference as I can tell is the __abox__ symbol being present in MorphOS binaries and not in powerup ELF binaries. So I adapted the spec files for various MorphOS gcc compilers firstly of SDK version 3.10 and later 3.14. I also recompiled warpcollect for MorphOS. Adaptations were also made to some of the powerup macros to let the newer gcc compiler accept them (clobbers and such). When invoking the gcc compiler for Morphos with the --specs=warpup option, instead of linking with the default linker (for example collect2) warpcollect is invoked which in its turn invokes Elf2Exe2 This will result in a WarpOS executable. For example: gcc --specs=warpup -O2 helloworld.c -o helloworld.exe Or for configure for example: CFLAGS="--specs=warpup -O2" CPPFLAGS=--specs=warpup LDFLAGS=--specs=warpup CXXFLAGS="--specs=warpup -O2" ./configure Options: At the moment the library looks for NOIXPATHS in ENVARC:. If set to 1 all paths are converted to Amiga format. /GG becomes GG: for example. Caveat: - Don't forget to use the #pragma pack(2) / pack() combo when using AmigaOS structures (that is, anything included from os-includeppc). - Even better would be #pragma pack(push,2) / pack(pop) combo. - This has only been tested with gcc 9 included with SDK 3.14. - This is a work in progress. Stuff might be broken. - COMPILED PROGRAMS WILL MAYBE NOT WORK (correctly) ON MOS. Make sure to also test on a Classic PPC machine with WarpOS. Default stack on real WarpOS and MOS systems is mostly insufficient (1-4KB). You may need to increase stack to make a program work. Benefits: - Now you can use the more up-to-date binutils of MorphOS. - Use of the newer gcc 9 compiler for C and C++ (compared to the old 2.95.3) KNOWN BUGS: - WarpOS uses a modified PowerOpen ABI while gcc uses SVR4 ABI. It can lead to stack troubles when switching between the two. It is a first thing to look at when stuff crash. That being said, I already compiled a lot with these compilers and the only problem showed in minigl/Warp3D where a lot of libraries are called in a row. A quick fix was put in place in powerpc/warpup_macros.h for this. - The internal errors of bsdsocket.library and newlib differ in some places. To this end, two errno.h files are added. The original with just EAGAIN adjusted and a modified AmiTCP (errno.h_bsdsocket). CURRENT INCLUDED LIBRARIES: - gcc(wos) 9.2.0 - stdc++ 9.2.0 - newlib 3.2.0 - bz2 1.0.8 - FLAC(++) 1.3.0 - freetype 2.9.1 - jpeg 9d - lua 5.4 / 5.0.3 - mad 0.15.1b - mgl 1.2 - mikmod 3.3.11.1 - ogg 1.3.4 - png 1.6.37 - pthreads 2.0 - SDL 1.2.15 - SDL_image 1.2.12 - SDL_mixer 1.2.12 - SDL_net 1.2.8 - SDL_ttf 2.0.11 - tiff 4.1.0 - vorbis 1.3.6 - zlib 1.2.11 - amigawos 0.1.0 Changes from version 1.3: - Added camd includes back. They were missing. - 15 bit screenmodes from SDL should now be correctly displayed. - Fixed warp3d.h resetting the pack alignment. - Added ftime() function. - Added rename() function. - Added truncate() function. - Upgraded to gcc 9 including libgcc and libstdc++. - Recompiled warpcollect to strip incompatible section type called .gnu.attributes. - Updated Newlib to 3.2.0. - Updated bz2 to 1.0.8. - Updated jpeg to 9d. - Updated lua to 5.4. - Updated ogg to 1.3.4. - Updated png to 1.6.37. - Updated tiff to 4.1.0. - Added new startupwos.o. If ppclibemu from Frank Wille is active, it now can load and start WOS ELF objects. Added original one for completeness. Changes from version 1.2: - Updated SDL 1.2.14 to 1.2.15. - malloc and friends now correctly return 0 when no memory available.