October 31, 2007
Hi

I was able to build a workable gdc 0.24 from the darwin ports archive by removing the reference to c++ in the configure.args section of this file

/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/gdc/Portfile

and 

then installing with

sudo port install gdc

This builds gdc 0.24 against gcc 4.1.2.

During operation gdc generates numerous warnings

/var/folders/-9/-91jp5FuE3GuA1DJFsQFLE+++TI/-Tmp-//cckNieF8.s:658:indirect jmp without `*'
/var/folders/-9/-91jp5FuE3GuA1DJFsQFLE+++TI/-Tmp-//cckNieF8.s:673:indirect jmp without `*'
/var/folders/-9/-91jp5FuE3GuA1DJFsQFLE+++TI/-Tmp-//cckNieF8.s:692:indirect jmp without `*'
/var/folders/-9/-91jp5FuE3GuA1DJFsQFLE+++TI/-Tmp-//cckNieF8.s:707:indirect jmp without `*'

but produces a workabout executable

I haven't had any luck compiling gdc from svn yet as the only apple compiler sources available are gcc-5363, which is from the tiger series. It appears that the gcc built into Leopard is build from revision 5465 which has just been released now. If I have any luck building against leopards gcc i'll report it to this list

Cheers

Dave

October 31, 2007
Dave Cheney wrote:

> I haven't had any luck compiling gdc from svn yet as the only apple compiler sources available are gcc-5363, which is from the tiger series. It appears that the gcc built into Leopard is build from revision 5465 which has just been released now. If I have any luck building against leopards gcc i'll report it to this list

As reported earlier, the check in setup-gcc.sh for "Apple Computer"
doesn't match the new "Apple the Phone company", errr, "Apple Inc.":

grep version_string gcc/version.c | grep -qF '(Apple Computer, Inc.'
const char version_string[] = "4.0.1 (Apple Inc. build 5465)";

It should instead be: if grep -q 'Apple version' gcc/version.c; then
so that the correct GCC patch is used, and build_gcc needs fixing up.

But then the build is on its way, let's see whether it completes/works.
(I don't think there are too many differences actually, but we'll know)

--anders
October 31, 2007
On 2007-10-31 23:58:01 +1100, Anders F Bjöšrklund <afb@algonet.se> said:

> It should instead be: if grep -q 'Apple version' gcc/version.c; then
> so that the correct GCC patch is used, and build_gcc needs fixing up.
> 
> But then the build is on its way, let's see whether it completes/works.
> (I don't think there are too many differences actually, but we'll know)
> 
> --anders

My compile consistently bombs out at this line

gcc   -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition   -mdynamic-no-pic -DHAVE_CONFIG_H  -o gdc \
	d/d-spec.o d/d-gcc.o version.o prefix.o intl.o darwin-driver.o ../libcpp/libcpp.a ./../intl/libintl.a /usr/lib/libiconv.dylib  ../libiberty/libiberty.a
Undefined symbols:
 "_need_pthreads", referenced from:
     _need_pthreads$non_lazy_ptr in d-spec.o

I have a vague recollection of reading that Leopard included some changes to the pthread libraries (but I'm unable to find the reference again) so possibly this symbol has moved location ?

Cheers

Dave

October 31, 2007
Dave Cheney skrev:

> My compile consistently bombs out at this line
> 
> gcc   -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition   -mdynamic-no-pic -DHAVE_CONFIG_H  -o gdc \
>     d/d-spec.o d/d-gcc.o version.o prefix.o intl.o darwin-driver.o ../libcpp/libcpp.a ./../intl/libintl.a /usr/lib/libiconv.dylib  ../libiberty/libiberty.a
> Undefined symbols:
>  "_need_pthreads", referenced from:
>      _need_pthreads$non_lazy_ptr in d-spec.o

AFAIK, that's just a failed patch...

diff -cr gcc-orig/gcc.c gcc/gcc.c
*** gcc-orig/gcc.c	Sat Jan 21 13:38:48 2006
--- gcc/gcc.c	Thu Mar  1 10:27:25 2007
***************
*** 134,139 ****
--- 134,142 ----
  /* Flag set by cppspec.c to 1.  */
  int is_cpp_driver;

+ /* Flag set by drivers needing Pthreads. */
+ int need_pthreads;
+
  /* Flag saying to pass the greatest exit code returned by a sub-process
     to the calling program.  */
  static int pass_exit_codes;

--anders
October 31, 2007
Anders F Bjöšrklund escribió:
> Carlos Santander wrote:
> 
>> I don't know what -isysroot is; I remember seeing it somewhere, but I don't think I've missed it. And I don't know what you mean by supporting the SDKs.
> 
> SDKs are what Apple use to support cross-developing between OS releases.
> http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/ 
> 
> 
> It also supports cross-compiling between the architectures, in order to
> make Universal Binaries but I'm sure you were aware of that already...
> 
> --anders

I still fail to see what the big difference is between the two, sorry.

-- 
Carlos Santander Bernal
October 31, 2007
Anders F Bjöšrklund escribió:
> Dave Cheney wrote:
> 
>> I haven't had any luck compiling gdc from svn yet as the only apple compiler sources available are gcc-5363, which is from the tiger series. It appears that the gcc built into Leopard is build from revision 5465 which has just been released now. If I have any luck building against leopards gcc i'll report it to this list
> 
> As reported earlier, the check in setup-gcc.sh for "Apple Computer"
> doesn't match the new "Apple the Phone company", errr, "Apple Inc.":
> 
> grep version_string gcc/version.c | grep -qF '(Apple Computer, Inc.'
> const char version_string[] = "4.0.1 (Apple Inc. build 5465)";
> 
> It should instead be: if grep -q 'Apple version' gcc/version.c; then
> so that the correct GCC patch is used, and build_gcc needs fixing up.
> 
> But then the build is on its way, let's see whether it completes/works.
> (I don't think there are too many differences actually, but we'll know)
> 
> --anders

Trying gcc-5465 now.

I added another if to setup-gcc.sh, since I don't know enough sh to do it better:

if grep version_string gcc/version.c | grep -qF '(Apple Inc.'; then
    gcc_apple=apple-
fi

But now I got a different error:

../../gcc-5465/gcc/d/d-lang.cc: In function 'void d_write_global_declarations()':
../../gcc-5465/gcc/d/d-lang.cc:670: warning: comparison between signed and unsigned integer expressions
../../gcc-5465/gcc/d/d-lang.cc: At global scope:
../../gcc-5465/gcc/d/d-lang.cc:1580: error: invalid conversion from 'char' to 'tree_code_class'

I wonder if I should report it as a bug?

-- 
Carlos Santander Bernal
October 31, 2007
Carlos Santander escribió:
> Anders F Bjöšrklund escribió:
>> Dave Cheney wrote:
>>
>>> I haven't had any luck compiling gdc from svn yet as the only apple compiler sources available are gcc-5363, which is from the tiger series. It appears that the gcc built into Leopard is build from revision 5465 which has just been released now. If I have any luck building against leopards gcc i'll report it to this list
>>
>> As reported earlier, the check in setup-gcc.sh for "Apple Computer"
>> doesn't match the new "Apple the Phone company", errr, "Apple Inc.":
>>
>> grep version_string gcc/version.c | grep -qF '(Apple Computer, Inc.'
>> const char version_string[] = "4.0.1 (Apple Inc. build 5465)";
>>
>> It should instead be: if grep -q 'Apple version' gcc/version.c; then
>> so that the correct GCC patch is used, and build_gcc needs fixing up.
>>
>> But then the build is on its way, let's see whether it completes/works.
>> (I don't think there are too many differences actually, but we'll know)
>>
>> --anders
> 
> Trying gcc-5465 now.
> 
> I added another if to setup-gcc.sh, since I don't know enough sh to do it better:
> 
> if grep version_string gcc/version.c | grep -qF '(Apple Inc.'; then
>     gcc_apple=apple-
> fi
> 
> But now I got a different error:
> 
> .../../gcc-5465/gcc/d/d-lang.cc: In function 'void d_write_global_declarations()':
> .../../gcc-5465/gcc/d/d-lang.cc:670: warning: comparison between signed and unsigned integer expressions
> .../../gcc-5465/gcc/d/d-lang.cc: At global scope:
> .../../gcc-5465/gcc/d/d-lang.cc:1580: error: invalid conversion from 'char' to 'tree_code_class'
> 
> I wonder if I should report it as a bug?
> 

Oh, and setup-gcc.sh also failed, but I went ahead anyway. This is the relevant section:

patching file build_gcc
Hunk #1 succeeded at 114 (offset 8 lines).
Hunk #2 FAILED at 149.
Hunk #3 FAILED at 246.
Hunk #4 succeeded at 288 (offset 18 lines).
Hunk #5 succeeded at 304 (offset 18 lines).
Hunk #6 succeeded at 354 (offset -7 lines).
Hunk #7 succeeded at 419 with fuzz 2 (offset -4 lines).
Hunk #8 FAILED at 437.
3 out of 8 hunks FAILED -- saving rejects to file build_gcc.rej


-- 
Carlos Santander Bernal
October 31, 2007
Carlos Santander skrev:

> Oh, and setup-gcc.sh also failed, but I went ahead anyway. This is the relevant section:
> 
> patching file build_gcc
> Hunk #1 succeeded at 114 (offset 8 lines).
> Hunk #2 FAILED at 149.
> Hunk #3 FAILED at 246.
> Hunk #4 succeeded at 288 (offset 18 lines).
> Hunk #5 succeeded at 304 (offset 18 lines).
> Hunk #6 succeeded at 354 (offset -7 lines).
> Hunk #7 succeeded at 419 with fuzz 2 (offset -4 lines).
> Hunk #8 FAILED at 437.
> 3 out of 8 hunks FAILED -- saving rejects to file build_gcc.rej

Some of the context around the patch changed, because of the
addition of the ARM cross-compiler targets... (for the iPhone)

The failed lines are the ones that lipo together gdc-4.0 and rdmd

--anders
October 31, 2007
Carlos Santander skrev:

> But now I got a different error:
> 

> ../../gcc-5465/gcc/d/d-lang.cc: At global scope:
> ../../gcc-5465/gcc/d/d-lang.cc:1580: error: invalid conversion from 'char' to 'tree_code_class'
> 
> I wonder if I should report it as a bug?

I'm seeing this too, but it's a strange one since
it should only be a char for GCC versions < 4.0

--anders
December 15, 2007
Hi,

I'm getting the same warnings.

/var/folders/iT/iTI3bw3gHJudhiAFd4HJV++++TI/-Tmp-//ccVYelUD.s:208:indirect jmp without `*'

OS X version: 10.5.1
gcc -v: gcc version 4.0.1 (Apple Inc. build 5465)
gdc -v: gcc version 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020))

I used macports to install gdc.

Anders