Short: Make MorphOS GCC output WarpOS binaries
Author: dennisvdboon -> gmail (Dennis Boon)
Type: dev/gcc
Version: 0.4
Architecture: ppc-morphos >= 3.9
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 both MorphOS gcc 2.95.3 and 4.4.5 (version
higher than that don't seem to support custom options in the spec file, so no
5.3). I also recompiled warpcollect for MorphOS. Adaptations were also made
to some of the macros to let 4.4.5 accept them (clobbers and such).
When invoking the gcc compiler for Morphos with the -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 -warpup -O2 helloworld.c -o helloworld.exe
Or for configure:
CFLAGS=-warpup CPPFLAGS=-warpup CXXFLAGS=-warpup LDFLAGS=-warpup ./configure
Caveat:
- The 4.4.5 compiler has not been extensively tested yet in combination
with outputting WarpOS binaries. g++ is definately not working with 4.4.5.
- Don't forget to use the #pragma pack(2) / pack() combo when using AmigaOS
structures.
- Without the -warpup option it should still compile correctly for MorphOS
but this is largely untested.
- This has only been tested with the gcc compilers included with SDK 3.10.
- This is a work in progress. Stuff might be (really) broken.
Benefits:
- Now you can use the more up-to-date binutils of MorphOS..
- Use of the newer compiler 4.4.5 for C (needs testing).
Changes from 0.3:
- Both libnix 2 and 3 are missing __stdfiledes. DO NOT USE THIS IN YOUR
CODE. I've added __get_handle and __set_handle to circumvent some
of the issues with this.
- Added CPUF_G3 and CPUF_G4 to powerpc.h.
- Added RawDoFmtPPC to powerpc_protos.h (already in 0.3).
- Added ftruncate to libnix.
- Removed double truncate (in truncate.c and open.c) from libnix).
- Added libiconv.a (already in 0.3).
- Full screen from libSDL_wos was not working in 1.2.14. Reverted for
video code back to 1.2.6. (already in 0.3)
- Added Morgoth's experimental 2.95.4 compiler (version 4 with Altivec).
Use gccselect 2.95.4 to use it.
- Fixed stristr/strcasestr. It was pointing to a 68k utility.library function.
Changes from 0.2:
- compiled libnix for WarpOS and added it as libcwos.a.
- compiled the math functions from clib2 and added it to libcwos.a.
- added (obsolete?) libSDL_sound.a.
- removed obsolete libsmpeg.a; use libmad instead.
- recompiled/updated the other libs.
- added freetype-config and libpng-config to /bin.
- added -woslibs as option to link in all libs in the correct sequence.
Changes from 0.1:
- Specfile for 4.4.5 was incorrect. A long line was wrapped.
- Added various (updated) libs and headers.
- Specfile for 2.95.3 was incorrect. Reversed libgccwos and libcwos link
sequence (g++).
Future:
- If the Elf2Exe2 source can be supplied, any host with target ppc-morphos
could compile also for WarpOS. Please let me know if you have it or know
where to find it (It actually already can. but you would have to invoke
Elf2Exe2 manually).
Bug reporting:
- Please report stuff that doesn't work to me. It would be even better if you
could also supply the fix :-) I'll then re-upload a fixed version.