AminetAminet
Search:
82217 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/gcc/gcc-mos2wos.lha

Mirror:Random
Showing:ppc-amigaosgeneric
No screenshot available
Short:Make MorphOS GCC output WarpOS binaries
Author:dennisvdboon -> gmail (Dennis Boon)
Uploader:dennisvdboon gmail com (Dennis Boon)
Type:dev/gcc
Version:0.6
Architecture:ppc-morphos >= 3.9
Distribution:Aminet
Date:2018-04-23
Download:http://aminet.net/dev/gcc/gcc-mos2wos.lha - View contents
Readme:http://aminet.net/dev/gcc/gcc-mos2wos.readme
Downloads:896
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 MorphOS gcc 2.95.3, 4.4.5 and 5.3.0. of SDK
version 3.10 for MorphOS. I also recompiled warpcollect for MorphOS.
Adaptations were also made to some of the powerup macros to let 4.4.5 & 5.3.0
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

To select a compiler use gccselect. Valid arguments are 2.95.3, 2.95.4,
4.4.5 and 5. For example:

gccselect 4.4.5

will select version 4.4.5 of gcc/g++ as your compiler. The gccselect script
is as a default stored in the parent dir of GG. It comes with the SDK.


Caveat:

- The 4.4.5 compiler seems to have a problem with the built-in mfpr library
  end often throws an error when used with g++.
- Don't forget to use the #pragma pack(2) / pack() combo when using AmigaOS
  structures (that is, anything included from os-includeppc).
- Without the --specs=warpup option it should still compile correctly for
  MorphOS
- 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.
- COMPILED PROGRAMS WILL PROBABLY NOT WORK (correctly) ON MOS. Also test on
  a real Amiga with WarpOS!

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).
- Use of the even newer compiler 5.3.0 for C and C++ (also needs testing).

KNOWN BUGS:

- Statically compiled mpfr library in 4.4.5 seems to crash a lot during use
  of g++. Use 5.3.0. when that happens.
- 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.


Changes from 0.5:
- Added ftruncate, readlink, realpath, nanosleep, usleep, kprintf.
- Added --specs=warpnix if you want to use libnix with 4.4.5/5.3.0.
- Fixed various bugs including but not all:
- Newlib now correctly uses 32 bit for time_t.
- Closing stderr on MOS caused a hang on MOS. Implemented a work around.
- Now unix paths are also correctly converted by mkdir in libnix.
- Included correct/up-to-date Warp3D includes this time.

Changes from 0.4:
- Separated 2.95 and 4.4.5/5.3.0 libs and updated specs files accordingly.
- Added specs file, includes and compiled libs for 5.3.0.
- Now you should use --specs=warpup option instead of the -warpup option.
- Fixed an error in the 4.4.5 specs file. os-includeppc and -DWARPUP were
  not used.
- Compiled newlib for WarpOS. It's the default c lib for 4.4.5 and 5.3.0.
  Default for 2.95.x is still libnix.
- Compiled libgcc of the 4.4.5 package for WarpOS and added it for 4.4.5 and
  5.3.0 (called libgccwos.a).
- Compiled libstdc++ of the 5.3.0 package for WarpOS and added it for 4.4.5
  and 5.3.0.
- Newlib includes are in gg:/ppc-amigaos/newlib/include/
- Libs for 4.4.5/5 are in gg:/ppc-amigaos/newlib/lib/
- Fixed the semaphore functions in SDL Threads. They now put tasks in waiting
  states instead of performing busy-wait loops.
- Added minigl library and updated includes (called libmgl.a).
- Updated/corrected the Warp3D includes.
- WarpOS macros now reserve a bit more stack to prevent callback issues.
- Recompiled most of the libs with 5.3.0.
- Removed libSDL_sound.a from 4.4.5/5.3.0. Obsolete and didn't work.
- THIS UPDATE NEEDS A CLEANLY INSTALLED MORPHOS SDK!
- -WARPUP IS NO LONGER GUARANTEED TO WORK. USE --SPECS=WARPUP INSTEAD!

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.



Contents of dev/gcc/gcc-mos2wos.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[generic]              18012298 65935360  27.3% -lh5- 04b8 Apr 23 18:30 gcc-mos2wos.tar
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         1 file  18012298 65935360  27.3%            Apr 23 14:45

Aminet © 1992-2018 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>