Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-12 Thread Andrej Mitrovic
Here's what I can add on line 434 in GDMD to make it work:
} elsif ( $arg =~ m/^-v2$/ ) {
push @out, '-v2';


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-12 Thread Andrej Mitrovic
This is great, the binaries now work. Thanks for your hard work Daniel.

Btw, it seems GDMD is hardcoded to D1? -fd-version is always 1,
there's a -v1 switch for GDMD but no -v2 switch. Should I file this?


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-11 Thread Daniel Green

On 12/11/2011 7:33 PM, bearophile wrote:

A not stripped hello world is 3_908_177 bytes, much bigger than the binary 
produced by DMD, and it's 677_888 bytes stripped.
DMD 2.057beta+optilink produce a 932_892 bytes hello world binary, while using 
the same DMD+ulink it becomes 334_576 bytes.
I recall MinGW may include extra object files during the link process. 
Try comparing against what GCC's C/C++ compiler produces.




If I compile the little D coins program here:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=151610

Using:
gdc -v2 coins.d -o coins.exe

When I run it it crashes immediately with no error messages :-(
It's a TLS issue being looked into.  Offsets are being generated against 
the wrong section.


-Dan


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-11 Thread bearophile
Daniel Green:

> I've repackaged and tested it from a clean install.
> 
> https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111211.7z

Now it compiles a working hello world, thank you :-)

A not stripped hello world is 3_908_177 bytes, much bigger than the binary 
produced by DMD, and it's 677_888 bytes stripped.
DMD 2.057beta+optilink produce a 932_892 bytes hello world binary, while using 
the same DMD+ulink it becomes 334_576 bytes.

If I compile the little D coins program here:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=151610

Using:
gdc -v2 coins.d -o coins.exe

When I run it it crashes immediately with no error messages :-(

Bye,
bearophile


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-11 Thread Andrew Wiley
On Sun, Dec 11, 2011 at 10:29 AM, Daniel Green  wrote:
> On 12/11/2011 2:39 AM, bearophile wrote:
>>
>> I feel stupid -.-
>
> Sorry, it's really a packaging issue.  Switching GDC to target i686 changed
> some library and exectuable paths resulting in these issues.
>
>
>
>> I'd like a single zip/rar/7zip with all needed files inside, with GCC too
>> :-)
>
> That could be done but I never liked the idea of requiring multiple GCC
> installations on any system.  That's why I chose this path.
>
> I've repackaged and tested it from a clean install.
>
> https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111211.7z
>

This one works for me on TDM GCC. I had the same gmp problem with the last one.

It seems calling spawn() in std.concurrency causes a segfault, but
that's a separate issue.


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-11 Thread Daniel Green

On 12/11/2011 2:39 AM, bearophile wrote:

I feel stupid -.-
Sorry, it's really a packaging issue.  Switching GDC to target i686 
changed some library and exectuable paths resulting in these issues.




I'd like a single zip/rar/7zip with all needed files inside, with GCC too :-)
That could be done but I never liked the idea of requiring multiple GCC 
installations on any system.  That's why I chose this path.


I've repackaged and tested it from a clean install.

https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111211.7z



Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-10 Thread bearophile
Daniel Green:

> Did you install TDM-GCC or MinGW Stable?

Like in my precedent test I have installed "tdm-gcc-4.6.1 exe MinGW / sjlj":
http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.6.1.exe/download


> TDM-GCC is built with shared libraries using gmp-4.3.2.  MinGW stable is 
> built with static libraries.  The dll you listed comes from gmp-5.0.1. 
> I am using the TDM-GCC build scripts to build the D compiler as well. 
> You can find the files inside the "libexec/mingw32/4.6.1" folder of the 
> TDM-GCC core download from the downloads page.

I have found that libgmp-3.dll and other needed dlls are in this directory, 
that I have added to the path:
C:\MinGW32\libexec\gcc\mingw32\4.6.1

Now it's giving me:

...>gdc -v2 test.d
gdc: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found
compilation terminated.

Despite the C:\MinGW32\libexec\gcc\mingw32\4.6.1 directory contains 
liblto_plugin-0.dll too.

I feel stupid -.-
I'd like a single zip/rar/7zip with all needed files inside, with GCC too :-)

Bye,
bearophile


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-10 Thread Daniel Green

On 12/10/2011 4:38 PM, bearophile wrote:

I have tried the same install operations I have tried in a precedent post, and 
now it says it is not finding this:
libgmp-3.dll

Did you install TDM-GCC or MinGW Stable?

TDM-GCC is built with shared libraries using gmp-4.3.2.  MinGW stable is 
built with static libraries.  The dll you listed comes from gmp-5.0.1. 
I am using the TDM-GCC build scripts to build the D compiler as well. 
You can find the files inside the "libexec/mingw32/4.6.1" folder of the 
TDM-GCC core download from the downloads page.


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-10 Thread bearophile
Daniel Green:

> Updated binaries.
> https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111210.7z

I have tried the same install operations I have tried in a precedent post, and 
now it says it is not finding this:
libgmp-3.dll

This thread that seems related:
http://old.nabble.com/GCJ---libgmp-3.dll-was-not-found-td25234066.html

Bye,
bearophile


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-10 Thread Daniel Green

Updated binaries.
https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111210.7z

 * GDC now targets i686 processors.  Was targeting i386 which required 
substituting functions for atomic instructions.


I will release MinGW64 binaries soon then work on updating to tip and 
changing the default compiler to D2.


-Daniel



Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-06 Thread Alex Rønne Petersen

On 06-12-2011 02:46, Trass3r wrote:

Why is D1 still the default?

Because this is the first release where I felt D2 was capable of being
the default and I forgot about it until writing the post. It also
requires some reworking of the changes that enable dual compilers.


but why is there a zip version anyway?

I posted with a zip extension in the original post, so rather than
letting everyone get an 404 error, I just uploaded a zip file.


I see.
btw, is there something like gdmd for Windoze too?


That would be very helpful, indeed! I don't feel like rewriting all of 
my makefiles to use GDC's parameter syntax. ;)


- Alex


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread Daniel Green

On 12/5/2011 9:47 PM, bearophile wrote:


I suggest to make D2 the default.

That's the plan.


I have installed the latest TDM GCC in
C:\MinGW

Then I have unpacked the 7-zip over the directories of the MinGW install. 150+ 
files got overwritten, some executables too.

I have made sure C:\MinGW\bin and C:\MinGW\lib are in the path. C:\MinGW\lib 
contains libgphobos.a too.

If now I compile a little program using:
gdc -v2 test.d

It probably doesn't find Phobos:

c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libgphobos2.a(bitmanip.o): In 
function `D3std8bitmanip8BitArray7opIndexMxFkZb':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.6.1/libphobos/std/bitmanip.d:410:
 undefined reference to `__sync_fetch_and_add_4'
...
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libgphobos2.a(bitmanip.o):C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.6.1/libphobos/std/bitmanip.d:410:
 more undefined references to `__sync_fetch_and_add_4' follow

I don't even know what C:\crossdev\ is, I don't have that directory.

Debug information.  That's where it was compiled.


Do you know how to improve this situation?
I had to recompile binutils to enable TLS support.  It appears I messed 
up some configure options.  I will post once I've fixed the issue and 
uploaded new binaries.


-Daniel


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread bearophile
Daniel Green:

> * -v1(default) compiles for D1.

I suggest to make D2 the default.

I have installed the latest TDM GCC in
C:\MinGW

Then I have unpacked the 7-zip over the directories of the MinGW install. 150+ 
files got overwritten, some executables too.

I have made sure C:\MinGW\bin and C:\MinGW\lib are in the path. C:\MinGW\lib 
contains libgphobos.a too.

If now I compile a little program using:
gdc -v2 test.d

It probably doesn't find Phobos:

c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libgphobos2.a(bitmanip.o): In 
function `D3std8bitmanip8BitArray7opIndexMxFkZb':
C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.6.1/libphobos/std/bitmanip.d:410:
 undefined reference to `__sync_fetch_and_add_4'
...
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libgphobos2.a(bitmanip.o):C:\crossdev\gdc\v2\build\mingw32\libphobos/../../../gcc-4.6.1/libphobos/std/bitmanip.d:410:
 more undefined references to `__sync_fetch_and_add_4' follow

I don't even know what C:\crossdev\ is, I don't have that directory.

Do you know how to improve this situation?

Bye and thank you,
bearophile


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread Trass3r

Why is D1 still the default?
Because this is the first release where I felt D2 was capable of being  
the default and I forgot about it until writing the post.  It also  
requires some reworking of the changes that enable dual compilers.



but why is there a zip version anyway?
I posted with a zip extension in the original post, so rather than  
letting everyone get an 404 error, I just uploaded a zip file.


I see.
btw, is there something like gdmd for Windoze too?


Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread Daniel Green

On 12/5/2011 8:28 PM, Trass3r wrote:

Why is D1 still the default?
Because this is the first release where I felt D2 was capable of being 
the default and I forgot about it until writing the post.  It also 
requires some reworking of the changes that enable dual compilers.



but why is there a zip version anyway?
I posted with a zip extension in the original post, so rather than 
letting everyone get an 404 error, I just uploaded a zip file.




Re: Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread Trass3r

Thx!


  * Release includes both D versions.
* -v1(default) compiles for D1.
* -v2 compiles for D2.
* The switch must be used for linking as well.

Why is D1 still the default?


  * 64bit and up to date GDC forthcoming.
Imho the 64 bit version is even more important since gdc is the only  
option at all to produce Win64 binaries.

(and of course beginning with Win7 everyone should use an x64 OS anyway ;))


  * 7-zip format for size reasons:  http://7-zip.org

perfect.


This release
https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111205.zip


but why is there a zip version anyway?


Release: MinGW GCC 4.6.1 GDC 1.070/2,.055

2011-12-05 Thread Daniel Green
Please post all issues in D.gnu or on GDC's bitbucket site 
https://bitbucket.org/goshawk/gdc


 * Built against TDM GCC 4.6.1:  http://tdm-gcc.tdragon.net/
 * Built against GDC revision 7e22befef29c.
 * Working TLS support.
 * Updated binutils and mingw runtime for TLS support.
   * new gas directive @secrel32 will generate a constant offset usable
 as an immediate or displacement value.
 Works like posix counterparts @tpoff, @dtpoff, etc.
   * Fixes an error with the mingw runtime related to TLS.
 * 7-zip format for size reasons:  http://7-zip.org
 * Release includes both D versions.
   * -v1(default) compiles for D1.
   * -v2 compiles for D2.
   * The switch must be used for linking as well.
 * Made possible by Iain Buclaw's hard work in maintaining GDC.
 * 64bit and up to date GDC forthcoming.

To install simply extract to you TDM MinGW32 directory.

This release
https://bitbucket.org/goshawk/gdc/downloads/gcc-4.6.1-tdm-1-gdc-7e22befef29c-20111205.zip

All MinGW GDC downloads.
It's highly recommended to ignore all prior builds.  TLS *will* not work.
https://bitbucket.org/goshawk/gdc/downloads


All patches, source files and build scripts can be found at 
https://bitbucket.org/venix1/mingw-gdc/


Enjoy.