www.digitalmars.com         C & C++   DMDScript  

D.gnu - Patch for GDC on Sun Solaris

reply Marcel Martin <mmar freenet.de> writes:
Hello,

a few weeks ago I asked about a GDC port to Solaris
(http://www.digitalmars.com/drn-bin/wwwnews?D.gnu/886). Oskar Linde was
right, the crashes are due to unaligned reads and it's not hard to fix.

I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
order to get a working D compiler:
- added #include <alloca.h> to all files that use alloca() in the d/dmd/
  directory
- modified Dchar::calcHash() in d/dmd/dchar.c so it doesn't read unaligned
  memory locations (icalcHash() should probably also be changed)
- added -Wcast-align to the D_CC_FLAGS in d/Make-lang.in to aid in
  finding further unaligned reads
- d/target-ver-syms.sh was changed to allow "version (Sparc)" and
  "version (solaris)"

I've changed these things in Phobos:
- d/phobos/configure.in : For Solaris' semaphore.h it's necessary to link
  against librt
- d/phobos/config/gen_math.c : (my) Solaris doesn't have C99 FP_ constants
  and functions
- d/phobos/config/config-mid now has a "version (solaris)" block. It doesn't
  work, however and is just there to allow Phobos to compile.

The patch is at http://w148.de/~mmartin/d/gdc-solaris-patch . Remember to
run autoconf in d/phobos/ since it changes the configure.in.

Results for Thomas Kuehne's Dstress are at
http://w148.de/~mmartin/d/solaris-sparc_gdc-0.10

There are still quite a few issues (args.length doesn't work for example),
but I'm happy that I even got this far.

Marcel
Feb 06 2005
next sibling parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marcel Martin schrieb am Mon, 07 Feb 2005 00:47:08 +0100:
 Hello,

 a few weeks ago I asked about a GDC port to Solaris
 (http://www.digitalmars.com/drn-bin/wwwnews?D.gnu/886). Oskar Linde was
 right, the crashes are due to unaligned reads and it's not hard to fix.

 I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
 order to get a working D compiler:
 - added #include <alloca.h> to all files that use alloca() in the d/dmd/
   directory
 - modified Dchar::calcHash() in d/dmd/dchar.c so it doesn't read unaligned
   memory locations (icalcHash() should probably also be changed)
 - added -Wcast-align to the D_CC_FLAGS in d/Make-lang.in to aid in
   finding further unaligned reads
 - d/target-ver-syms.sh was changed to allow "version (Sparc)" and
   "version (solaris)"

 I've changed these things in Phobos:
 - d/phobos/configure.in : For Solaris' semaphore.h it's necessary to link
   against librt
 - d/phobos/config/gen_math.c : (my) Solaris doesn't have C99 FP_ constants
   and functions
 - d/phobos/config/config-mid now has a "version (solaris)" block. It doesn't
   work, however and is just there to allow Phobos to compile.

 The patch is at http://w148.de/~mmartin/d/gdc-solaris-patch . Remember to
 run autoconf in d/phobos/ since it changes the configure.in.

 Results for Thomas Kuehne's Dstress are at
 http://w148.de/~mmartin/d/solaris-sparc_gdc-0.10
I've added your results and the patch.
 There are still quite a few issues (args.length doesn't work for example),
 but I'm happy that I even got this far.
Keep going *g* Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCBsFR3w+/yD4P9tIRAnV5AJ9VWY1E40RqYY8p0/AgfkEr4P7+egCdF9GI 6qTpFnE0pna+74HIHOtdNUw= =L2Bw -----END PGP SIGNATURE-----
Feb 06 2005
prev sibling next sibling parent "Ben Hinkle" <ben.hinkle gmail.com> writes:
very nice! It looks promising.

"Marcel Martin" <mmar freenet.de> wrote in message 
news:cu6a18$2h73$1 digitaldaemon.com...
 Hello,

 a few weeks ago I asked about a GDC port to Solaris
 (http://www.digitalmars.com/drn-bin/wwwnews?D.gnu/886). Oskar Linde was
 right, the crashes are due to unaligned reads and it's not hard to fix.

 I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
 order to get a working D compiler:
 - added #include <alloca.h> to all files that use alloca() in the d/dmd/
  directory
 - modified Dchar::calcHash() in d/dmd/dchar.c so it doesn't read unaligned
  memory locations (icalcHash() should probably also be changed)
 - added -Wcast-align to the D_CC_FLAGS in d/Make-lang.in to aid in
  finding further unaligned reads
 - d/target-ver-syms.sh was changed to allow "version (Sparc)" and
  "version (solaris)"

 I've changed these things in Phobos:
 - d/phobos/configure.in : For Solaris' semaphore.h it's necessary to link
  against librt
 - d/phobos/config/gen_math.c : (my) Solaris doesn't have C99 FP_ constants
  and functions
 - d/phobos/config/config-mid now has a "version (solaris)" block. It 
 doesn't
  work, however and is just there to allow Phobos to compile.

 The patch is at http://w148.de/~mmartin/d/gdc-solaris-patch . Remember to
 run autoconf in d/phobos/ since it changes the configure.in.

 Results for Thomas Kuehne's Dstress are at
 http://w148.de/~mmartin/d/solaris-sparc_gdc-0.10

 There are still quite a few issues (args.length doesn't work for example),
 but I'm happy that I even got this far.

 Marcel
 
Feb 10 2005
prev sibling next sibling parent reply David Friedman <d3rdclsmail_a_ _t_earthlink_d_._t_net> writes:
Marcel Martin wrote:
 Hello,
 
 a few weeks ago I asked about a GDC port to Solaris
 (http://www.digitalmars.com/drn-bin/wwwnews?D.gnu/886). Oskar Linde was
 right, the crashes are due to unaligned reads and it's not hard to fix.
 
 I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
 order to get a working D compiler:
 - added #include <alloca.h> to all files that use alloca() in the d/dmd/
   directory
 - modified Dchar::calcHash() in d/dmd/dchar.c so it doesn't read unaligned
   memory locations (icalcHash() should probably also be changed)
 - added -Wcast-align to the D_CC_FLAGS in d/Make-lang.in to aid in
   finding further unaligned reads
 - d/target-ver-syms.sh was changed to allow "version (Sparc)" and
   "version (solaris)"
 
 I've changed these things in Phobos:
 - d/phobos/configure.in : For Solaris' semaphore.h it's necessary to link
   against librt
 - d/phobos/config/gen_math.c : (my) Solaris doesn't have C99 FP_ constants
   and functions
 - d/phobos/config/config-mid now has a "version (solaris)" block. It doesn't
   work, however and is just there to allow Phobos to compile.
 
 The patch is at http://w148.de/~mmartin/d/gdc-solaris-patch . Remember to
 run autoconf in d/phobos/ since it changes the configure.in.
 
 Results for Thomas Kuehne's Dstress are at
 http://w148.de/~mmartin/d/solaris-sparc_gdc-0.10
 
 There are still quite a few issues (args.length doesn't work for example),
 but I'm happy that I even got this far.
 
 Marcel
 
Great! I'll add this to the next release. Please post/send any new patches. David
Feb 15 2005
parent Marcel Martin <marcel.martin uni-bielefeld.de> writes:
David Friedman wrote:
 Great! I'll add this to the next release. Please post/send any new
 patches.
Good! It might take some time, but I'll continue to work on it. Marcel
Feb 17 2005
prev sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Marcel Martin wrote:

 I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
 order to get a working D compiler:
 - d/target-ver-syms.sh was changed to allow "version (Sparc)" and
   "version (solaris)"
Q: Shouldn't this be version(SPARC) ? Not that "Windows" and "linux" sets a very good example, but anyway ? --anders
Feb 25 2005
parent Georg Wrede <georg.wrede nospam.org> writes:
Both SPARC and Solaris are needed!

You can run Linux on SPARC, and Solaris on Intel.


Anders F Björklund wrote:
 Marcel Martin wrote:
 
 I've done the following modifications to GDC 0.10 (within GCC 3.4.3) in
 order to get a working D compiler:
 - d/target-ver-syms.sh was changed to allow "version (Sparc)" and
   "version (solaris)"
Q: Shouldn't this be version(SPARC) ? Not that "Windows" and "linux" sets a very good example, but anyway ? --anders
Mar 25 2005