Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: TDragon on July 24, 2007, 05:23:24 am

Title: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: TDragon on July 24, 2007, 05:23:24 am
GCC 4.2.1 TDM-2 is now available! Objective-C++ and Treelang packages have been added, and GCC now uses libiconv for support for non-UTF-8 charsets (see -finput-charset, etc.). As always, you should be able to install in almost any directory, and use it from almost any directory (unless you're running Vista).

See http://www.tdragon.net/recentgcc/ (http://www.tdragon.net/recentgcc/) for details.


====== Older =======

GCC 4.2.1 is out, I'm back from a trip to the mountains (and looking at another next week :D), and it's time for another TDM GCC binary release! Drop-in replacements are available for the official MinGW gcc-core, gcc-g++, gcc-objc, and gcc-g77 packages. As always, core/g++ are tested working for wxWidgets and C::B. See http://www.tdragon.net/recentgcc/ for download links, installation information, and any further details you might need.

-John E. / TDM
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: JGM on July 24, 2007, 08:17:31 am
Cool!
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: jsibarani on July 24, 2007, 09:57:53 am
 :( still in honeymoon with your 4.2.0, and now i have to check for other..
 :D
 
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: patlecat on July 24, 2007, 12:53:48 pm
Kool man, I'll check it out asap! I just fear that 4.2.1 might be a show stopper  :? Because they removed a lot of deprecated code ... we'll see. Thanks a lot TD
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: imbaczek on July 26, 2007, 10:11:47 am
This and previous version breaks when a directory of the same name as a standard include is on the include path:
Code
In file included from rts\System\Demo.cpp:12:
rts/Game/GameSetup.h:5:15: error: rts/map: Permission denied
line 5 is #include <map> and rts/Map is a directory. Workaround is to add -I/standard/include/dir as a first command line option, so it's not critical, but quite annoying.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: Ramazan Kartal on July 26, 2007, 05:12:00 pm
Hi,

I have a problem with gcc 4.2.1. Whenever I try to compile one of my source files I get:

error: no iconv implementation, cannot convert from latin5 to UTF-8

Command line is as follows:

mingw32-g++.exe -DWINVER=0x0500 -g -O0 -fno-inline -DDEBUG1 -Wall -fexceptions -mthreads -finput-charset=latin5  -IC:\MinGW\include -c K.cpp -o K.o

I guess this is related to "-finput-charset=latin5". I have to use this parameter since my sources have some Turkish characters. Can I correct this problem by copying "libiconv*.dll" from my Gnu Win32 utilities to somewhere in Mingw tree?

Regards
Ramazan Kartal
 
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on July 26, 2007, 05:18:16 pm
This and previous version breaks when a directory of the same name as a standard include is on the include path:
Code
In file included from rts\System\Demo.cpp:12:
rts/Game/GameSetup.h:5:15: error: rts/map: Permission denied
line 5 is #include <map> and rts/Map is a directory. Workaround is to add -I/standard/include/dir as a first command line option, so it's not critical, but quite annoying.
Confirmed. I'll see about creating a GCC bug report.

Can I correct this problem by copying "libiconv*.dll" from my Gnu Win32 utilities to somewhere in Mingw tree?
No, I'm pretty sure GCC has to be linked to libiconv when built. Look for another release in the near future that is!

-John E. / TDM
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: prilenko on July 27, 2007, 12:21:16 pm
i installed the gcc 4.2.1,it worked well,but i found that the dbg can not work.just as follow:

int main()
{
  int i=8,j=9;
  int k=i+j;
  cout<<"k="<<k<<endl;
  return 0;
}
when i debug ,the watch window should show the values of i,j and k,but valued showed in the window are obviously wrong .but when i replaced Gcc by 3.4.5,it can correctly show the values.i can not understand why?
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on July 27, 2007, 04:20:14 pm
The format of the debugging information produced by GCC has probably changed since 3.4.5. Have you tried upgrading to MinGW's GDB 6.6?
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: Ramazan Kartal on July 27, 2007, 05:19:20 pm
Hi,

error: no iconv implementation, cannot convert from latin5 to UTF-8
Best solution is to compile one by yourself in msys/mingw. UTF-8 conversion depends on many things (mingw-runtime and winapi), so - it's more a problem of platform's subsystem (MinGW is "under" Windows, he isn't standalone, right?). BTW, compiler itself can be linked without any problems with static libiconv.a and I suggest you to avoid dll-hell doing the same. Libiconv has nasty circular dependency with libintl from gettext /chicken or egg situation/ and because of that (and many other things) iconv has never ever been properly compiled for MinGW.

Actually I don't use libiconv.dll in my programs, it is only required by gcc itself if I specify "-finput-charset=latin5" as a parameter, which I should. However, I use libpng.dll and zlib1.dll. You're right,  it can cause "dll hells", for that I am planning to use "LoadLibrary".

Quote
Quote
Quote from: Ramazan Kartal on 26 July 2007, 22:12:00
Can I correct this problem by copying "libiconv*.dll" from my Gnu Win32 utilities to somewhere in Mingw tree?
No, I'm pretty sure GCC has to be linked to libiconv when built. Look for another release in the near future that is!
I would be grateful if you provide one.

Regards,
Ramazan Kartal
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: Ramazan Kartal on July 27, 2007, 07:23:11 pm
-------------- my man. If you download my gettext-iconv-expat rar archive, you can try it... it's gcc version independent and newest one. If it doesn't work, take plan B.

(http://free-kr.t-com.hr/zeman/smiley/ghostsmile.gif)

I don't use any function from gettext, iconv or expat, why should I try it? Also do you really know what "g--- k--------" means?

Regards,
Ramazan Kartal
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: thomas on July 30, 2007, 11:21:31 am
Huh... looks like self denial. It means "to get free of something troublesome (e.g., a job) with very little damage" (Turkish phrase I've used and picked up earlier god knows where).
The phrase you used is an off-colour idiom which may be quite offensive to people. Please don't use non-english phrases on this board (even more so if you are not sure about their implication).
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: roland on August 01, 2007, 03:19:38 am
can anyone compile allegro 4.2.2 with this?

It fails for me with this error some time into compilation:
Code
gcc -DALLEGRO_LIB_BUILD -Wall -Wno-unused -mtune=i586 -O2 -funroll-loops -ffast-math  -fomit-frame-p
ointer -DSETUP_USE_COMPILED_DATAFILES -I. -I./include -o obj/mingw32/alleg/setup.o -c setup/setup.c
setup/setup.c: In function 'joystick_handler':
setup/setup.c:2483: error: unrecognizable insn:
(insn 138 136 139 11 (set (reg:SI 182)
        (const:SI (plus:SI (mem:SI (symbol_ref:SI ("#i.joy") <var_decl 015DC4D0 joy>) [0 S4 A8])
                (const_int 312 [0x138])))) -1 (nil)
    (nil))
setup/setup.c:2483: internal compiler error: in extract_insn, at recog.c:2077
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
mingw32-make: *** [obj/mingw32/alleg/setup.o] Error 1

*edit*
I've posted about it on the Allegro forums. The response I got indicates it may be bugs in the compiler. I'm just curious if anyone else would mind trying, and see what kind of headway you can get in case it is something wrong with my config. All the details are in this post:
http://www.allegro.cc/forums/thread/592549
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: jimmyo on August 02, 2007, 04:20:07 pm
Hello,

I get an error while build binutils.
i use Build.txt description to install and run scripts under mSYS/mingw.

/bin/sh ./libtool --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2   -o                                      ar.exe  arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o                                      filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a   
gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -o ar.exe arparse.o arlex.o ar.o no                                     t-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.                                     a ../libiberty/libiberty.a
arlex.o: In function `main':C:/msys/1.0/extra/crossgcc/cross-binutils-build/binutils/arlex.c:1: multiple                                      definition of `main'
arparse.o:C:/msys/1.0/extra/crossgcc/cross-binutils-build/binutils/arparse.c:1: first defined here
ar.o: In function `main':C:/msys/1.0/extra/crossgcc/cross-binutils-build/binutils/../../binutils-2.17.50                                     -20060824-1-src/binutils/ar.c:337: multiple definition of `main'
arparse.o:C:/msys/1.0/extra/crossgcc/cross-binutils-build/binutils/arparse.c:1: first defined here
ar.o: In function `mri_emul':C:/msys/1.0/extra/crossgcc/cross-binutils-build/binutils/../../binutils-2.1                                     7.50-20060824-1-src/binutils/ar.c:141: undefined reference to `yyparse'
collect2: ld returned 1 exit status
make[4]: *** [ar.exe] Error 1
make[4]: Leaving directory `/extra/crossgcc/cross-binutils-build/binutils'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/extra/crossgcc/cross-binutils-build/binutils'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/extra/crossgcc/cross-binutils-build/binutils'
make[1]: *** [all-binutils] Error 2
make[1]: Leaving directory `/extra/crossgcc/cross-binutils-build'
make: *** [all] Error 2


Any solution ?

  Jimmy
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: tyrus on August 03, 2007, 03:36:39 pm
Very good work TDM. I have compiled lots of libraries and programs here and everything looks fine. The only problem that I found was in some .la in the lib directory that was pointing to yours cross-compile directory.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on August 04, 2007, 12:50:45 am
i use Build.txt description to install and run scripts under mSYS/mingw.
This probably won't work without major modification; I build under Ubuntu Linux (7.04), and the scripts aren't designed with mSYS in mind.
At any rate, I'm not entirely certain about the multiple main definitions error, but the undefined reference to yyparse probably means you don't have Bison installed.

The only problem that I found was in some .la in the lib directory that was pointing to yours cross-compile directory.
Oops. Is this causing problems during normal usage?

can anyone compile allegro 4.2.2 with this?
This is definitely a bug in GCC. I'll see about a bug report on this one, too.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: raph on August 04, 2007, 01:01:33 pm
I just decided to try out gcc 4 (your gcc 4.2.1 build) and did a little benchmark.
Here are the results:

Time to build wxMSW 2.8.4 (configuration for cb):
Note: I didn't redirect console output.

Time to build codeblocks svn 4346 (without contrib plugins):


Sizes:
wxmsw28u_gcc_custom.dll

output\codeblocks.exe

output\codeblocks.dll

devel\codeblocks.exe

devel\codeblocks.dll

devel\

output\

My system:
WinXP Sp2
AMD XP 2600+
1,5 gb ram

Since optimization doesn't greatly matter for me, I think I'll stick to 3.4.5
What do you think?
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on August 04, 2007, 03:27:01 pm
I achieved similar results in this post (http://forums.codeblocks.org/index.php/topic,5282.msg41081.html#msg41081) (using GCC 4.1.2). If you need optimization, better error detection, or a 3.4.x bug fixed, upgrade; otherwise, stay where you are.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: roland on August 05, 2007, 05:50:15 pm
Thanks TDragon. Can you link to the bug report when its up?

raph: extreamly informative, thanks. Filesize doesn't really matter to me, but things not compiling certainly does. :P I guess for a lot of things I must stick with 3.4.5 for the time being. Still, looking at the /deve/ dir, over a 40MB difference  :shock: geeze...
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 05, 2007, 10:15:36 pm
I must be missing something.  This is on a clean machine - I followed your instructions and downloaded the other packages (w32api, etc) on your website.

I installed MinGW 4.2.1 to C:MinGW-4.2.1

I get several errors about missing files when compiling a basic console app:

-------------- Build: Debug in Test ---------------
Compiling: main.cpp
In file included from c:/mingw-4.2.1/bin/../lib/gcc/mingw32/4.2.1/../../../../include/c++/4.2.1/mingw32/bits/c++locale.h:47,
                 from C:/MinGW-4.2.1/include/c++/4.2.1/iosfwd:45,
                 from C:/MinGW-4.2.1/include/c++/4.2.1/ios:43,
                 from C:/MinGW-4.2.1/include/c++/4.2.1/ostream:45,
                 from C:/MinGW-4.2.1/include/c++/4.2.1/iostream:45,
                 from C:\Test\main.cpp:1:
C:/MinGW-4.2.1/include/c++/4.2.1/clocale:51:20: error: locale.h: No such file or directory

Any thoughts?
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: raph on August 05, 2007, 10:22:25 pm
C:/MinGW-4.2.1/include/c++/4.2.1/clocale:51:20: error: locale.h: No such file or directory
Does that file exist?
EDIT: i really need sleep :roll:
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 05, 2007, 10:42:52 pm
locale.h???

I have a locale file (note with no extension) in the include/c++/4.2.1 folder off that package, but no locale.h
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on August 05, 2007, 11:09:08 pm
Any thoughts?
You forgot to install the mingw-runtime package? Make sure that there is a locale.h in <mingw>\include.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 06, 2007, 12:23:44 am
I knew it was something I missed - thanks!
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 06, 2007, 12:42:38 am
Did notice this strange occurence - I was compiling the libcurl library and got this error:

In file included from C:/MinGW-4.2.1/include/stdio.h:407,
                 from C:\Projects\Third-Party\curl-7.16.4\lib\/setup.h:157,
                 from C:\Projects\Third-Party\curl-7.16.4\lib\connect.c:24:
C:/MinGW-4.2.1/include/sys/types.h:104: error: two or more data types in declaration specifiers
C:/MinGW-4.2.1/include/sys/types.h:104: warning: useless type name in empty declaration

The offending code in types.h is :

#ifndef   _NO_OLDNAMES
typedef _ssize_t ssize_t;
#endif
#endif /* Not _SSIZE_T_ */

Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 06, 2007, 04:03:24 pm
I've posted this question to the MinGW list as I have noticed this before.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on August 06, 2007, 05:50:35 pm
dwmcqueen:
It'll probably be fixed with another update to the mingw-runtime package whenever the official MinGW GCC 4.2.x is released.

Ramazan Kartal:
I'm testing GCC 4.2.1 TDM-2 right now, which is iconv-enabled. Hopefully I'll be able to upload it later today or tomorrow.

Cheers,
John E. / TDM
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: dwmcqueen on August 06, 2007, 06:08:06 pm
What should be the change?  I just commented it out.
Title: Re: TDM's GCC 4.2.1 for MinGW available
Post by: TDragon on August 06, 2007, 06:52:43 pm
What should be the change?
I couldn't say without taking a look at the libcurl sources. You'd need to find where ssize_t was being defined earlier and see if there is a macro that will prevent it, or create another macro that disables that definition in that specific case -- or, just comment it out (if you can be sure that nothing else needs it...).
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: TDragon on August 06, 2007, 06:57:59 pm
GCC 4.2.1 TDM-2 is now available! Objective-C++ and Treelang packages have been added, and GCC now uses libiconv for support for non-UTF-8 charsets (see -finput-charset, etc.). As always, you should be able to install in almost any directory, and use it from almost any directory (unless you're running Vista).

See http://www.tdragon.net/recentgcc/ (http://www.tdragon.net/recentgcc/) for details.
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: dwmcqueen on August 06, 2007, 07:44:23 pm
ssize_t is defined a few lines earlier in types.h
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: TDragon on August 06, 2007, 07:59:04 pm
ssize_t is defined a few lines earlier in types.h
Nope, that's _ssize_t (note the leading underscore).
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: dwmcqueen on August 07, 2007, 01:59:41 am
Here it is defined in a config-win32.h header file (within curl):

#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
#elif defined(_WIN64)
#define ssize_t __int64
#else
#define ssize_t int
#endif

I think this define causes the problem - it is included earlier, and sets it to be an int.  Then, in the types.h, it defines it again.
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: Ramazan Kartal on August 07, 2007, 05:44:05 am
Hi,

Quote
GCC 4.2.1 TDM-2 is now available! Objective-C++ and Treelang packages have been added, and GCC now uses libiconv for support for non-UTF-8 charsets (see -finput-charset, etc.).

Thanks TDM, now I can compile using "-finput-charset=latin5".

Regards,
Ramazan Kartal
Title: Re: TDM's GCC 4.2.1 (now with iconv, Obj-C++ and Treelang)
Post by: dwmcqueen on August 08, 2007, 09:27:06 pm
MinGW has now released 4.2.1 (partially)

-----------------------
Quote
A GCC 4.2.1 binary release for mingw is available.

You can download it from:
https://sourceforge.net/project/showfiles.php?group_id=2435
under gcc-4

The binaries are archived by language.

There are two versions, differing in the model used for exception unwind
info.
 (1) Setjump-longjump (sjlj). Historically,and currently, the
    default model.
 (2) Dwarf2 table-based unwinding (dw2). The more efficient model.


*This version is built with Dwarf 2 unwind info enabled. The gcc, g++
and
gfortran drivers in the bin directory have a '-dw2' suffix to indicate
that, You can remove '-dw2; from these files if you like.

If you want sjlj you will find them (soon) in the gcc-4.2.1-sjlj-1
package

The binaries were compiled with --enable-version-specific-runtime-libs.
The runtime libs are in <mingw-root>/lib/gcc/mingw32/gcc-4.2.1-dw2. Do
not move these files. If you really must, don't bother reporting
installation bugs.

Please consider this package as experimental.

To get core C compiler, download:

 gcc-core-4.2.1-dw2-1.tar.gz

To add on other languages, download one or more
of these (in addition to core):

 gcc-ada-4.2.1-dw2-1.tar.gz
 gcc-g++-4.2.1-dw2-1.tar.gz
 gcc-gfortran-4.2.1-dw2-1.tar.gz
 gcc-objc-4.2.1-dw2-1.tar.gz


Extract the files, maintaining the directory structure, into your root
directory for mingw.

Be aware that some archive extracters do not preserve read-only
attributes of files. If you are installing the Ada component, please
check that the files in the /lib/gcc/mingw32/4.2.1-dw2/adainclude and
adalib
directories are flagged as read-only. This attribute is necessary to
prevent them from being deleted when using gnatclean to clean a project.


* libstdc++ and libgfortran require version 3.13 of mingw-runtime and
 w32api version 2.2 or higher.

* This package does _not_ contain binutils, the mingw-runtime
 or the w32api. You will need to get these if you do not already
 have mingw installed.

* libstdc++ and libgfortran require version 3.13 of mingw-runtime and
 w32api version 2.2 or higher.  Yes, I've said it twice now.

* Static and dll libraries of libgcc and libstdc++ are in the release.
 By default, linkage is to static libraries.  More details later.

* OpenMP is enabled.  To use it you will need to have  win32-pthreads
 package installed. More details later.

This release contains:

1) Source distribution, with mingw-local patches incorporated:
 gcc-4.2.1-1-src.tar.gz
 (This is the whole shebang. Maybe some day I'll have time to break
  up into language components.)

2) Binaries
 gcc-core-4.2.1-dw2-1.tar.gz
 gcc-ada-4.2.1-dw2-1.tar.gz
 gcc-g++-4.2.1-dw2-1.tar.gz
 gcc-gfortran-4.2.1-dw2-1.tar.gz
 gcc-objc-4.2.1-dw2-1.tar.gz

3) gcc-4.2.1-build-dw2.sh, which is the script I used to configure
  and build.


4) This file.


Danny
2007-08-07