And you still have the problem I reported about .exe's depending on DLLs in other directories.

Please take a look at the dependencies of cc1.exe, the C compiler pass under libexec/gcc. This depends (directly) on both libwinpthreads-1.dll and libstdc++-6.dll. I've never seen any other instance of the *C* compiler pass depending on pthreads or C++. (Since you mention graphite, it might be that you omitted the --disable-shared mentioned in the graphite build instructions.)

Because it depends on DLLs in another directory, that directory has to be in your path.

And because those DLLs have the same name for 32- and 64-bit versions, this prevents have (working) both 32- and 64-bit compilers in your path or referring to them by their full paths if they are not in your path.

A workaround is to put copies of the dependent DLLs in the same directory as cc1.exe (and any other executables that are affected: so far I've only encountered those in that directory: something there depends on the libgcc_s DLL).

BTW, there is definitely something to be said for naming DLLs in a way that differs by sub-architecture. All the other platforms I work on nowdays have linkers which skip dynamic libraries of the wrong sub-architecture, but in my experience Windows does not. So this is a Windows-specific issue.

Is the exact build script you used available, so we can see how you achieved this? (I did check the corresponding source tarball, and did not see it.)


I should also report that I have recently found several instances of applications which use OpenMP/pthreads crashing on exit when compiled against winptheads but working correctly when compiled against pthreads-w32. I'm still working to track down the common factor, but it seems that this happens only on x64 (not i686) with C++ (but not using std::thread, and also on builds using 4.5.x as well as pre-4.6.3).


Let me give a little more background for those who are interested. R (www.r-project.org) is a cross-platform statistics package with millions of users, and we bundle together 32- and 64-bit builds for Windows. It is extensible by packages (there are several thousand) which can contain dynamically loaded compiled C/C++/Fortran/Java ... code and again 32- and 64-bit builds are distributed together. It is several of those extension packages that are crashing using winpthreads.

On Fri, 9 Dec 2011, Ruben Van Boxem wrote:

Hi everyone!
I have finally fired up the build machine and got another fresh from the
market toolchain for you.

What changed:
 - not much
 - Clang can now find the libstdc++ headers, although it's still missing a
few C++11 features to work with the newer stuff like <thread>, long with C++
exceptions being unimplemented. Remember this is an add-on package. Extract
it over the gcc package and it works out of the box.
 - DLL and std::thread is still a no-go.

What's still included:
latest binutils trunk, latest gdb trunk, latest GCC 4.6 branch, latest
mingw-w64 v2.x, latest winpthreads trunk, I think I bumped MPFR to 3.1.
32-bit ld can use all the memory it could want, and everything is Graphite
and core2 optimized.

A small explanation of what winpthreads is in my build:
 - I build GCC with the option to use posix threads. This allows C++11
std::thread to be built into libstdc++, which works for statically linked
apps (add '-static' to the link commandline)
 - Since GCC relies on pthreads, libgcc and other runtime libraries also
depend on it. You will need to ship the dll alongside your application,
unless you're statically linking everything.
 - This does not incur a performance penalty as far as I and anyone in this
community can tell. If this is incorrect, please speak up so it can be
looked into.

I already did.

Links below:
http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Persona
l%20Builds/rubenvb/gcc-4.6.3-1_rubenvb.tar.lzma/download
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20W
in64/Personal%20Builds/rubenvb/4.6.3-1/
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20W
in32/Personal%20Builds/rubenvb/4.6.3-1/

Cheers, and let me know of any issues you may encounter.

Ruben



--
Brian D. Ripley,                  [email protected]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595
------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to