View Full Version : Compiling GCC for MinGW & Cross-Compiling with Linux


cc979
5th March 2006, 19:52
I've made this little guide to get a working MinGW gcc-4.0.3 up to gcc-4.1.2 (should work with binutils too)

i did have the latest build on my googlepage but it ran out of bandwidth, unless anybody canrecommend a freehost - its back to the previous way

try this (check http://www.mingw.org/download.shtml for updates)

MinGW-5.1.3-[candidate only base-files]

http://prdownloads.sf.net/mingw/MinGW-5.1.3.exe?download

MSYS-1.0.10.exe

http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download

if you need cvs
http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download

and when installing if the connection drops, click retry (sf problem)

and i recommend to get latest runtime,w32api headers
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=158844
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=158847

and the new binutils that allows spaces in filenames
https://sourceforge.net/forum/forum.php?forum_id=661143

and if building hogs your system i recommend editing the msys.bat

change the:
line 62: start rxvt ... into start /LOW rxvt ... and
line 66: start sh ... into start /LOW sh ...
(more reliable for your system, you can do other while building)

get gcc-sources try here:
http://www.mirrorservice.org/sites/sources.redhat.com/pub/gcc/

release directory or whatever


***** most of the pre-released/snapshots of gcc needs bison,flex and sometimes libiconv, libtool

bison into \mingw\ directory --
http://gnuwin32.sourceforge.net/downlinks/bison-bin-zip.php
http://gnuwin32.sourceforge.net/downlinks/bison-dep-zip.php

flex into \mingw\ directory --
http://gnuwin32.sourceforge.net/downlinks/flex-bin-zip.php

libtool into \mingw\ directory --
http://gnuwin32.sourceforge.net/downlinks/libtool-bin-zip.php

libiconv into \mingw\
http://gnuwin32.sourceforge.net/downlinks/libiconv-bin-zip.php
http://gnuwin32.sourceforge.net/downlinks/libiconv-dep-zip.php

and maybe newer gnu-make (not needed but useful and sometimes buggy)
http://prdownloads.sourceforge.net/mingw/mingw32-make-3.80.0-3.exe?download

installing the newer make delete/rename old msys\1.0\bin\make.exe and install the new make into \mingw\ and then
rename the new mingw32-make.exe into make.exe

make --version to check

or compile your own from http://ftp.gnu.org/gnu/make/

***

The directory that should contain system headers does not exist:
/usr/include

create an empty include folder in \msys\1.0\

***

make[2]: Leaving directory `/home/user/svn/gcc-4_1-branch/build/libcpp'
make[2]: Entering directory `/home/user/svn/gcc-4_1-branch/build/gcc'
Makefile:1280: *** target pattern contains no `%'. Stop.
make[2]: Leaving directory `/home/user/svn/gcc-4_1-branch/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/user/svn/gcc-4_1-branch/build'
make: *** [all] Error 2

check makefile = LD = ld
(not LD = ?:/mingw/bin/../lib/gcc/mingw32/???/../../../../mingw32/bin/ld.exe)
i think related to --with-gcc --with-gnu-ld --with-gnu-as

or delete ld.exe from \mingw\mingw32\bin or empty the folder that's what i did
(but i think the newer binutils fixes that anyway, will check later)

****

Step 1

cd yourgcc-src
mkdir build
cd build

Step 2
tip. before you install new gcc zip your \mingw\ directory ... you never know

Pass 1

append "&> output-results.txt" without quotes to echo to file (displayed text into a file)

after some experiments, i found symbolic links are broke, not sure on how to fix it

you can append: --with-dwarf2 -s (for silent output) to configure line
you can append &>result.txt to pipe any shell output to file


*** for gcc 4.1+ use bison,flex see notes on ld.exe

*** for gcc 4.2+ append --disable-werror

*** updated configure 2006.12.23 (remove --host=mingw32 --target=mingw32 to build for your system)

(remove '"CFLAGS=-O2" "LDFLAGS=-s" --enable-optimize' if debugging the compiler)


for i386
../configure --enable-languages=c -v --enable-optimize --host=mingw32 --build=mingw32 --target=mingw32 --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x

for i686
../configure --enable-languages=c -v --enable-optimize --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x



make "CFLAGS=-O2" "LDFLAGS=-s"
or
make bootstrap "CFLAGS=-O2" "LDFLAGS=-s"

* if the bootstrap fails something is wrong with gcc compiler itself, means it can't rebuild itself with itself


(you can save it for later, if you re-install mingw just copy the folder back in)
make DESTDIR=/home/gcc-build install

(the normal install)
make install

make html
(if you want the html - docs, there should be here yourgcc-src\libstdc++-v3\docs\html )

close and re-load ming

Step 3

Pass 2

empty your build directory

if you need g77 its not supported in gcc 4+, try gcc 3.4.4
but if want to build gfortran read further down

available languages are: c,c++,f95,java,objc,obj-c++,treelang

*** for gcc 4.2+ append --disable-werror


for i386
../configure --enable-languages=c,c++ -v --enable-optimize --host=mingw32 --build=mingw32 --target=mingw32 --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x

for i686
../configure --enable-languages=c,c++ -v --enable-optimize --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x



make "CFLAGS=-O2" "LDFLAGS=-s"
or
make bootstrap "CFLAGS=-O2" "LDFLAGS=-s"

* if the bootstrap fails something is wrong with gcc compiler itself, means it can't rebuild itself with itself


(you can save it for later, if you re-install mingw just copy the folder back in)
make DESTDIR=/home/gcc-build install

(the normal install)
make install

close and re-load ming

Step 4

Pass 3 ( build gcc with gcc with profiled bootstrap to get a faster compiler)
this not necessary but you get a faster compiler

empty your build directory


for i386
../configure --enable-languages=c,c++ -v --enable-optimize --host=mingw32 --build=mingw32 --target=mingw32 --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x

for i686
../configure --enable-languages=c,c++ -v --enable-optimize --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x



make "CFLAGS=-O2" "LDFLAGS=-s"
or
make bootstrap "CFLAGS=-O2" "LDFLAGS=-s"

* if the bootstrap fails something is wrong with gcc compiler itself, means it can't rebuild itself with itself


(you can save it for later, if you re-install mingw just copy the folder back in)
make DESTDIR=/home/gcc-build install

(the normal install)
make install

***

Fortran, GMP, MPFR

Building GMP

download gmp from
http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gmp/

cd your gmp-src

./configure --host=mingw32 --build=mingw32 --target=mingw32 --prefix=/mingw

make DESTDIR=/home/gcc-libs install

make install

Building MPFR

download mpfr from
http://www.mpfr.org/mpfr-current/

cd your mpfr-src

./configure --host=mingw32 --build=mingw32 --target=mingw32 --prefix=/mingw

make DESTDIR=/home/gcc-libs install

make install

Building Fortran (F95)

cd your gcc-src
mkdir build
cd build


../configure --enable-languages=f95 -v --enable-optimize --prefix=/mingw --oldincludedir=/mingw/include --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x


make "CFLAGS=-O2 " "LDFLAGS=-s"
or
make bootstrap "CFLAGS=-O2" "LDFLAGS=-s"


(save for later installs)
make DESTDIR=/home/f95-build install

make install

**** more to add later

Compiling GCC for MinGW from Linux

update in progress...

see later posts

**** more to add later

thanks to those who helped, you know who you are

cheers

Inventive Software
6th March 2006, 15:03
Maybe adding Fortran (g77)? I'm 95% certain that'll compile with no problems. GCC/MinGW usually stumbles with ObjectiveC and/or Java.

Why do people insist on having GCC 4 working with MinGW? What was wrong with GCC 3.4.5? I've been using that with no problems at all.

cc979
6th March 2006, 15:30
Maybe adding Fortran (g77)? I'm 95% certain that'll compile with no problems. GCC/MinGW usually stumbles with ObjectiveC and/or Java.

Why do people insist on having GCC 4 working with MinGW? What was wrong with GCC 3.4.5? I've been using that with no problems at all.

can do, i myself - not used fortran for ages

people must like new toys to play with - optimizing stuff gcc 4.1 sounds interesting

leowai
8th March 2006, 17:52
@cc979, thanks for the guide. :)

And I've a suggestion here. I see the commands to MinGW are mixed with your comments. It will be much clearer if you put the commands in code box like this: ;) ../configure --enable-languages=c --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --disable-win32-registry --disable-shared --enable-sjlj-exceptions --without-x --enable-hash-synchronization --enable-libstdcxx-debug

Or using "quote":
../configure --enable-languages=c --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --disable-win32-registry --disable-shared --enable-sjlj-exceptions --without-x --enable-hash-synchronization --enable-libstdcxx-debug

cc979
9th March 2006, 12:59
@cc979, thanks for the guide. :)

And I've a suggestion here. I see the commands to MinGW are mixed with your comments. It will be much clearer if you put the commands in code box like this: ;) ../configure --enable-languages=c --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --disable-win32-registry --disable-shared --enable-sjlj-exceptions --without-x --enable-hash-synchronization --enable-libstdcxx-debug

Or using "quote":

can do
cheers

cc979
23rd March 2006, 22:06
@cc979
Nice guide for people who already know how to do it, but the whole compilation will never be doable for the average Joe (unless you're a clairvoyant), due to lots of path typos (like what the h*** is /sys/1.0/ directory ), missing or messy steps and ambiguities. A working gcc compilation guide should have about 30 detailed steps, not 4 or 5.

after installing MSYS you get a /sys/1.0/ directory or where you have installed

in '30 steps' have tried ?

path typo ? tell me where

cc979
24th March 2006, 16:06
/sys/1.0/ should be /msys/1.0/ ..

I mean about 30 steps like this (http://forum.doom9.org/showthread.php?p=723782#post723782) otherwise it's not a step by step guide, but a quick reference (kind of reminder) for people who already know how to compile it. I'll try to fix the gcc guide (for gcc-core-4.2.x) and post it later here.

cheers

cc979
24th November 2006, 05:38
i've built build gcc-4.2-20061114, gcc-4.3-20061118

if anyone wants them, not tried build ffdshow with them yet

check out, about the warning: format '%I64d' expects type
'int', but argument 3 has type 'gcov_type'

http://www.nabble.com/-Bug-bootstrap-25502---New%3A-Werror-problem-in-build-tf777349.html#a2025034

gmp-4.2,mpfr-2.2.0 (not sure the libs are needed for the gcc-dists) and updated bison,flex,libtool,libiconv was used to build the latest snapshots of gcc 4.2 & 4.3

read the first page for more details

the files
http://www.mytempdir.com/1079929

foxyshadis
24th November 2006, 07:56
Yes! This is awesome, mainly because I've been itching to use OpenMP in ffmpeg and gcc 4.3 finally implements it. I'll probably have to run some experiments with it first to see how functional it is.

cc979
24th November 2006, 14:09
Yes! This is awesome, mainly because I've been itching to use OpenMP in ffmpeg and gcc 4.3 finally implements it. I'll probably have to run some experiments with it first to see how functional it is.

your welcome, let me know how it goes for you - i had problems with the baseclasses compiling ffdshow myself, help - if you can do it

cheers

cc979
25th November 2006, 01:32
with gcc-4.3 ffdshow fails on baseclasses

see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20652

and some else ran into compiling other sources
http://www.nabble.com/gcc-4.1%3A-Weird-rejection-of-__stdcall-aliases-tf828763.html#a2150693

foxyshadis
25th November 2006, 01:57
I was only going to use it for lavc/mplayer, so that shouldn't affect me to much at the moment. It'll be interesting trying to test for any bugs introduced though.

btw, was this cross-compiled from linux, or compiled off the existing 4.0/4.1 gcc for win32?

cc979
25th November 2006, 17:29
I was only going to use it for lavc/mplayer, so that shouldn't affect me to much at the moment. It'll be interesting trying to test for any bugs introduced though.

btw, was this cross-compiled from linux, or compiled off the existing 4.0/4.1 gcc for win32?

i used win32 mingw gcc 4.0.3 if remember as it was after few failed attempts, till i realised what it needed

cc979
28th November 2006, 21:01
build 4.1.2 20061127 (prerelease) - patched
can build ffdshow needs testing

http://www.mytempdir.com/1088799

clsid
19th December 2006, 13:01
Somehow all the executables in your builds are much larger than 'official' mingw32 builds. I once made a build myself and had the same problem.

Perhaps the executables contain debugging or other unneeded code? Hopefully you can figure out what is wrong and 'fix' it. As it might affect the performance of the compilers too.

cc979
19th December 2006, 21:55
Somehow all the executables in your builds are much larger than 'official' mingw32 builds. I once made a build myself and had the same problem.

Perhaps the executables contain debugging or other unneeded code? Hopefully you can figure out what is wrong and 'fix' it. As it might affect the performance of the compilers too.

i had it include GMP, MPFR libs maybe thats affecting it, i look into it

cc979
23rd December 2006, 12:05
new build of gcc-4.1.2

http://www.mytempdir.com/1130278

@clsid used the strip option this time, are indeed smaller

clsid
23rd December 2006, 13:45
Thanks.

cc979
2nd February 2007, 21:04
just built gcc-build-4.1.2-121479 if anyone wants

http://www.mytempdir.com/1199083

let me know, if anything wrong

cc979
7th February 2007, 14:32
https://sourceforge.net/project/showfiles.php?group_id=2435

The 2.17.50-200700129-1 snapshot incorporates modifications to official
binutils CVS since last update. In addition it patches windres to allow
use of spaces in filenames,

cc979
8th February 2007, 22:26
mingw-gcc-4.0.4

c:/mingw version
http://www.mytempdir.com/1208832
http://www.speedyshare.com/767136953.html
md5: D8CE3805F8DDB7B3DA729A4A63B5BEA3

d:/mingw version
http://www.mytempdir.com/1208847
http://www.speedyshare.com/330144904.html
md5: BD4D52DC4FF6B282DF50BB54ABF5C2F3

cc979
13th February 2007, 01:56
new builds up, patched

compiles ffdshow now

for drive c
http://www.mytempdir.com/1213589
md5: 8C04506F796B48F09F445A2F789038A5

for drive d
http://www.mytempdir.com/1213600
md5: 419A32AFF886AE1E016C48ABDBB86D5A

cc979
13th February 2007, 14:15
out of curiosity, is there any other paths that mingw users install to ?

eLupus
14th February 2007, 20:12
just wondering, howcome you need different builds for different paths?

cc979
15th February 2007, 14:25
just wondering, howcome you need different builds for different paths?

I think it's a problem with msys or gcc, on linux (doing a cross-compile) using a --prefix=/mingw would hardcode the search path into the compiler /mingw but in msys (windows) the hardcoded path would be /c/mingw or /d/mingw

i really should start doing cross-compiles

eLupus
15th February 2007, 18:05
odd that :)

cc979
17th February 2007, 01:20
as gcc 4.1.2 has been released officially, it is not patched to fix the 'alias thunk' error - hence it will not compile baseclasses in ffdshow

_xxl
17th February 2007, 09:15
When mingw gcc 4.x.x can compile SSE2 then it is really an important update for me.

cc979
19th February 2007, 22:57
new builds of gcc-4.1.3 svn

at http://cc979.uk.googlepages.com/home

Yong
20th February 2007, 22:40
tried your gcc 4.1.3, compiling ffdshow was fine,
but still create broken ffdshow.ax.
4.0.3/4.0.4 work fine for me, thx ;)

cc979
21st February 2007, 02:02
tried your gcc 4.1.3, compiling ffdshow was fine,
but still create broken ffdshow.ax.
4.0.3/4.0.4 work fine for me, thx ;)

i did get ffdshow.ax compiled by removing '-march=pentium-mmx -mtune=i686' from the makefiles but it has worked with last few builds

maybe it is a gcc problem with -march and -mtune

if you have any luck let me know, cheers

kneep
26th February 2007, 11:33
How to remove all the '-g' flags when compiling?
Seems not work by setting CFLAGS='-O2' CXXFLAGS='-O2'

cc979
26th February 2007, 18:12
How to remove all the '-g' flags when compiling?
Seems not work by setting CFLAGS='-O2' CXXFLAGS='-O2'

have a look at manual 3.9 (page 53)

tells you all about it

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc.pdf

or for other formats
http://gcc.gnu.org/onlinedocs/

you can look here for bugs and other gcc stuff
http://www.nabble.com/gcc-f1154.html

cheers

kneep
27th February 2007, 02:35
have a look at manual 3.9 (page 53)

tells you all about it

http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc.pdf

or for other formats
http://gcc.gnu.org/onlinedocs/

you can look here for bugs and other gcc stuff
http://www.nabble.com/gcc-f1154.html

cheers
Thanks.
I've read the manual.
So you suggest not remove it because it facilitates bug reporting?

cc979
27th February 2007, 05:25
Thanks.
I've read the manual.
So you suggest not remove it because it facilitates bug reporting?

if you are sure there no bugs in your compiles, it should be ok

removing the -g can be done with

--disable-debug

or

-g0 (zero not o)

or

--enable-debug=no

or

DEBUG_FLAGS=-g0 (zero not o)

so i have read, let me know how it goes - i've not had the need to remove the -g yet

cheers

morph166955
28th February 2007, 18:40
i just wanted to say thanks for this little guide. i successfully compiled gcc 4.1.2 on my msys box (took a little bit of work getting some of the dependancys and loaded properly but i did!). im currently attempting to get gcc 4.2 and 4.3 working. gcc 4.2 compiles with only --enable-languages=c (c++ crashes on a bad header, im trying a new svn update now to see if that fixes it). and gcc 4.3 has other issues but thats to be expected. before anyone says "why use gcc 4.3" my answer is simple, i have a core2 and i want to make my programs optimized for the core2 (like mplayer and such) so that they are able to use the new instructions in the chip as well as SSSE3 (i think thats the right # of s's) and gcc 4.3 is the only version with core2 in it.

once i get this thing all said and done i may make a tgz of the dependancys that i built and had to find to get this thing to work right so people dont have to spend the 6-8 hours hunting them down and fighting with them to compile properly...but ill cross that bridge when i come to it. if anyone is doing this NOW and wants them i suspose i could do it so PM me if you are in need ill see what i can do.

THANKS AGAIN!

cc979
1st March 2007, 00:39
yeah i had to find the right combinations of files and configs to get anything working - gcc 4.2 & 4.3 - were working then get updated then broke but thats the way thing goes

glad my guide was of help, but if anything could be made more clear let me know

cheers

morph166955
1st March 2007, 01:05
well i succesfully got 4.2 working on an svn update from earlier today on both c & c++ so that was nice. im now trying to tweak it a little to be more optimized so that it runs faster and all that jazz.

4.3 is however being stuborn still...im getting an issue dealing with .dep files in the i686-pc-mingw32/libgcc folder (see the snip below). its the same issue ive been having with it for the past few days. not really sure why i get that error and ive only found vague references to other people having issues with it however no fixes that i can find. what would be real cool is if someone could give me a date/revision of a working version of gcc 4.3 that i can try to see if its my msys/mingw setup or if its the code itself. i found a version online from 20061204 which im going to try to get out of the svn and use.

just outa curioisity...to speed up my compile time when doing test builds of 4.3, if i dont use CFLAGS=-O2 when i run make, that would just give me a version thats not really optimized right? I figured with out doing optimization on the files it would probably compile faster for me.

thanks again.


make[3]: Entering directory `/home/Administrator/build-gcc-4.3.0/i686-pc-mingw32/libgcc'
__gcc_bcmp.dep:1 ***multiple target patterns. Stop.
make[3]: Leaving directory `/home/Administrator/build-gcc-4.3.0/i686-pc-mingw32/libgcc'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/Administrator/build-gcc-4.3.0/i686-pc-mingw32/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/Administrator/build-gcc-4.3.0/'
make: *** [all] Error 2

Yong
1st March 2007, 02:15
i did get ffdshow.ax compiled by removing '-march=pentium-mmx -mtune=i686' from the makefiles but it has worked with last few builds

maybe it is a gcc problem with -march and -mtune

if you have any luck let me know, cheers
just tried compile ffdshow.ax without -mtune -march options, still no luck :p

morph166955
1st March 2007, 19:39
ok so i just got gcc 4.3 to work only with C enabled and then it occured to me...im not really doing anything that uses c++ (mplayer, xvid, x264 primarily) so would it be a bad thing to install gcc 4.3 for my c only stuff and just leave the c++ stuff to the 4.2 thats already installed?

cc979
1st March 2007, 21:36
well i succesfully got 4.2 working on an svn update from earlier today on both c & c++ so that was nice. im now trying to tweak it a little to be more optimized so that it runs faster and all that jazz.

did you patch your gcc 4.2 to fix alias thunk problem
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067

regarding gcc 4.3 did you update to the latest binutils - with patched winres?

hope devs include the patch in 4.2 & 4.3 has they did not with gcc 4.1.2

i'll dig a bit further to see whats up, cheers

cc979
1st March 2007, 21:39
just tried compile ffdshow.ax without -mtune -march options, still no luck :p

snap - just tried again, think i'll revert to an previous svn try and debug it

cheers

morph166955
2nd March 2007, 02:39
i did not do any patches at all. i compiled 4.2 successfully from yesterdays svn with:

../gcc-4.2.0/configure -v --enable-optimize --enable-languages=c,c++ --prefix=/mingw \
--enable-threads --oldincludedir=/mingw/include --disable-shared \
--with-cpu=prescott --with-arch=prescott --with-tune=prescott \
--with-ld=/mingw/bin/ld.exe --with-as=/mingw/bin/as.exe --disable-checking \
--without-x --disable-win32-registry --disable-nls --disable-werror --disable-libssp

make "CFLAGS=-O3 -march=prescott -mtune=prescott -msse -msse2 -msse3 -mmmx" "LDFLAGS=-s"


i realize the make line is a little excessive and probably unnecessary with the sse stuff but i figured it couldnt hurt. i was shooting for the most optimized and fastest compiler i could get and i figured that telling it to compile with the extra instruction sets put in would be nice (i wasnt looking to distribute this to anyone else and im only using it on this system).

as for 4.3, the snapshot from back in december works with out any problems. the current svn doesnt work. i think the reason why is because they moved things around and created a libgcc folder which is whats causing my problem (atleast one of them). i think something is screwed up with the way they do the dependancys for it creating the .dep files and not deleting them.

what im probably going to do is see the exact point they did that move and then try to get an svn of the version right before it (maybe ill go back a few from that just to be safe) and see if it works. wish me luck, ill let ya know how it goes.

morph166955
2nd March 2007, 02:56
sorry missed your point bout binutils...i pulled an svn down like 3 days ago and successfully built and installed that so i believe that should be good (unless the patch is something i have to add on top of that). afaik binutils has things like ar and ld, so below are my version info on those. im rebuilding/installing them from the most current svn now just incase althoguh i doubt it will do anything for me.

GNU ld version 2.17.50 20070228
GNU ar 2.17.50 20070228

cc979
2nd March 2007, 03:49
sorry missed your point bout binutils...i pulled an svn down like 3 days ago and successfully built and installed that so i believe that should be good (unless the patch is something i have to add on top of that). afaik binutils has things like ar and ld, so below are my version info on those. im rebuilding/installing them from the most current svn now just incase althoguh i doubt it will do anything for me.

GNU ld version 2.17.50 20070228
GNU ar 2.17.50 20070228

mingw binutils was patched to handle spaces in filenames, the link is on page1

the gcc 4.2 patch i was talking about fixes a problem about 'thunk alias's' - it was working in gcc 4.0 branch put they broke or changed something in gcc 4.2 and gcc 4.3 - so you might have problems compiling somethings

looking at your config sames like you can't it any faster, maybe if you use profiledbootstrap (but thats a different ball game - should be docs floating around about it)

you could re-compile gcc 4.2 with 'make bootstrap' just to check for errors

cheers

morph166955
2nd March 2007, 04:18
ill test the mingw binutils but if memory serves i used that before building my own and i had the same issue. thanks

morph166955
2nd March 2007, 09:00
its officially 3am but i just thought id post this up for now...ill explain tomorrow morning when I am consious


$ gcc --version
gcc.exe (GCC) 4.3.0 20070301 (experimental)


thats off of the current svn btw. the ONLY change I had to make was to add "rm -f *.dep" to libgcc/Makefile.in immeadiately above the make line i believe it was under the "all" category. ill make a diff tomorrow and upload it...that is a fully optimized version of gcc btw...and i got both c and c++ to compile. im considering trying to make java work too so that I can do some of my java work also on it, but thats for later. my next task, getting mplayer working on this again but this time im going to have all of my libraries optimized for core2/ssse3...

morph166955
2nd March 2007, 19:22
so interesting quirk. mplayer wont compile at -O0 or -O4 but does on -O1

i get an "'asm' operand has impossible constraint" error with libavcodec/i386/dsputil_mmx.c on line 636 (that matches the first asm volatile call in static inline void transpose4x4). my quick searching on google shows that this could be a gcc 4.2/4.3 error however i also found something on the gcc buglist about a similar file/problem from oct 2006 (h264.c http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29440) and this is exhibiting identical signs. any advice?

EDIT: so yea...seems that it works...sometimes. its kinda weird...ive run it now twice at -O4 with no changes to the system at all and it worked once and failed once...im doing more runs with different options on the gcc line to see what caused the failure...

EDIT2: ok ignore the whole thing bout -O what ever...it was crashing only when using "-march=core2 -mtune=core2" however i tested it on prescott and that worked...im looking more into it. im thinking the way i built/optimized 4.3 may have had something to do with it so im making another build now that is completely unoptimized to double check.

cc979
3rd March 2007, 01:16
so interesting quirk. mplayer wont compile at -O0 or -O4 but does on -O1

i get an "'asm' operand has impossible constraint" error with libavcodec/i386/dsputil_mmx.c on line 636 (that matches the first asm volatile call in static inline void transpose4x4). my quick searching on google shows that this could be a gcc 4.2/4.3 error however i also found something on the gcc buglist about a similar file/problem from oct 2006 (h264.c http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29440) and this is exhibiting identical signs. any advice?

EDIT: so yea...seems that it works...sometimes. its kinda weird...ive run it now twice at -O4 with no changes to the system at all and it worked once and failed once...im doing more runs with different options on the gcc line to see what caused the failure...

EDIT2: ok ignore the whole thing bout -O what ever...it was crashing only when using "-march=core2 -mtune=core2" however i tested it on prescott and that worked...im looking more into it. im thinking the way i built/optimized 4.3 may have had something to do with it so im making another build now that is completely unoptimized to double check.

if you use 'make bootstrap' it should tell if you have errors
also there's 'make check' but you need some others files, i think dejagnu

i've just trying to do a cross-compile with linux - not had much look yet

cheers

morph166955
3rd March 2007, 01:56
ive run make bootstrap and it works also. im attempting a cygwin cross-compile now (im still at the stage that im compiling/loading gmp,bison, etc). i can get 4.3 to compile and work when its in "prescott mode" its just agrivating that i cant get libavcodec to compile with core2 set.

the other issue im still having (and i loaded the binutils from sf.net already as well as my own) is that when gcc is run with -MM i still get output that has C:/msys... in it. the colon is whats causing my problem cause for some reason it isnt converting that to /c/msys and im not sure how to force that to do it. im kinda stumped on that one and i think if i fixed that then things would be much easier in this build for me.

cc979
3rd March 2007, 02:51
ive run make bootstrap and it works also. im attempting a cygwin cross-compile now (im still at the stage that im compiling/loading gmp,bison, etc). i can get 4.3 to compile and work when its in "prescott mode" its just agrivating that i cant get libavcodec to compile with core2 set.

the other issue im still having (and i loaded the binutils from sf.net already as well as my own) is that when gcc is run with -MM i still get output that has C:/msys... in it. the colon is whats causing my problem cause for some reason it isnt converting that to /c/msys and im not sure how to force that to do it. im kinda stumped on that one and i think if i fixed that then things would be much easier in this build for me.

is libavutil patched with this http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2006-December/005868.html

cc979
3rd March 2007, 03:02
just found that compiling gmp & mfpr using gcc-4.1.2, fail the 'make check' so the libs can't be trusted - they are fine using gcc-4.0.4

morph166955
3rd March 2007, 20:12
i havent patched it yet no...i was waiting to get a vanilla version working before going any further with patches and such. My cygwin cross-compile failed but I think its cause my cygwin isnt setup properly (ive never used it before and I just installed it).

I have a freebsd 6.1 box that im going to try to compile it on today to see if that works. assuming I can get it working I'll be happy although I have a feeling that I'm going to have a similar problem that I have now. I'm probably going to end up upgrading that box to have 4.3 locally so that it can create my core2 optimized version of 4.3 for mingw after that works.

cc979
4th March 2007, 03:45
i've successfully cross-compiled gcc 4.0.4 using linux, i'll post a guide soon - more testing first

then i'll try doing a cross-compiled 4.2 & 4.3

cheers

morph166955
4th March 2007, 03:55
can you by chance give me a cliff notes of what you did or at least your configure line to use as a base? i JUST finished upgrading gcc natively on my bsd box and im getting ready to do the cross compile in the next half hour.

cc979
4th March 2007, 04:16
it's tricky -- tuck about 2days of re-learning

you will need bison,flex libtool, and maybe others

first you compile binutils with
../configure --prefix=/mingw --target=i686-pc-mingw32
make && make install

then

PATH=$PATH:/mingw/bin
(so it knows where the new mingw32-cross is)

then you need mingw32-includes & libs in the correct folder
eg. /mingw/i686-pc-mingw32/

then compile gcc with
../configure --prefix=/mingw --target=mingw32

make && make install

then

CC=/usr/bin/gcc
and re-compile with
../configure --prefix=/mingw --build=i686-pc-linux-gnu --host=i686-pc-mingw32

then then final-recompile

$ gcc -v
Using built-in specs.
Target: i686-pc-mingw32
Configured with: ../configure --build=i686-pc-linux-gnu --host=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw -v --enable-optimize --enable-threads --disable-nls --disable-win32-registry --disable-shared --without-x
Thread model: win32
gcc version 4.0.4

morph166955
4th March 2007, 04:37
ok i get the first gcc compile...but why the second with --build and --host instead of --target? everything ive seen has not had that final step. also why am i setting CC=... for that phase?

cc979
4th March 2007, 04:58
build=is always the systems-compiler
host=is what system its going to run on
target=create code for the desired system

cross-compile is the target=mingw
and build=system(as it needs to run the code it makes)
and target=mingw

so the last step is a cross-compiler that can on run on its own system and produce=mingw too

there's plenty of docs on the net but hard to follow, as there scripts what never work for me

cheers

morph166955
4th March 2007, 05:06
well thats my point...none of the docs i have read online including whats on the mingw site have said anythingabout that last step that i was asking about...atleast not anything to do with changing build...i think one showed doing something to host.

ffmpeg
4th March 2007, 05:15
good,I will try to compile

cc979
4th March 2007, 15:23
well thats my point...none of the docs i have read online including whats on the mingw site have said anythingabout that last step that i was asking about...atleast not anything to do with changing build...i think one showed doing something to host.

true, this one was has good info http://kegel.com/crosstool/crosstool-0.43/doc/crosstool-howto.html
and
http://www.mingw.org/MinGWiki/index.php/this%20shell-Script?PHPSESSID=abce11154a632520eb

cc979
4th March 2007, 15:44
crosscompiled working mingw gcc 4.0.4 (should work from any drive)
http://www.mytempdir.com/1241176

needs testing - can anybody test this on your systems and let me of the outcome

cheers

morph166955
4th March 2007, 19:15
aite well im doing my final build now with the --build & --host lines. everything else seemed to work perfectly.

i went off of http://lists.trolltech.com/qt-interest/2006-03/thread00351-0.html (minus the parts about QT at the bottom) and that seems to have worked for me. the thing im curious about (and this may be what you were trying ot say about the build/host options) is that i didnt actually get a program called just gcc. infact everything in my bin directory is prefixed by "i686-pc-mingw32-" (eg gcc is i686-pc-mingw32-gcc).

Assuming that this thing works, and that i can get it over to mingw, and that its able to compile something (mplayer will probably be my test subject)...im going to try to do a core2 optimized version of it and see how that goes. im probably going to end up using gnu-time to see how fast it sped up the build.

cc979
8th March 2007, 03:24
anybody who is using my latest cross-compiled gcc-4.0.4 with multi-core or hyper-threading - does the compiler it self show multiple gcc c/c++ in task manager - i am curious if the compiler is multi-threaded in msys ?

cc979
10th March 2007, 06:55
building whole toolchain - binutils,gcc & cross binutils,gcc

using bison,flex,libtool maybe needed automake,autogen,autoconf

*** step 1 : binutils linux
sudo mkdir -m 777 /my-toolchain

../configure --prefix=/my-toolchain --build=i686-pc-linux-gnu -v --enable-threads --disable-nls --disable-shared

(can use -march='your-cpu' in cflags eg. -march=k8)
make "CFLAGS=-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
make install && rm -rf *

(for backup reason)
make DESTDIR=/home/user/backup-build install


*** step 2 : gcc linux

../configure --build=i686-pc-linux-gnu --enable-languages=c,c++ --prefix=/my-toolchain -v --enable-threads --disable-nls --disable-shared --without-included-gettext --with-system-zlib --enable-libstdcxx-debug

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8)
make "CFLAGS=-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
make install && rm -rf *

PATH=/my-toolchain/bin:$PATH

*** step 3 : gmp & mpfr linux

do this step in gmp & mpfr src folders

./configure --prefix=/my-toolchain --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --disable-shared

(can use -march='your-cpu' in cflags eg. -march=k8)
make CFLAGS="-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
make check
make install && make distclean

*** step 4 : binutils cross linux>mingw
sudo mkdir -m 777 /mingw

../configure --prefix=/mingw -v --target=i686-pc-mingw32 -v --enable-threads --disable-nls --disable-shared
make "CFLAGS=-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
make install && rm -rf *

PATH=/mingw/bin:$PATH

*** step 5 : setup mingw32 include & libs

extract to below path and it works: mingw32-w32api & mingw32-mingw-runtime (include & libs)
into: /mingw/i686-pc-mingw32/include


*** step 6 : gmp & mpfr - cross linux>mingw - if this is not done, gcc will not find gmp & mpfr as it needs mingw versions

./configure --prefix=/mingw/i686-pc-mingw32 --build=i686-pc-linux-gnu --host=i686-pc-mingw32 --disable-shared
make CFLAGS="-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
(can't check from a linux host)
make install && make distclean


** step 7 : gcc cross linux>mingw

../configure --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw -v --enable-threads --disable-nls --disable-shared --without-included-gettext --with-system-zlib --enable-libstdcxx-debug

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8)
make "CFLAGS=-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"
make install && rm -rf *


*** step 8 : gcc-mingw

steps 1-7 only need doing once

(if paths not set)
PATH=/mingw/bin:/my-toolchain/bin:$PATH

(make sure all include & libs are in /mingw/i686-pc-mingw32)
../configure --enable-languages=c,c++ --prefix=/mingw --build=i686-pc-linux-gnu --host=i686-pc-mingw32 -v --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x

(can use -march=k8 in cflags)
make CFLAGS="-O2" CXXFLAGS="${CFLAGS}" "LDFLAGS=-s"

// final output for windows

**** pick one

make DESTDIR=/home/user/cc-mingw32-gcc-build-i686 install && rm -rf *



this is what have used to cross-build gcc 4.3
first build a temporary toolchain (binutils and gcc - i used gcc-4.0.4 - so not to mess-up a linux system)
then build its libs, then build a cross-toolchain - (gcc-4.0.4 & binutils) and its libs

then can cross-compile gcc-4.3

will post a better - when i know for sure its working as it should

cc979
13th March 2007, 04:07
gcc-4.0.4 md5: 8B84B4BF70AE479D3C6D82DF3F91CF58
http://www.mytempdir.com/1252231

gcc-4.1.2 md5: 9FC5307E89E73DF9CED84365EE1A9110
http://www.mytempdir.com/1252235

morph166955
16th March 2007, 23:48
ok so little delayed on my reply to this but heres what my problem has been. the cross compiles havent worked completely. im getting weird errors when using the gcc 4.3 builds that im not getting when I use a native build of gcc 4.1.2. weird errors that I shouldnt get. ive done i dont know how many different builds with different steps and different versions but nothing seems to be working nicely. just thought I'd give everyone an update while I was working on it.

I'm also going to note that another reason I'm now doing this is so that I can hopefully get my new dual E5320 quadcore xeon setup to be running as fast and as optimized as possible (im shooting for real time encoding speeds on x264, or close to it) after it all arrives and i build it. every benchmark ive seen of comparable chips plus some math to equate it to two chips instead of one say I should be able to get close depending on my settings. so we shall see. as far as i know no one else is running anything close (at least on the consumer side) to an 8 core setup so who knows!

clsid
17th March 2007, 00:11
GCC 4.3 is still in its early development phase. You are better off using 4.1.2 or even 4.0.4.

cc979
17th March 2007, 01:48
GCC 4.3 is still in its early development phase. You are better off using 4.1.2 or even 4.0.4.

i would go with 4.0.4 as some patches were not include in the official release ... thunk alias bug

gcc 4.3 is upto stage1 .. so not be to long

cc979
17th March 2007, 01:54
ok so little delayed on my reply to this but heres what my problem has been. the cross compiles havent worked completely. im getting weird errors when using the gcc 4.3 builds that im not getting when I use a native build of gcc 4.1.2. weird errors that I shouldnt get. ive done i dont know how many different builds with different steps and different versions but nothing seems to be working nicely. just thought I'd give everyone an update while I was working on it.

I'm also going to note that another reason I'm now doing this is so that I can hopefully get my new dual E5320 quadcore xeon setup to be running as fast and as optimized as possible (im shooting for real time encoding speeds on x264, or close to it) after it all arrives and i build it. every benchmark ive seen of comparable chips plus some math to equate it to two chips instead of one say I should be able to get close depending on my settings. so we shall see. as far as i know no one else is running anything close (at least on the consumer side) to an 8 core setup so who knows!

i was getting no cross builds done with 4.3 and 4.2 started giving errors was i'll just wait a while, and keep looking into the svn logs

morph166955
17th March 2007, 04:05
well just for randomness i once again tried to natively build 4.3 and it works (sorta). im still getting the same issue on mencoder with the assembly code but i have successfully compiled x264 with core2/ssse3 extensions including the new stuff they put in one of the most recent revisions with no problems. im attempting to compile ffmpeg now to see if that works so i know if its an ffmpeg bug or a mplayer bug (even thoguh they still point their fingers at gcc being the buggy compiler)

cc979
17th March 2007, 04:49
well just for randomness i once again tried to natively build 4.3 and it works (sorta). im still getting the same issue on mencoder with the assembly code but i have successfully compiled x264 with core2/ssse3 extensions including the new stuff they put in one of the most recent revisions with no problems. im attempting to compile ffmpeg now to see if that works so i know if its an ffmpeg bug or a mplayer bug (even thoguh they still point their fingers at gcc being the buggy compiler)

native as in mingw or bsd?

have you tried to cross-compile x264 or mencoder?

_xxl
17th March 2007, 07:10
Is GCC 4.3 OpenMP ready?

cc979
17th March 2007, 07:33
Is GCC 4.3 OpenMP ready?

the latest build is not cross compiling for but it did for morph using his bsd box

i could try doing it in mingw to see what happens

cc979
21st March 2007, 08:52
latest pre-release of gcc-4.2, for anyone who wants it
'thunk alias' error still happens with the baseclasses in ffdshow

http://www.mytempdir.com/1263206

let me know, how it goes for you

Lemonzest
21st March 2007, 18:11
thanks cc979 i use your gcc with mingw to build a few project's and it works great :)

morph166955
21st March 2007, 20:06
well i definitely have gcc 4.3 compiling in mingw locally with out any problems. If people want (and assuming that this doesnt break the GPL or anything like that), i can make a package with all my libs/bins that they can load onto a fresh mingw/msys setup to make it gcc 4.3 compile capable since i know how much of a pain in the butt it was to get my system to work to do it (and to find some of the libraries online that work properly!)

@cc979
When you create your packages, what are you including in them? do a make DESTDIR install to somewhere and then copy the include directory over or something of that nature? I'll package up a 4.3 version thats prescott optimized later on if people want...possibly a core2 version if that helps anyone out.

foxyshadis
22nd March 2007, 03:39
That would be awesome. I want to give lavc a shot with 4.3 - having to use 4.0 or msvc for the rest of ffdshow isn't much of a burden.

cc979
22nd March 2007, 06:04
@morph166955

yes i do, make DESTDIR=/home/user/test-build install

then zip that folder

cc979
24th March 2007, 14:49
been trying to get libgomp (open mp) gcc-4.2/4.3 to compile with mingw...no much luck as it needs pthreads

no problem in linux

morph166955
24th March 2007, 15:26
so load pthreads? its like 3 header files (pthread.h, sempahore.h, sched.h i think) you have to copy and a dll (pthreadGC2.dll).

cc979
24th March 2007, 16:09
i have tried already with pthreads-win32, it needs pthreads as in the linux version

morph166955
24th March 2007, 16:47
interesting...where can i get my hands on the copy of that with the same version your using so i can test it here?

also...im doing a new compile of gcc 4.3 today with c,c++,java,fortran,objc so assuming that works ill upload that plus ill run a diff between my copy and a "base" install of mingw/msys and pull out the libraries and stuff that i have on my box for everyone to use

cc979
24th March 2007, 16:55
the libgomp is include in gcc-4.2 & 4.3 - gcc-4_2-branch\libgomp

with pthreads-win32 it does not find the libs or .a - it does compile ok in linux tho

i've also tried to compiling me own from
http://www.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/

it compiles with make, and shows which version you can compile

let me know how you get on, cheers

morph166955
25th March 2007, 23:01
im doing a final run on gcc 4.3 now to make sure that it compiles successfully and all that. once I do, ill use windiff to create a folder filled of any files that differ from a base install of mingw/msys (with out ANY alteration) and then remove the useless files and zip em all up for you all to enjoy. I'll probably make a version with and a version with out gcc4.3 as well as a standalone of gcc 4.3 (so 3 packages in total) in case any of you dont want some specific things. I HIGHLY recommend going through the files that I upload to make sure you don't have your own compiles of some of them in there, I wouldn't want you to screwup your setups using my files.

morph166955
26th March 2007, 01:15
ok i got c, c++ and java (although I dont have libjava added in that yet just gcj) to compile thus far with out any issues. I'm doing a run now with libgomp enabled to see what that does. If that works, im going to do another few runs with different things. below are the things that as of the last run i'm not building (or so says configure). ignore libgomp from that cause its running now. If anyone wants any of those other then libgomp, libjava, libobjc and libgfortran or any languages other then c, c++, java, fortran, objc speak now or hold your peace until i do another build soon.

*** This configuration is not supported in the following subdirectories:
target-libmudflap target-libgomp target-libffi target-zlib target-libjava target-libada gnattools target-libgfortran target-libobjc target-boehm-gc

morph166955
26th March 2007, 02:41
steps to fix pthread for libgomp:


cd /mingw/lib
cp libpthreadGC2.a libpthread.a
ranlib libpthread.a


that makes -lpthread work and in turn makes libgomp work.

cc979
26th March 2007, 10:01
steps to fix pthread for libgomp:


cd /mingw/lib
cp libpthreadGC2.a libpthread.a
ranlib libpthread.a


that makes -lpthread work and in turn makes libgomp work.

cheers, i will try a cross-compile using that

morph166955
26th March 2007, 16:28
sounds good. I also copied pthreadGC2.dll to pthread.dll but I dont think that mattered. I've got my stuff all working except libgcj which has an issue thats apartatly a known bug so im just not going to compile it for now.

im installing my gcc build from last night into my main tree and im running a diff now on that vs a clean install of mingw and creating a folder that has all the stuff thats different. with all hope ill post up my builds later on today.

morph166955
26th March 2007, 18:46
ok these files wont be up too long but they will stay up probably at least for the next 2-3 weeks depending on how many people start to download them and how bad of a hit on my monthly bandwidth cap that I take.

EDIT: URL Removed - Files removed from server

Files:
gcc-4.3-r123209...7z - gcc 4.3, natively built in mingw, compiled with c,c++,java,fortran,objc & libgomp,libobjc,libgfortran

MINGW-DIFF-WITHGCC.7z - a full diff between my current mingw tree and a base/vanilla install of mingw INCLUDING the gcc from above


MINGW-DIFF-NOGCC.7z - a full diff between my current mingw tree and a base/vanilla install of mingw EXCLUDING the gcc from above.

I'm not sure of all of the gpl licencing or any thing like that with some of these libs and i just noticed I have an older build x264 in there also it seems so use these libs/bins at your own risk and appologies to anyone if i did break a gpl licence, it wasn't intentional. I compiled the gcc from an svn that I grabbed at about 2am last night (march 26th). If anyone wants anything else let me know. I'm going to try to get libgcj working and if I can ill upload a new file set with those in it.

morph166955
26th March 2007, 19:52
so im still getting issues compiling mplayer/mencoder/ffmpeg with the -march/-mtune being set to core2. the error i get is:

http://www.benswebs.com/libavcodec-error.jpg

it works fine when mplayer is set to compile as prescott. anyone got an idea as to why this is happening and/or what gnu changed in gcc in terms of asm for core2 that could cause this? ive googled and come up dry but im still looking.

cc979
26th March 2007, 20:20
so im still getting issues compiling mplayer/mencoder/ffmpeg with the -march/-mtune being set to core2. the error i get is:

http://www.benswebs.com/libavcodec-error.jpg

it works fine when mplayer is set to compile as prescott. anyone got an idea as to why this is happening and/or what gnu changed in gcc in terms of asm for core2 that could cause this? ive googled and come up dry but im still looking.

which binutils you using ?

morph166955
26th March 2007, 20:33
binutils is @ 2.17.

cc979
26th March 2007, 21:34
cd /mingw/lib
cp libpthreadGC2.a libpthread.a
ranlib libpthread.a

just tried in mingw with gcc-4.2 and on the configure it crash conftest.exe - i take it, it did'nt do that for you

morph166955
26th March 2007, 21:48
nope. libgomp compiled fine for me. the only other thing to try is to copy libpthreadGC2.dll to libpthread.dll and then run ranlib again on the .a file see if that does it. if not, go into the config.log for that (i wanna say its in i686-pc-mingw/libgomp in your build directory or something like that) and see whats the errors are.

morph166955
26th March 2007, 23:02
ok figured it out, its ffmpeg being stuborn. im not 100% sure what the reason is but im pretty sure it has to do with the way they wrote the transpose4x4() function in dsputil_mmx.c and how it handles the registers. theres something different with the way that the core2's registers work as opposed to the other processors to date. anyone willing to take a stab at it? its ~line 636 in libavcodec/i386/dsputil_mmx.c

cc979
27th March 2007, 14:00
i got libgomp(gcc 4.2 version) on its own cross-compiled but does not compile if i compile gcc - will try gcc 4.3 later (linux native gcc compile does include libgomp tho)

ps. under linux pthreads-win32 is not recognized if it is processed with ranlib, just renaming 'libpthreadGC2.a' to 'libpthread.a' works

morph166955
27th March 2007, 18:56
cool, glad you got pthreads to work for that. whats your configure line look like thats failing and what are you using for make (as in any options or w/e you are putting after it)?

cc979
27th March 2007, 21:33
for gomp i use
../libgomp/configure --program-suffix=-4.2 --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --prefix=/mingw --enable-optimize --enable-threads=win32 --disable-nls --disable-win32-registry --enable-static --without-x

for gcc
../configure --program-suffix=-4.2 --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw --enable-optimize --enable-threads=win32 --disable-nls --disable-win32-registry --enable-static --without-x

and
make LDFLAGS="-s"

on both

morph166955
28th March 2007, 00:31
just out of curiosity, why don't you try 4.2 or 4.3 natively in mingw to build libgomp either way? also could you possibly post up the results of running configure with both of those lines shows for you (specifically from the start up to and including where it says the libraries that wont work properly with that config, i think it checks bison and flex after that).

Kurosu
1st April 2007, 00:55
'thunk alias' error still happens with the baseclasses in ffdshow

See this gcc bug report:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067

Patch worked fine on the 20060715 gcc 4.2 snapshot, but probably can't be merged properly now.

cc979
1st April 2007, 14:01
See this gcc bug report:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067

Patch worked fine on the 20060715 gcc 4.2 snapshot, but probably can't be merged properly now.

latest time tried i patching gcc-4.2-rev121020 it was fine, but i failed to get it to worked with later revisions, maybe it will get intergrated into the trunk

i patched gcc-4.1.2 http://forum.doom9.org/showthread.php?p=953608#post953608

cheers

cc979
1st April 2007, 14:04
i just uploaded a cross-compiled gcc-4.3 for anyone who wants try it

http://www.mytempdir.com/1278497

libgomp/pthreads/gmp/mpfr are included

cheers

cc979
6th April 2007, 01:12
just read on mingw news:
Snapshot: mingw-w64-headers-20070405-1.tar.bz2 2007-04-05 00:33
Header set for x86_64-pc-mingw32 support. This is a header set tested only for x86_64 version, but it includes also the definitions for x86 and ia64, too. It was used to build and verify the patch to gcc 4.3 (trunk) and may also it has some use to mingw.
http://www.mingw.org/news.shtml

_xxl
12th May 2007, 06:33
Can you please upload all mingw builds to rapidshare?
mytempdir doesn't work.

cc979
12th May 2007, 18:06
Can you please upload all mingw builds to rapidshare?
mytempdir doesn't work.

i don't keep them, i delete them once uploaded

will be building prerelease-4.2.0-20070501 soon

Lemonzest
17th May 2007, 13:51
any word on a build of 4.2.0 final? it was released today :) thanks

morph166955
17th May 2007, 18:14
I just heard about it a few mins ago. I'm going to play around with it later today (in linux though till i get my footing all with it). I don't have my mingw setup on this box so I can't make a build for everyone to use. cc979 might but I don't know what his plans are.

dancho
18th May 2007, 09:21
just in case that someone maybe need it:

unofficial MinGW 4.3.0 gcc and g++ PATCHED against 27067 bug ( big thx to 20-40 )

http://forums.codeblocks.org/index.php/topic,5870.0.html

cc979
18th May 2007, 14:27
been little busy will build gcc 4.2.0 now, that is if ubuntu works had trouble with nvidia driver latest ubuntu

morph166955
18th May 2007, 18:01
cc979...are you doing your gcc builds strictly cross-compile now or are you doing them native in mingw/msys?

I'm may do a 4.2 native compile today myself, if not ill do it some time next week if I have time among compiling my own linux distro (see the linux section for my post that has more info).

cc979
18th May 2007, 19:52
just finished a linux-cross-compiled version of gcc-4.2 - which i will do for all gcc builds, i stopped doing windows native builds a while back

i just need to upload it now, will be later - after a few tests

cheers

ps. just tested gcc-4.2.0 with latest svn of ffdshow-tryout - looks like the thunk alias patch did not make into the final release

cc979
19th May 2007, 00:17
release mingw32-gcc-4.2.0-build-i686.7z
md5: 60C67B6E0FDE83C682913418F7496C9A

http://www.mytempdir.com/1332104
http://www.speedyshare.com/411490356.html

clsid
20th May 2007, 13:05
Thanks!

Edit: Did you forgot to strip the binaries? They seem rather big compared to the older versions.

cc979
20th May 2007, 19:57
Thanks!

Edit: Did you forgot to strip the binaries? They seem rather big compared to the older versions.

no should be stripped, there are larger than 4.12 irc

_xxl
27th May 2007, 12:00
Intel® C++ Compiler for Linux
icc/gcc Compatibility

It is possible to cross-compile libavcodec with icc9?

cc979
27th May 2007, 14:36
It is possible to cross-compile libavcodec with icc9?

no idea,
the cross-compile - you need to have/make compiler the runs on linux that creates code for windows unless that icl9 thing does have an already cross-compiled compiler its unlikely - but maybe someone who knows more about icl9 on linux would tell you

cheers

clsid
25th July 2007, 16:08
Could you make a GCC 4.2.1 mingw build? It was released last week. Thanks.

Romario
25th July 2007, 22:20
What about new ICL 10, why somebody don't compile FFDSHOW with that version?

cc979
27th July 2007, 17:31
What about new ICL 10, why somebody don't compile FFDSHOW with that version?

looks like posted in wrong thread

cc979
27th July 2007, 17:32
Could you make a GCC 4.2.1 mingw build? It was released last week. Thanks.

i will asap, been a little busy lately

cc979
28th July 2007, 20:29
i've just compiled this: mingw32-gcc-4.2.1

md5: 77658C321A7F05EEF6E0D752FC0ECA26

http://www.speedyshare.com/610947847.html

_xxl
28th July 2007, 20:38
i've just compiled this: mingw32-gcc-4.2.1
Thanks!

ffmpeg
29th July 2007, 02:29
Hi, cc979 .I fail to download the file from the following address
http://www.speedyshare.com/610947847.html

cc979
29th July 2007, 06:28
cc-mingw32-gcc-4.2.1-build-i686.tar.bz2
md5: 77658C321A7F05EEF6E0D752FC0ECA26

http://www.mytempdir.com/1375468

_xxl
29th July 2007, 07:31
cc-mingw32-gcc-4.2.1-build-i686
binutils-2.17.50-20070129-1
mingw-runtime-3.11
w32api-3.8
pthreads and yasm
download (http://rapidshare.com/files/45687331/gcc.rar.html)

clsid
29th July 2007, 13:22
There are newer versions: runtime 3.12 and w32api 3.9

cc979
29th July 2007, 16:46
3.12 runtime headers was buggy, last time i used it

cweb
10th August 2007, 14:14
anyone tried 3.13 runtime?
w32api-3.10 is out too..

DeathTheSheep
28th August 2007, 20:22
Would anyone know where to get a cygwin GCC-4.3 binary? I would think this is the place to ask.

cc979
29th August 2007, 14:47
Would anyone know where to get a cygwin GCC-4.3 binary? I would think this is the place to ask.

probably need to compile one, i would try but i dont use cygwin

cc979
2nd September 2007, 19:32
out of curiosity how many would want a mingw64 build of gcc & binutils ?

clsid
2nd September 2007, 20:10
That would be very useful for compiling libavcodec. That would give a big performance boost for ffdshow 64-bit, which is currently much slower than the regular 32-bit version.

But is there already a 64-bit version of the mingw environment?

cc979
3rd September 2007, 14:11
i will look into it further

MatMaul
21st October 2007, 16:52
can we have a 4.2.2 build please :p

cweb
21st October 2007, 17:02
can we have a 4.2.2 build please :p
How reliable are these 4.2.x builds? Are they able to compile all the stuff you can throw at them or are there some problems/bugs etc...?

cc979
21st October 2007, 17:45
i shall build it soon

cc979
22nd October 2007, 09:19
new build of a cross compiled gcc

cc-mingw32-gcc-4.2.2-build-i686.7z
md5: EBD343B4C42845E725A9AA7393FBE6A0

http://www.speedyshare.com/119683991.html

MatMaul
23rd October 2007, 18:57
thanks :)

clsid
23rd October 2007, 19:05
Same here. :thanks:

clsid
28th October 2007, 12:01
Can you make a fresh build of GCC 3.4.6? Thanks.

cc979
28th October 2007, 23:12
old one, any reason ?

will do i get time - soon

Inventive Software
29th October 2007, 00:48
If you have a fresh MinGW, you can compile 3.4.6 yourself. I have done it before....

clsid
29th October 2007, 11:17
I don't have msys installed. So that won't work.

I want 3.4.6 because I want to test the performance of the code that it generates compared to 4.2.2.

cc979
29th October 2007, 19:47
cross compiled gcc-3.4.6
md5: 596F1B7ED81D35AB3DE2D464A742F116

http://www.speedyshare.com/324965439.html

clsid
29th October 2007, 21:50
Thanks.

haruhiko_yamagata
27th December 2007, 12:02
I can't compile ffdshow.ax using MinGW-GCC 4.2.2.

I created a small sample to reproduce the error.

struct Ifoo
{
virtual void __stdcall stdcallfunc(void)=0;
};

struct foo
{
virtual void cdeclfunc(void);
};

void foo::cdeclfunc(void){}

struct fooImp: public foo, public Ifoo
{
virtual void stdcallfunc(void) __attribute__((stdcall));
virtual void cdeclfunc(void){};
};

void fooImp::stdcallfunc(void){}



gcc -S foo.cpp
foo.cpp:18: error: 'void *LTHUNK0()' aliased to undefined symbol '_ZN6fooImp11stdcallfuncEv'


Is this a bug of GCC or MinGW?
If we can confirm that this is a bug, I'll write a report.

My guess is it's a bug in stdcall compiling.
I think '_ZN6fooImp11stdcallfuncEv' should be '_ZN6fooImp11stdcallfuncEv@4'.

cc979
28th December 2007, 07:13
it a bug of gcc 4.2+ there was a fix, but it seems it did not make it into the svn

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27636

haruhiko_yamagata
28th December 2007, 13:20
it a bug of gcc 4.2+ there was a fix, but it seems it did not make it into the svn

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27636
Thank you for reply. It seems to have been committed in the trunk after creating 4.2 branch as rev 125020 (http://gcc.gnu.org/viewcvs?view=rev&revision=125020).
I expect GCC 4.3 will be able to compile ffdshow.ax again.

cc979
30th December 2007, 08:51
i've made a test build of:
gcc version 4.2.3 20071226 (prerelease)

it seems it does not have the patch http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067

i'll try adding it later

haruhiko_yamagata
30th December 2007, 09:25
i'll try adding it later
Wow, great! :thanks:

cc979
30th December 2007, 10:48
cc-mingw32-gcc-4.2.1-build-i686-patched-prefix.7z
md5: EC9E51274F02589F8F331DEDD598647B
http://www.speedyshare.com/538350586.html

i've just compiled gcc-4.2.1 with sjlj, from the patched sources from the mingw site

it does compile ffdshow-tryout with:
make CC=gcc-4.2

but it errors on opening after install, ffdshow.ax configure error
i've had this error before not sure how i fixed it before, i think it was a .ini file edit that fixed it before

cheers

haruhiko_yamagata
31st December 2007, 05:08
i've just compiled gcc-4.2.1 with sjlj, from the patched sources from the mingw siteThank you very much. No compilation errors :D.
The crash on dialog opening is same for me, but it plays video and audio.

LoRd_MuldeR
31st December 2007, 14:28
Are you expecting any performance gain by compiling ffdshow.ax with GCC instead of MSVC71/ICL10 compilers?

haruhiko_yamagata
31st December 2007, 15:04
Are you expecting any performance gain by compiling ffdshow.ax with GCC instead of MSVC71/ICL10 compilers?Nope, I just like GCC. I was interested in why ffdshow could not be compiled by GCC 4.2.
This topic should belong to ffdshow thread btw.

LoRd_MuldeR
31st December 2007, 16:40
Nope, I just like GCC. I was interested in why ffdshow could not be compiled by GCC 4.2.
This topic should belong to ffdshow thread btw.
At least it would be an improvement not to depend on proprietary compiler software...

Kurosu
2nd January 2008, 15:27
Almost official MinGW 4.2.1 version works:
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=241304&release_id=532062

There are a number of missing defines though.

cc979
3rd January 2008, 09:16
Almost official MinGW 4.2.1 version works:
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=241304&release_id=532062

There are a number of missing defines though.

true, but i tried the official mingw-4.2.1 and it failed compiling ffdshow-tryout, it may have been the way it was compiled

Yong
3rd January 2008, 12:25
official mingw gcc 4.2.1sjlj work for me too, but same, ffdshow.ax crash when open the a/v decoder configurations :p

hmm i think i found out why the ffdshow.ax crash, the OPTSFLAGS on makefile.inc or makefile_c.inc lacks of -fno-strict-aliasing or -ffast-math,
which cause ffdshow.ax crash during open a/v configuration.
ive tried compiling ffdshow again with -fno-strict-aliasing and -ffast-math, now no more error with configuration dialogs :D :D :D

LoRd_MuldeR
3rd January 2008, 22:32
official mingw gcc 4.2.1sjlj work for me too, but same, ffdshow.ax crash when open the a/v decoder configurations :p

hmm i think i found out why the ffdshow.ax crash, the OPTSFLAGS on makefile.inc or makefile_c.inc lacks of -fno-strict-aliasing or -ffast-math,
which cause ffdshow.ax crash during open a/v configuration.
ive tried compiling ffdshow again with -fno-strict-aliasing and -ffast-math, now no more error with configuration dialogs :D :D :D

Yong, is your build available for testing somewhere?

_xxl
3rd January 2008, 23:33
Aren't SSE2 builds broken because MinGW32 GCC can't align stack variables? GCC 4.2.0 uses "__attribute__((force_align_arg_pointer))" to fix this issue.This attribute is used only in libavcodec.

Yong
4th January 2008, 12:08
Yong, is your build available for testing somewhere?
here u go:
http://y0ngc6.googlepages.com/ffdshow_rev1743_2008104-GCC4.21-sjlj.exe
GCC compiled ffdshow missing manifest file, which make the configuration dialogs look like old windows 2000 apps lol :p
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="ffdshow.ax" type="win32" />
<description>WindowsExecutable</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
save the code above to "ffdshow.ax.manifest" and move it to ffdshow folder ;)

gcc compilied ffdshow is slow when playback 1080p of h264 video, compare to msvc 2008 build...

msvc 2008 build: http://y0ngc6.googlepages.com/ffdshow_rev1748_2008104-msvc2008.exe
and the runtime dll: http://y0ngc6.googlepages.com/Microsoft.VC90.CRT.exe

LoRd_MuldeR
5th January 2008, 21:00
here u go:
http://y0ngc6.googlepages.com/ffdshow_rev1743_2008104-GCC4.21-sjlj.exe
GCC compiled ffdshow missing manifest file, which make the configuration dialogs look like old windows 2000 apps lol :p

Thanks, seems to work here :)

And yes, "XP Styles" are turned off in that build :p

gcc compilied ffdshow is slow when playback 1080p of h264 video, compare to msvc 2008 build...

Why is that? Shouldn't the H.264 decoder, which is located in libavcodec.dll and compiled with GCC anyway, be the bottleneck? At least as long as no additional filters are turned on in ffdshow...

Yong
6th January 2008, 15:55
dont know, probably is ffdshow.ax problem,
msvc2008 version of libavcodec.dll and libmplayer.dll were compiled by gcc4 anyway.

iirc gcc 4.0.3 can compile ffdshow with sse2 enabled, while 4.21 will have error when compiling imagefilters, but im not sure if its does matter :p

_xxl
6th January 2008, 16:01
MinGW GCC SSE2 versions are broken.

cc979
6th January 2008, 17:18
dont know, probably is ffdshow.ax problem,
msvc2008 version of libavcodec.dll and libmplayer.dll were compiled by gcc4 anyway.

iirc gcc 4.0.3 can compile ffdshow with sse2 enabled, while 4.21 will have error when compiling imagefilters, but im not sure if its does matter :p

what error do you get - is it the 'alias thunk' error ?

Yong
6th January 2008, 18:45
what error do you get - is it the 'alias thunk' error ?
http://xs223.xs.to/xs223/08010/errrrrror.jpg
compiling are fine as long as dont enable SSE2.:p

btw when i use the gcc4.21 compiled by you, i will get "Cant find CreateProcess" error:confused:
same as gcc 4.2.2 i got from here: http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248633
compiled by sherpya.

Yong
6th January 2008, 18:50
MinGW GCC SSE2 versions are broken.
yes i alread know that:p
i was just trying to compiled one and see wether if the sse2 bugs already fixed on new version of gcc. ;)

Kurosu
6th January 2008, 19:46
There is a patch proposed (beware of infinite loops when reading it though ;) here (http://sourceforge.net/tracker/index.php?func=detail&aid=1862226&group_id=173941&atid=867362)

As for the SSE2 stuff, past this, indeed it crashes when activating most video filters. Strange enough, I think the original ffdshow code didn't have this problem, so there might be some regression.

_xxl
6th January 2008, 20:08
Also, if you look at the cpu detection code you''ll see that (S)SSE3 part is not compiled by GCC because it crashed.

cc979
7th January 2008, 12:34
C99 status in gcc-4.2
http://gcc.gnu.org/gcc-4.2/c99status.html

cc979
6th February 2008, 03:47
Just cross-compiled the new gcc-4.2.3

cc-mingw32-gcc-4.2.3-dw2-build-i686-prefix.7z
http://www.speedyshare.com/893618517.html

MD5: CA1DD054CE74AB21E0C1A3515755AED3

cc979
6th February 2008, 03:50
after a test compile on ffdshow-tryout i get some new errors, not sure if the 'thunk alias' patch made it into the release

make[1]: Entering directory `/home/User/svn/ffdshow-tryout/ffdshow-tryout/src/baseclasses'
gcc-4.2 -c -DRELEASE -mno-cygwin -mdll -fno-rtti -mthreads -pipe -D_WINGDI_ -DUCLIBCPP -D_GLIBCPP_HAVE_MBSTATE_T -D_WIN32_IE=0x0500 -DARCH_IS_IA32 -DARCH_IS_32BIT -DHAVE_MMX -mmmx -w -DNDEBUG -UDEBUG -DFFDEBUG=0 -I. -I.. -Iuclibc++ -Ibaseclasses -I../baseclasses -IimgFilters -I../imgFilters -Implayer -I../mplayer -Isettings -I../settings -Isettings/filters -I../settings/filters -Icodecs -I../codecs -Isubtitles -I../subtitles -Iconvert -I../convert -Idialog -I../dialog -IaudioFilters -I../audioFilters -Icygwin -I../cygwin -Iffmpeg -I../ffmpeg -Iacm -I../acm -Ifilters -I../filters -Imuxers -I../muxers -I/dx/Include -L/dx/MingLib -ldx9 -O2 -march=pentium-mmx -mtune=i686 -fomit-frame-pointer -finline-functions -finline -frename-registers -fweb -funit-at-a-time -MMD -o baseclasses_all.o baseclasses_all.cpp
In file included from baseclasses_all.cpp:12:
amfilter.cpp: In member function 'virtual long int CBaseFilter::Pause()':
amfilter.cpp:553: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
{standard input}: Assembler messages:
{standard input}:3052: Warning: end of file not at end of a line; newline inserted
{standard input}:3983: Warning: missing operand; zero assumed
{standard input}:3981: Error: undefined symbol `LLSDACSE1540' in operation
make[1]: *** [baseclasses_all.o] Error 1
make[1]: Leaving directory `/home/User/svn/ffdshow-tryout/ffdshow-tryout/src/baseclasses'
make: *** [lib] Error 2


any ideas anyone, is it a broken cross-compile or something else ??

cheers

Inventive Software
6th February 2008, 04:00
How the hell did ya cross-compile GCC? Last time I tried it was a couple years ago when I had a working Linux rig, and I couldn't figure it out at all. :D

clsid
6th February 2008, 11:53
An "internal compiler error" is a good indication for a compiler bug.

Are you able to compile libavcodec with this GCC build?

cc979
6th February 2008, 14:17
How the hell did ya cross-compile GCC? Last time I tried it was a couple years ago when I had a working Linux rig, and I couldn't figure it out at all. :D

see the notes at the top of the thread, a 3 stage build - gcc/binutils for linux & gcc/binutils for linux-mingw, then the a final gcc for mingw (the cross compile part)

cc979
6th February 2008, 14:18
An "internal compiler error" is a good indication for a compiler bug.

Are you able to compile libavcodec with this GCC build?

it does compile libavcoded, but i think it maybe a problem with dwarf2

i have re-built it with sjlj

cc979
6th February 2008, 14:22
cc-mingw32-gcc-4.2.3-sjlj-suffix-build-i686.7z
http://www.speedyshare.com/962870145.html

MD5: 6AEAEDC8347BD65026DD4239AF152655

indeed the 'thunk alias' bug is still present, seems some debate with gcc folk about the patch

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067#c9

cweb
17th February 2008, 13:12
I compiled some programs with your build, successfully.

I tried this C++ program of mine but I got these errors:
gagenes_c.o:gagenes_c.cc:(.text+0x2cf): undefined reference to `_Unwind_SjLj_Register'
gagenes_c.o:gagenes_c.cc:(.text+0x33b): undefined reference to `_Unwind_SjLj_Unregister'
gagenes_c.o:gagenes_c.cc:(.text+0x379): undefined reference to `_Unwind_SjLj_Resume'
gagenes_c.o:gagenes_c.cc:(.text+0x3bf): undefined reference to `_Unwind_SjLj_Register'
gagenes_c.o:gagenes_c.cc:(.text+0x420): undefined reference to `_Unwind_SjLj_Unregister'
gagenes_c.o:gagenes_c.cc:(.text+0x45e): undefined reference to `_Unwind_SjLj_Resume'
gagenes_c.o:gagenes_c.cc:(.text+0x4a3): undefined reference to `_Unwind_SjLj_Register'
gagenes_c.o:gagenes_c.cc:(.text+0x5d2): undefined reference to `_Unwind_SjLj_Unregister'
gagenes_c.o:gagenes_c.cc:(.text+0x628): undefined reference to `_Unwind_SjLj_Resume'


I think it's pthread which it isn't linking in for some reason..
any ideas on whether it's the build which has a bug or is it something else completely?

I tried adding -lpthread like some posts suggested but got this:
/linux/my-gcc/gcc/gcc-4.2.3/build/i686-pc-mingw32/libstdc++-v3/libsupc++/../../../../libstdc++-v3/libsupc++/eh_throw.cc:97: undefined reference to `_Unwind_SjLj_Resume_or_Rethrow'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(eh_throw.o):/home/user/linux/my-gcc/gcc/gcc-4.2.3/build/i686-pc-mingw32/libstdc++-v3/libsupc++/../../../../libstdc++-v3/libsupc++/eh_throw.cc:69: undefined reference to `_Unwind_SjLj_RaiseException'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(eh_terminate.o):eh_terminate.cc:(.data+0x12): undefined reference to `__gxx_personality_v0'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(eh_call.o):eh_call.cc:(.data+0x11): undefined reference to `__gxx_personality_v0'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(eh_globals.o):eh_globals.cc:(.data+0x12): undefined reference to `__gxx_personality_v0'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(eh_alloc.o):eh_alloc.cc:(.data+0x12): undefined reference to `__gxx_personality_v0'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(codecvt.o):codecvt.cc:(.data+0x12): undefined reference to `__gxx_personality_v0'
l:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.3/libstdc++.a(iostream-inst.o):iostream-inst.cc:(.data+0x12): more undefined references to `__gxx_personality_v0' follow
collect2: ld returned 1 exit status

cc979
18th February 2008, 05:43
i had problems with pthread before, but was fixed using on of the other dlls renamed - libpthread.a md5: 042149C609287034009DB55A73046107

it may need some other files to

pthread.h, sched.h, semaphore.h these should be in your include directory

but `_Unwind_SjLj_RaiseException' part not sure if any file missing, my build needs further checking i think

cweb
18th February 2008, 08:14
i had problems with pthread before, but was fixed using on of the other dlls renamed - libpthread.a md5: 042149C609287034009DB55A73046107

it may need some other files to

pthread.h, sched.h, semaphore.h these should be in your include directory

but `_Unwind_SjLj_RaiseException' part not sure if any file missing, my build needs further checking i think
hmm.. they aren't there...

cc979
19th February 2008, 11:20
the pthread i use is here

http://www.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/dll-latest/

hellfred
1st March 2008, 13:04
Someone reported, how he sucessfully build gcc 4.2.3 on the gcc-devel mailing list (http://thread.gmane.org/gmane.comp.gcc.devel/96481).

SledgeHammer_999
2nd March 2008, 15:55
I'm having huge problem with MSYS. Well I'm trying to compile wxWidgets(and other things) but the problem appears right at the start when I hit "./configure". Here:
./configure
0 [main] sh 7468 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump
./configure: line 52: 7468 Segmentation fault (core dumped) ( set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`" )
0 [main] sh 7832 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump
./configure: line 52: 7832 Segmentation fault (core dumped) ( set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`" )
0 [main] sh 7724 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump
./configure: line 52: 7724 Segmentation fault (core dumped) ( set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`" )
0 [main] sh 1324 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump


I've tried several times but only two times "./configure" worked. And I didn't change anything I just was giving again and again "./configure".

Do you know how I fix this?

Also cc979 can I cross-compile MingW using 64-bit linux(for 32bit windows) using your guide?

cc979
4th March 2008, 13:31
i do use a 64 bit linux to cross-compile, my needs a little updating tho

cc979
4th March 2008, 13:39
make build folder inside each src then ../configure like below

building whole toolchain - binutils,gcc & cross binutils,gcc

using bison,flex,libtool,texinfo(makeinfo) maybe needed automake,autogen,autoconf


*** step 0 : setup gcc linux (bypass step 3)

sudo mkdir -m 777 /my-toolchain

../configure --with-dwarf2 --disable-sjlj-exceptions --enable-__cxa_atexit --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --enable-languages=c,c++ --disable-nls --prefix=/my-toolchain

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8)
make LDFLAGS="-s" bootstrap

make DESTDIR=/home/user/mytools/linux-gcc-build install
make install && rm -rf *

PATH=/my-toolchain/bin:$PATH


*** step 1 : binutils linux

../configure --with-dwarf2 --disable-sjlj-exceptions --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --disable-nls --prefix=/my-toolchain

(can use -m32 -march='your-cpu' in cflags eg. -march=k8)
make LDFLAGS="-s"

make DESTDIR=/home/user/mytools/linux-binutils-build install
make install && rm -rf *


*** step 2 : gmp & mpfr linux

do this step in gmp & mpfr src folders

./configure --with-dwarf2 --disable-sjlj-exceptions --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --disable-shared --prefix=/my-toolchain

(can use -march='your-cpu' in cflags eg. -march=k8)
make

make check
make DESTDIR=/home/user/mytools/linux-libs install
make install && make distclean

repeat steps 1&2, if you like


*** step 3 : gcc linux (bypass step 3 if step 0 done)

PATH=/my-toolchain/bin:$PATH

../configure --with-dwarf2 --disable-sjlj-exceptions --enable-__cxa_atexit --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --enable-languages=c,c++ --disable-nls --prefix=/my-toolchain

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8)
make LDFLAGS="-s" bootstrap

make DESTDIR=/home/user/mytools/linux-gcc-build install
make install && rm -rf *


*** step 4 : binutils cross linux>mingw

sudo mkdir -m 777 /cc-mingw

../configure --with-dwarf2 --disable-sjlj-exceptions --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-mingw32 --disable-nls --prefix=/cc-mingw

make LDFLAGS="-s"

make DESTDIR=/home/user/mytools/linux-cross-binutils-build install
make install && rm -rf *


*** step 5 : setup mingw32 includes & libs

sudo mkdir -m 777 /mingw && mkdir /mingw/include

extract mingw-runtime & w32-api to below path :
/home/user/my-gcc/mingw-libs/headers/

extract pthreads-win32 (src: ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/dll-latest.tar)

copy & rename libpthreadGC2.a into libthread.a copy into /home/user/my-gcc/mingw-libs/headers/lib
copy pthread.h sched.h semaphore.h into /home/user/my-gcc/mingw-libs/headers/include

copy all includes & libs into /cc-mingw/i686-pc-mingw32


cp -r /home/user/linux/my-gcc/mingw-libs/headers/* /cc-mingw/i686-pc-mingw32


** step 6 : gcc cross linux>mingw

PATH=/cc-mingw/bin:$PATH

../configure --with-dwarf2 --disable-sjlj-exceptions --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --disable-nls --prefix=/cc-mingw

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8)
(you cant bootstrap a cross build)
make LDFLAGS="-s"

make DESTDIR=/home/user/mytools/linux-cross-gcc-build install
make install && rm -rf *


*** step 7 : gmp & mpfr - cross linux>mingw - if this is not done, gcc will not find gmp & mpfr as it needs mingw versions

./configure --with-dwarf2 --disable-sjlj-exceptions --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --disable-shared --prefix=/cc-mingw/i686-pc-mingw32

make

(can't make check when crossing-compiling)
(make backup)
make DESTDIR=/home/user/cc-mingw32-libs install

make install && make distclean

*** step 7a : libgomp - cross linux>mingw (not sure if needed)

(cd gcc/build)
../libgomp/configure --with-dwarf2 --disable-sjlj-exceptions --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --prefix=/cc-mingw/i686-pc-mingw32 --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x

make LDFLAGS="-s"

make DESTDIR=/home/user/cc-mingw32-libs install

make install && rm -rf *

*** step 8 : gcc-mingw (for 32bit windows mingw)

steps 0-7 only need doing once

(if paths not set)

PATH=/my-toolchain/bin:$PATH
PATH=/cc-mingw/bin:$PATH

PATH=/cc-mingw/bin:/my-toolchain/bin:$PATH


(make sure all mingw include & libs are in /mingw/i686-pc-mingw32 ... for libgomp see step 7a)
../configure --with-dwarf2 --enable-libgomp --disable-sjlj-exceptions --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x

*** from Offical MinGW
../configure --with-gcc --enable-libgomp --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --program-suffix=-sjlj --with-arch=i686 --with-tune=generic --disable-werror --prefix=/mingw --with-local-prefix=/mingw --enable-threads=win32 --disable-nls --enable-languages=c,c++ --disable-win32-registry --enable-sjlj-exceptions --enable-libstdcxx-debug --enable-cxx-flags="-fno-function-sections -fno-data-sections" --enable-version-specific-runtime-libs

(binutils)
../configure --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --prefix=/mingw --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x

(libgomp)
../libgomp/configure --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x
../libgomp/configure --with-dwarf2 --disable-sjlj-exceptions --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --prefix=/mingw --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x


(can use -march='your cpu' in cflags eg. -march=k8)
make LDFLAGS="-s"

// final output for windows

**** pick one

(gcc)
make DESTDIR=/home/user/cc-mingw32-gcc-build install && rm -rf *

(binutils)
make DESTDIR=/home/user/cc-mingw32-binutils-build install && rm -rf *

***


3 types of compile

build
this is *always* the platform on which you are running the build
process; since we are building on Linux, this is unequivocally going to
specify `linux', with the canonical form being `i686-pc-linux-gnu'.

host
this is a tricky one: it specifies the platform on which whatever we
are building is going to be run; for the cross-compiler itself, that's
also `i686-pc-linux-gnu', but when we get to the stage of building the
runtime support libraries to go with that cross-compiler, they must
contain code which will run on the `i686-pc-mingw32' host, so the `host'
specification should change to this, for the `runtime' and `w32api'
stages of the build.

target
this is probably the one which causes the most confusion; it is only
relevant when building a cross-compiler, and it specifies where the code
which is built by that cross-compiler itself will ultimately run; it
should not need to be specified at all, for the `runtime' or `w32api',
since these are already targetted to `i686-pc-mingw32' by a correct
`host' specification.

ffmpeg
12th March 2008, 15:29
GCC 4.3 released

Could you compile it ?

clsid
12th March 2008, 16:39
You can find a 4.3 build here:
http://www.tdragon.net/recentgcc/

cc979
15th March 2008, 04:53
Just built GCC-4.3

http://www.speedyshare.com/600146473.html

ffmpeg
12th May 2008, 14:59
gcc 4.3 has bug on mingw

The latest version is gcc 4.3.1

Could you compile it again?

Thanks

cc979
13th May 2008, 19:55
Status

Current release series: GCC 4.3.0
Status: 2008-04-28 (regression fixes and docs only).

is gcc frontpage not up to update ?

_xxl
11th June 2008, 21:22
@ cc979
Is it posible to compile MinGW GCC 4.2.4 and 4.4.0 for win32 please?

cc979
13th June 2008, 17:40
gcc 4.2.4 yes but 4.4.0 still not official release

cc979
19th June 2008, 20:39
gcc-4.2.4 vanilla
md5: 4DA45B2A8E1D2430A81C5E72212A942E

http://www.speedyshare.com/354868282.html

MatMaul
28th June 2008, 22:11
can we have a gcc 4.3.1 build please ?

clsid
28th June 2008, 22:32
This is another good source for GCC builds:
http://www.tdragon.net/recentgcc/

cc979
29th June 2008, 02:36
can we have a gcc 4.3.1 build please ?

sure, soon i hope

_xxl
29th June 2008, 05:55
Can you post a link to 4.2.4 again?

cc979
2nd July 2008, 13:31
gcc-4.2.4
http://www.speedyshare.com/304860608.html

studguy1
11th April 2009, 12:43
cc979:
A build of the latest gcc 4.3.3 would be greatly appreciated. thanks.

LoRd_MuldeR
11th April 2009, 13:28
cc979:
A build of the latest gcc 4.3.3 would be greatly appreciated. thanks.

Have a look here:
http://www.tdragon.net/recentgcc/

cc979
3rd August 2009, 16:10
Tested with Ubuntu 9.04 64 bit, 2009/08/03


building whole toolchain - binutils,gcc & cross binutils,gcc (updated 2009/08/03 for 64 bit linux host, needs update for mingw64)

using libc6-dev-i386(for 64 bit ubuntu hosts)
using bisonc++, flex, libtool, texinfo(makeinfo) maybe needed automake, autogen, autoconf

with sources from:
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/binutils/
http://gmplib.org/
http://www.mpfr.org/
http://sourceforge.net/projects/mingw/files/ MinGW API for MS-Windows(dev) & MinGW Runtime(dev)
ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/ (latest prebuilt)

*** alter x86_64-linux-gnu to i386-linux-gnu for 32 bit hosts

*** step 1 : initial gmp & mpfr linux

sudo mkdir -m 777 /my-toolchain

(do this step in gmp & mpfr src folders)

* for gmp
./configure --prefix=/my-toolchain --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

* for mpfr
./configure --with-gmp=/my-toolchain/ --prefix=/my-toolchain --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

make

make check -s

(make back-up)
make DESTDIR=/home/user/mytools/linux-libs install

make install && make distclean


*** step 2 : initial gcc linux

(from GCC docs, GCC has code to correctly determine the correct value for target for nearly all native systems. Therefore, we highly recommend you not provide a configure target when configuring a native compiler.)

(for 32 bit hosts, --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu)
(for 64 bit hosts, --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu)

(libc6-dev-i386 needed or --disable-multilib or setenv CFLAGS=-m64 added to fix /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory)

(cd gcc/mybuild)

(remove --disable-libgomp if needed)

../configure --disable-libgomp --with-gmp=/my-toolchain/ --with-mpfr=/my-toolchain/ --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-languages=c,c++ --disable-nls --prefix=/my-toolchain

(using bootstrap re-compile gcc with the gcc it has just made - you get a faster compiler, and it checks for errors)
(can use -march='your-cpu' in cflags eg. -march=k8, later versions of gcc do this automatic)
(bootstrapping may fail on some systems)

make

(make back-up)
make DESTDIR=/home/user/mytools/linux-gcc-build install

make install && rm -rf *

PATH=/my-toolchain/bin:$PATH

*** step 2a : gmp & mpfr linux - redo if needed, other skip to step 3

(do this step in gmp & mpfr src folders)

* for gmp
./configure --prefix=/my-toolchain --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

* for mpfr
./configure --with-gmp=/my-toolchain/ --prefix=/my-toolchain --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

make

make check -s

(make back-up)
make DESTDIR=/home/user/mytools/linux-libs install

make install && make distclean

*** step 2b : setup gcc linux - redo (if needed, otherwise skip to step 3)

(cd gcc/mybuild)

(remove --disable-libgomp if needed)

../configure --disable-libgomp --with-gmp=/my-toolchain/ --with-mpfr=/my-toolchain/ --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-languages=c,c++ --disable-nls --prefix=/my-toolchain

make LDFLAGS="-s" bootstrap

(make back-up)
make DESTDIR=/home/user/mytools/linux-gcc-build install

make install && rm -rf *


*** step 3 : binutils linux

(cd binutils/mybuild)

../configure --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-nls --prefix=/my-toolchain

make

(make back-up)
make DESTDIR=/home/user/mytools/linux-binutils-build install

make install && rm -rf *


*** step 4 : gcc linux (redo if needed, otherwise skip to step 5)

(cd gcc/mybuild)

(remove --disable-libgomp if needed)

../configure --disable-libgomp --with-gmp=/my-toolchain/ --with-mpfr=/my-toolchain/ --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-languages=c,c++ --disable-nls --prefix=/my-toolchain

make

(make back-up)
make DESTDIR=/home/user/mytools/linux-gcc-build install

make install && rm -rf *


*** step 5 : binutils cross linux>mingw

sudo mkdir -m 777 /cc-mingw

(cd binutils/mybuild)

../configure --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=i686-pc-mingw32 --disable-nls --prefix=/cc-mingw

make LDFLAGS="-s"

(make back-up)
make DESTDIR=/home/user/mytools/linux-cross-binutils-build install

make install && rm -rf *


*** step 6 : setup mingw32 includes & libs

sudo mkdir -m 777 /mingw && mkdir /mingw/include

extract includes & libs from mingw-runtime & w32-api to below path, or alter to needs :
/home/user/gcc/mingw-libs/headers/

extract pthreads-win32 (src: ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/pthreads-win32/dll-latest.tar)

copy & rename libpthreadGC2.a into libthread.a copy into /home/user/my-gcc/mingw-libs/headers/lib, which is the safer exeception handler but may change
copy pthread.h sched.h semaphore.h into /home/user/my-gcc/mingw-libs/headers/include

copy all includes & libs into /cc-mingw/i686-pc-mingw32


cp -r /home/user/GCC/mingw-libs/headers/* /cc-mingw/i686-pc-mingw32


** step 7 : gcc cross linux>mingw

PATH=/cc-mingw/bin:$PATH

(cd gcc/mybuild)

(remove --disable-libgomp if needed)

../configure --disable-libgomp --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=i686-pc-mingw32 --enable-languages=c,c++ --disable-nls --prefix=/cc-mingw

make

(make back-up)
make DESTDIR=/home/user/mytools/linux-cross-gcc-build install

make install && rm -rf *


*** step 8 : gmp & mpfr - cross linux>mingw - if this is not done, gcc will not find correct gmp & mpfr as it needs mingw versions

(do this step in gmp & mpfr src folders)

./configure --build=x86_64-linux-gnu --host=i686-pc-mingw32 --disable-shared --prefix=/cc-mingw/i686-pc-mingw32

make

(can't make check when crossing-compiling)
(make backup)
make DESTDIR=/home/user/cc-mingw32-libs install

make install && make distclean


*** step 9 : libgomp - cross linux>mingw (skip if not needed, it can cause problems on final cross-compile)

(cd gcc/mybuild)
../libgomp/configure --host=i686-pc-mingw32 --build=x86_64-linux-gnu --target=i686-pc-mingw32 --prefix=/cc-mingw/i686-pc-mingw32 --enable-sjlj-exceptions --enable-threads=win32 --disable-nls --disable-win32-registry --disable-shared --without-x

make LDFLAGS="-s"

(make back-up)
make DESTDIR=/home/user/cc-mingw32-libs install

make install && rm -rf *


*** step 10 : final target gcc-mingw

steps 1-9 only need doing once, as back-ups can used after copying into correct places

(if paths not set)

PATH=/my-toolchain/bin:$PATH
PATH=/cc-mingw/bin:$PATH

or

PATH=/cc-mingw/bin:/my-toolchain/bin:$PATH

(cd gcc/mybuild)

(make sure all mingw include & libs are in /mingw/i686-pc-mingw32 ... see steps 6 to 9)

**** pick one

(--host=i686-pc-mingw32 --build=x86_64-pc-linux-gnu --target=i686-pc-mingw32, disable shared with libgomp otherwise you may find libgomp creates wrong lib)

../configure --program-suffix=-4.4 --prefix=/mingw --with-local-prefix=/mingw --host=i686-pc-mingw32 --build=x86_64-pc-linux-gnu --target=i686-pc-mingw32 --disable-shared --enable-libgomp --enable-languages=c,c++ --disable-nls --disable-werror --disable-win32-registry --enable-sjlj-exceptions --enable-threads=win32 --disable-libstdcxx-pch --enable-fully-dynamic-string --with-tune=generic --enable-version-specific-runtime-libs

(make with stripped symbols)
make LDFLAGS="-s"

// final output for windows

**** pick one

make DESTDIR=/home/user/cc-mingw32-gcc-build-i686 install && rm -rf *

make DESTDIR=/home/user/cc-mingw32-gcc-3.4.6-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.0.4-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.1.2-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.1-sjlj-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.1-dw2-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.2-sjlj-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.2-dw2-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.3-sjlj-suffix-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.2.3-dw2-suffix-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-gcc-4.3-build-i686 install && rm -rf *

make DESTDIR=/home/user/cc-mingw32-gcc-4.4.1-build-i686 install && rm -rf *

(binutils)
make DESTDIR=/home/user/cc-mingw32-binutils-build-i686 install && rm -rf *
make DESTDIR=/home/user/cc-mingw32-binutils-2.19.1-build-i686 install && rm -rf *


**** notes

3 types of compile

build
this is *always* the platform on which you are running the build
process; since we are building on Linux, this is unequivocally going to
specify `linux', with the canonical form being `i686-pc-linux-gnu'.

host
this is a tricky one: it specifies the platform on which whatever we
are building is going to be run; for the cross-compiler itself, that's
also `i686-pc-linux-gnu', but when we get to the stage of building the
runtime support libraries to go with that cross-compiler, they must
contain code which will run on the `i686-pc-mingw32' host, so the `host'
specification should change to this, for the `runtime' and `w32api'
stages of the build.

target
this is probably the one which causes the most confusion; it is only
relevant when building a cross-compiler, and it specifies where the code
which is built by that cross-compiler itself will ultimately run; it
should not need to be specified at all, for the `runtime' or `w32api',
since these are already targetted to `i686-pc-mingw32' by a correct
`host' specification.

??? --enable-fully-dynamic-string, which fixes a bug when passing empty std::string objects between DLLs and EXEs.
??? --disable-libstdcxx-pch, allow compile without a PCH file or stdc++.h file
??? --program-suffix=-4.1, appends -4.1 to exe's
??? --disable-bootstrap
??? --disable-libssp, stack smashing protection
??? --enable-libstdcxx-debug
??? --enable-sjlj-exceptions, debugger mode?
??? --disable-werror, stop on first warning
??? --enable-clocale=gnu --without-included-gettext --with-system-zlib --disable-gmp --disable-mpfr

--enable-version-specific-runtime-libs

Keeps the version specific runtime libraries in a compiler specific
directory rather than placing them right in ${libdir}. You can read
more about this in the gcc documentation (install/CONFIGURE).

cc979
3rd August 2009, 16:26
a cross-compiled vanilla gcc 4.4.1, un-tested

md5: 7A4BCF575DD8D5EE5C7E1FD0306131DE
http://www.speedyshare.com/281844861.html

LoRd_MuldeR
3rd August 2009, 18:55
Thanks. Trying to build x264 with your GCC, but...

LoRd_MuldeR@MULDER_NEU /x264/x264-src
$ ./configure
No working C compiler found.

I already renamed the "xxx-4.4.exe" files to "xxx.exe", but it won't help.

LoRd_MuldeR@MULDER_NEU /x264/x264-src
$ gcc --version
gcc.exe (GCC) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any hints?

cc979
3rd August 2009, 20:35
trying using CC=gcc-4.4 before the configure

i can compile one without the suffix, if needed

_xxl
3rd August 2009, 20:41
Can you please compile lastest stable release from GCC?Without the suffix?

LoRd_MuldeR
3rd August 2009, 20:50
trying using CC=gcc-4.4 before the configure

Okay. I will try like that next time. In the meantime I got GCC 4.4.1 working with Komisar's build.

Can you please compile lastest stable release from GCC?Without the suffix?

Maybe you can use Komisar's GCC 4.4.1 build. In contrast to cc979's build that one worked "out of the box" for me:
http://forum.doom9.org/showpost.php?p=1311229&postcount=2118

TheRyuu
9th August 2009, 01:13
I'd just like to point out that make's '-j' command is useful :) (apparently I'm the only person who doesn't know about this).

make -j3 CFLAGS=etc.... (for dual core)
make -j4 or -j5 for quads

Stuff goes a lot faster, especially if you're building stuff as big as gcc :D
It allows building in parallel.

Edit: followed those steps and successfully build gcc 4.4.1 which works with mingw

TheRyuu
9th August 2009, 05:42
cc-mingw32-gcc-4.4.1-build-i686.7z (http://sempai-net.com/ss-trainee/Dragon/cc-mingw32-gcc-4.4.1-build-i686.7z)

GCC 4.4.1 built with (guess what) GCC 4.4.1, cross compiled from linux. Should work "out of the box" (i.e. no suffix).

Tested it on ffmpeg, seemed to build it fine. Other then that, untested. ;)

$ gcc -v
Using built-in specs.
Target: i686-pc-mingw32
Configured with: ../configure --prefix=/mingw --with-local prefix=/mingw --host=
i686-pc-mingw32 --build=x86_64-pc-linux-gnu --target=i686-pc-mingw32 --disable-s
hared --enable-libgomp --enable-languages=c,c++ --disable-nls --disable-werror -
-disable-win32-registry --enable-sjlj-exceptions --enable-threads=win32 --disabl
e-libstdcxx-pch --enable-fully-dynamic-string --enable-version-specific-runtime-
libs
Thread model: win32
gcc version 4.4.1 (GCC)

_xxl
9th August 2009, 20:41
Maybe you can use Komisar's GCC 4.4.1 build. In contrast to cc979's build that one worked "out of the box" for me.

As.exe from generic build crashes. Tested with WinXP Sp3 and AmdXP.

komisar
18th August 2009, 12:11
_xxl, what options you use for as.exe?

LoRd_MuldeR
24th August 2009, 19:47
TDM's GCC/MinGW is now available in version 4.4.1:
http://www.tdragon.net/recentgcc/

clsid
24th August 2009, 21:01
A custom MinGW32 installer is available here:
http://sourceforge.net/projects/ffdshow-tryout/files/Tools/mingw32_20090823.exe/download

It contains MinGW32, MSYS, GCC 4.4.1, pthreads, YASM, binutils, SDL, etc.

_xxl
21st September 2009, 16:59
@komisar
I get this error when compiling latest ffdshow-tryouts libs.
http://i35.tinypic.com/2q37p8y.jpg
MinGW GCC version:
http://i38.tinypic.com/5oh5kn.jpg
Tested with XP SP3 AMD XP 2000+.

LoRd_MuldeR
18th October 2009, 19:07
GCC 4.4.2 has been released (October 15th). Anybody has compiled/tried MinGW/GCC 4.4.2 yet?

_xxl
18th October 2009, 20:16
http://www.tdragon.net/recentgcc/
The 4.4.1-tdm-2 release is now available. If you were using the first 4.4.1 release, you are urged to upgrade to this new version in order to avoid a bug that caused drastically increased CPU usage in programs compiled with the first version.

komisar
19th October 2009, 18:25
Please test new cross-compile toolchain with GCC 4.4.2 (http://komisar.gin.by/mingw/index.html)

LoRd_MuldeR
19th October 2009, 20:28
Please test new cross-compile toolchain with GCC 4.4.2 (http://komisar.gin.by/mingw/index.html)

Thanks. Will do :)

[EDIT]

Done ;)

http://forum.doom9.org/showpost.php?p=1336163&postcount=1347

Kurtnoise
20th October 2009, 08:45
Please test new cross-compile toolchain with GCC 4.4.2 (http://komisar.gin.by/mingw/index.html)
looks like you forgot to include zlib lib/header for the x86_64-pc-mingw32...

komisar
20th October 2009, 09:05
looks like you forgot to include zlib lib/header for the x86_64-pc-mingw32...
heh, yes, sorry...

Updated.

LoRd_MuldeR
20th October 2009, 19:42
Okay, I encoded the same lossless source with x264 compiled by TDM's GCC 4.4.1-2 and with x264 compiled by Komisar's GCC 4.4.2. Using x264 r1301.

The two H.264 streams came out MD5-identical. So I guess this a good sign ;)

aerodown
21st October 2009, 17:54
hi,

i try komisar cross-mingw.gcc442.generic.20091019 but it give me error when compiling gpac:

gcc -O3 -fno-strict-aliasing -Wno-pointer-sign -DGPAC_HAVE_CONFIG_H -I/home/Eddie/gpac -I/home/Eddie/gpac/include -c -o media_tools/gpac_ogg.o media_tools/gpac_ogg.c
media_tools/gpac_ogg.c: In function 'ogg_stream_flush':
media_tools/gpac_ogg.c:763: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [media_tools/gpac_ogg.o] Error 1
make[1]: Leaving directory `/home/Eddie/gpac/src'
make: *** [lib] Error 2

im using winxp sp3 with AMD Phenom.

komisar
21st October 2009, 18:03
aerodown, huh :-\ gpac from svn?

aerodown
21st October 2009, 18:05
aerodown, huh :-\ gpac from svn?

yes.

and by the way i try another with cross-mingw.gcc442.core2.20091019 i can compile with no error, guess i cant use generic one?

komisar
21st October 2009, 18:19
aerodown, i am build with gcc442.generic on i7... no error.

Earlier i tryed to build toolchain for amdfam10, but gcc crash with "Segmentation fault"... I have not found solutions to this problem :( Perhaps this is related to this platform...

_xxl
21st October 2009, 20:31
media_tools/gpac_ogg.c:763: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [media_tools/gpac_ogg.o] Error 1
make[1]: Leaving directory `/home/Eddie/gpac/src'
I get this error with some older versions of mingw gcc.

komisar
27th October 2009, 08:59
@komisar
I get this error when compiling latest ffdshow-tryouts libs.
Tested with XP SP3 AMD XP 2000+.
In earler generic-build binutils incorrect compiled... Sorry. In this binutils used SSE2 instructions...

TheRyuu
30th October 2009, 01:34
I've successfully built a working 4.4.2 compiler with cloog/ppl for mingw32 cross compiled from linux if anyone cares.

cc-mingw32-gcc-4.4.2-build-i686-v2.7z (http://www.filefront.com/14823899/cc-mingw32-gcc-4.4.2-build-i686-v2.7z)

Edit:
If anyone is trying to build it with cloog/ppl you have to make sure your cross compiler is built with --disable-shared (to only get static shit) so when you build cloog and the final gcc you add the configure flag --with-host-libstdcxx=-lstdc++ so it actually recognizes that static link (cloog and the final gcc will not build without it). This probably only applies to cross compiled gcc's from linux.

roozhou
30th October 2009, 09:09
media_tools/gpac_ogg.c:763: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [media_tools/gpac_ogg.o] Error 1
make[1]: Leaving directory `/home/Eddie/gpac/src'
make: *** [lib] Error 2

im using winxp sp3 with AMD Phenom.

Are you using "make -j4"? This frequently happens to me when using multithread make. Try "make".