www.digitalmars.com         C & C++   DMDScript  

D.gnu - GDC on Mac OS X 10.2 - compat issues

reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


Upon requests, I was trying to compile a GDC
version for (legacy) Mac OS X 10.2 "Jaguar",
using "Dec. 2002" Developer Tools with extra
"Aug 2003" gcc update to get GCC version 3.3...

(Tried to cross-compile it at first, but no luck.
Seems I always manage to trigger compiler crashes)


Here are the compatibility issues, that I ran into:

1) <wchar.h> is missing. ("wchar_t" is in <stdlib.h>)
    Think that this header is a C99 feature, perhaps?

2) <alloca.h> is missing (alloca is in <stdlib.h> too)

3) wcslen is missing, and has to be added from compat
    library. Only needed this function, so I hacked it

4) dlfcn.h is missing, but is available in "dlcompat"
    (See http://www.opendarwin.org/projects/dlcompat/)

5) socklen_t is *not* being defined by <sys/socket.h>

6) ldfuncs are all missing from System.dylib, and it
    seems that gphobos is "hardcoded" to assume them ?

Details are attached. (target is powerpc-apple-darwin6)


If the last issue can be resolved (a configure issue ?),
then it should be OK to run GDC on Mac OS X 10.2 too...

Mac OS X 10.1 only has GCC 2.95, so it's not for GDC.
Mac OS X 10.0 aka Mac OS X Public Beta 2, is obsolete.

--anders

PS.
A more exciting project is building X86 cross-compiler,
mostly for targeting Mac OS X 10.4 - running on Intel:

i686-apple-darwin8-gdc-4.0.1
powerpc-apple-darwin8-gdc-4.0.1

But so far I haven't had any luck cross-compiling that
either, and I don't have access to the Transition Kit.
Dec 04 2005
parent reply David Friedman <d3rdclsmail_a_ _t_earthlink_d_._t_net> writes:
Anders F Björklund wrote:
 
 Upon requests, I was trying to compile a GDC
 version for (legacy) Mac OS X 10.2 "Jaguar",
 using "Dec. 2002" Developer Tools with extra
 "Aug 2003" gcc update to get GCC version 3.3...
 
 (Tried to cross-compile it at first, but no luck.
 Seems I always manage to trigger compiler crashes)
 
 
 Here are the compatibility issues, that I ran into:
 
 1) <wchar.h> is missing. ("wchar_t" is in <stdlib.h>)
    Think that this header is a C99 feature, perhaps?
 
 2) <alloca.h> is missing (alloca is in <stdlib.h> too)
 
 3) wcslen is missing, and has to be added from compat
    library. Only needed this function, so I hacked it
 
 4) dlfcn.h is missing, but is available in "dlcompat"
    (See http://www.opendarwin.org/projects/dlcompat/)
 
 5) socklen_t is *not* being defined by <sys/socket.h>
 
 6) ldfuncs are all missing from System.dylib, and it
    seems that gphobos is "hardcoded" to assume them ?
 
 Details are attached. (target is powerpc-apple-darwin6)
 
 
 If the last issue can be resolved (a configure issue ?),
 then it should be OK to run GDC on Mac OS X 10.2 too...

Can you try this fix for the ldfuncs problem? It's a replacement for d/phobos/configure (also includes the configure.in) http://home.earthlink.net/~dvdfrdmn/d/macosx102compat.tgz I don't have a working 10.2 system right now (my iBook is giving off toxic fumes...)
 
 Mac OS X 10.1 only has GCC 2.95, so it's not for GDC.
 Mac OS X 10.0 aka Mac OS X Public Beta 2, is obsolete.
 
 --anders
 
 PS.
 A more exciting project is building X86 cross-compiler,
 mostly for targeting Mac OS X 10.4 - running on Intel:
 
 i686-apple-darwin8-gdc-4.0.1
 powerpc-apple-darwin8-gdc-4.0.1
 
 But so far I haven't had any luck cross-compiling that
 either, and I don't have access to the Transition Kit.
 
 

The next release I make will be on SourceForge. At that time, I'll put all of new cross-compilation stuff in CVS. David
Dec 05 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Friedman wrote:

 A more exciting project is building X86 cross-compiler,
 mostly for targeting Mac OS X 10.4 - running on Intel:

 i686-apple-darwin8-gdc-4.0.1
 powerpc-apple-darwin8-gdc-4.0.1

 But so far I haven't had any luck cross-compiling that
 either, and I don't have access to the Transition Kit.

The next release I make will be on SourceForge. At that time, I'll put all of new cross-compilation stuff in CVS.

Sounds good! (too bad SourceForge doesn't have any "newer" Mac OS X machines in their build farm, like any Mac OS x86) Q: Did you have any input on how to tweak the "configure" for Mac OS X 10.2 that didn't seem to have the ldfuncs ? --anders
Dec 06 2005
parent reply David Friedman <d3rdclsmail_a t_earthlink_d.t_net> writes:
Anders F Björklund wrote:
 David Friedman wrote:
 
 A more exciting project is building X86 cross-compiler,
 mostly for targeting Mac OS X 10.4 - running on Intel:

 i686-apple-darwin8-gdc-4.0.1
 powerpc-apple-darwin8-gdc-4.0.1

 But so far I haven't had any luck cross-compiling that
 either, and I don't have access to the Transition Kit.

The next release I make will be on SourceForge. At that time, I'll put all of new cross-compilation stuff in CVS.

Sounds good! (too bad SourceForge doesn't have any "newer" Mac OS X machines in their build farm, like any Mac OS x86) Q: Did you have any input on how to tweak the "configure" for Mac OS X 10.2 that didn't seem to have the ldfuncs ? --anders

Yep, here is a replacement for d/phobos/configure: http://home.earthlink.net/~dvdfrdmn/d/macosx102compat.tgz I don't have 10.2 system to test it, though. If it works for you, I'll put it in the next release. David
Dec 06 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Friedman wrote:

 Q: Did you have any input on how to tweak the "configure"
 for Mac OS X 10.2 that didn't seem to have the ldfuncs ?


 http://home.earthlink.net/~dvdfrdmn/d/macosx102compat.tgz
 
 I don't have 10.2 system to test it, though. 
 If it works for you, I'll put it in the next release.

Thanks, I'll give it a spin (or more of a "slow rotation", at 500Mhz) If it works, I'll do the same thing for the "gdcmac" binaries. Mac OS X 10.2 and GCC 3.3 will be the minimum, though. There are limits on how far through the layers even an archelogically interested person is willing to dig :-) --anders
Dec 06 2005
prev sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Friedman wrote:

 Yep, here is a replacement for d/phobos/configure:
 
 http://home.earthlink.net/~dvdfrdmn/d/macosx102compat.tgz
 
 I don't have 10.2 system to test it, though. 

Closer... ld: Undefined symbols: _strtold So just that one left now. :-) Might be from std.c.stdlib ? Looks duplicated: version (darwin) { private import std.c.darwin.ldblcompat; real strtold(char *, char **); pragma(GNU_asm,strtold,"strtold"~__DARWIN_LDBL_COMPAT); } else { private import gcc.config; alias gcc.config.cstrtold strtold; } --anders
Dec 06 2005
next sibling parent reply David Friedman <d3rdclsmail_a t_earthlink_d.t_net> writes:
Anders F Björklund wrote:
 David Friedman wrote:
 
 Yep, here is a replacement for d/phobos/configure:

 http://home.earthlink.net/~dvdfrdmn/d/macosx102compat.tgz

 I don't have 10.2 system to test it, though. 

Closer... ld: Undefined symbols: _strtold So just that one left now. :-) Might be from std.c.stdlib ? Looks duplicated: version (darwin) { private import std.c.darwin.ldblcompat; real strtold(char *, char **); pragma(GNU_asm,strtold,"strtold"~__DARWIN_LDBL_COMPAT); } else { private import gcc.config; alias gcc.config.cstrtold strtold; } --anders

Try replacing that fragment with this one: ----- version (darwin) version (GNU_Have_strtold) version = darwin_strtold; version (darwin_strtold) { private import std.c.darwin.ldblcompat; real strtold(char *, char **); pragma(GNU_asm,strtold,"strtold"~__DARWIN_LDBL_COMPAT); } else { private import gcc.config; alias gcc.config.cstrtold strtold; } ----- Thanks for putting up with all of this! David
Dec 06 2005
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Friedman wrote:

 Try replacing that fragment with this one:
 
 -----
 version (darwin)
     version (GNU_Have_strtold)
     version = darwin_strtold;
 version (darwin_strtold)
 {
     private import std.c.darwin.ldblcompat;
     real strtold(char *, char **); 
 pragma(GNU_asm,strtold,"strtold"~__DARWIN_LDBL_COMPAT);
 }
 else
 {
     private import gcc.config;
     alias gcc.config.cstrtold strtold;
 }
 -----

Okay, will use this new code instead.
 Thanks for putting up with all of this!

Np, seems to be complete for this time. --anders
Dec 06 2005
prev sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
 Might be from std.c.stdlib ? Looks duplicated:
 
 version (darwin)
 {
     private import std.c.darwin.ldblcompat;
     real strtold(char *, char **); 
 pragma(GNU_asm,strtold,"strtold"~__DARWIN_LDBL_COMPAT);
 }
 else
 {
     private import gcc.config;
     alias gcc.config.cstrtold strtold;
 }

Yeah, that was it... And D "Hello, World!" now works :-D Changed to: version (darwin) { private import std.c.darwin.ldblcompat; } else { private import gcc.config; } alias gcc.config.cstrtold strtold; gdc-0.17-mac-10.2 going up as soon as packaging completes. --anders
Dec 06 2005