News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

GCC 4.4.0-tdm-1 for MinGW (with installer)

Started by TDragon, May 01, 2009, 09:19:10 PM

Previous topic - Next topic

Biplab

Quote from: ollydbg on May 03, 2009, 05:37:41 PM
Excuse me, What does the ICE means?
Thanks.

Internal Compiler Error, if I'm not wrong. ;)
Be a part of the solution, not a part of the problem.

ollydbg

It seems some DLL support OpenMP are lost in the new TDM GCC 4.4 release. ( It works fine in the TDM GCC 4.3.3)

Hi, I just generate the OpenCV library with OpenMP enabled. But it seems that a DLL file is lost. See the dependencies below.





[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna


ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

TDragon

Quote from: thomas on May 03, 2009, 05:32:01 PM
However, as described above, I found out that -fcaller-saves (which O2, O3, Os enable) is the culprit. Explicitely disabling caller saves makes the ICE go away. This might possibly give someone interested in the problem a clue where to look.

Alternatively, is there a way to tell gcc not to install signal handlers? Since it reports a segfault, this should actually kick off the just-in-time debugger if gcc didn't catch the exception, so I should be able to get a core dump.
Normally with an ICE GCC reports the line number and function within its own source; is that not happening?

Quote from: ollydbg on May 03, 2009, 05:44:06 PM
It seems some DLL support OpenMP are lost in the new TDM GCC 4.4 release. ( It works fine in the TDM GCC 4.3.3)

Hi, I just generate the OpenCV library with OpenMP enabled. But it seems that a DLL file is lost. See the dependencies below.
It wouldn't really be so hard to do a search in the MinGW directory for libgomp-1.dll, would it? Check lib/gcc/mingw32/bin.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

thomas

Quote from: TDragon on May 03, 2009, 09:35:09 PM
Normally with an ICE GCC reports the line number and function within its own source; is that not happening?
Afraid not :(
This is the complete thing (include paths etc. elided):
mingw32-g++-dw2.exe -O2 -Wall -g -fno-rtti -mfpmath=sse,387 -fbranch-target-load-optimize -pipe -march=core2 -msse2 -ftree-vectorize -ffast-math -funit-at-a-time -std=gnu++0x -U__STRICT_ANSI__ -funsafe-loop-optimizations -Wunsafe-loop-optimizations -Wall -Wextra -Wnon-virtual-dtor -Wfloat-equal -Wno-missing-field-initializers -Wno-multichar -Wcast-align -Wstrict-aliasing -Wshadow   -I (...)  -c (...) -o (...)
H:\checkout\mtc\trunk\sys\system.cpp: In function 'bool sys::init()':
H:\checkout\mtc\trunk\sys\system.cpp:177: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.tdragon.net/recentgcc/bugs.php> for instructions.
Process terminated with status 1 (0 minutes, 2 seconds)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

TDragon

Well, if you posted the file I would be happy to try to narrow it down to a simple test case.

Also, this page has info on debugging a GCC segfault. TDM-GCC is compiled with --enable-checking=release (the default for upstream releases), but without -g and with -O2, so there may not be much else to be discovered without using a debug build of GCC.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

ollydbg

#22
Quote from: TDragon on May 03, 2009, 09:35:09 PM
It wouldn't really be so hard to do a search in the MinGW directory for libgomp-1.dll, would it? Check lib/gcc/mingw32/bin.
Shame on me :D!
It's there, Thanks for your help!

Edit

Why not move these DLLs from

MinGW/lib/gcc/mingw32/bin

to

MinGW/bin

Thanks.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

killerbot

Here's an issue I also discovered in a TDM 4.3.x.

When I compile some simple code I get errors on GCC's own headers [I don't have this with the latest MinGW 4.2.1], the issue also does not occur on linux (4.3.1).

Quote
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iosfwd:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ios:39,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/istream:40,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/sstream:39,
                 from C:\view_vipnt_buildserver\vipnt\Codec\src\CodecDisplay.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared

I can only get it to work when I use the following warning options :


-Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -pedantic -Wextra -Wall

-Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -pedantic -Wextra -Wall

Normally I use :

-Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -pedantic -std=c++98 -Wextra -Wall -ansi


So the moment I add any of these the error already occurs :
-std=c++98
-ansi

Is there any chance this can be fixed ??

thomas

Try this: -std=c++98 -U__STRICT_ANSI__.

Strict ANSI mode which all of the -std= options enable is pretty useless insofar as it disables 90% of CRT, at no benefit. However, you can get MinGW to compile your code using the respective standard without going into moron mode by undefining that macro in said manner.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

drac

Quotec:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared

You need to patch the cwchar header, others have done it http://www.nabble.com/-ANN--GCC-4.4.0-Released-td23207147.html

With that patch you can compile this new C++0x hello program (g++ hello.cpp -o hello.exe -std=c++0x)

#include <iostream>
#include <vector>

int main()
{
  std::vector<char> v = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x43, 0x2b,
0x2b, 0x30, 0x78, 0x20, 0x57, 0x6f, 0x72, 0x6c,
0x64, 0x21 };
 
  for (auto it = v.begin(); it != v.end(); ++it)
  {
    std::cout << *it;
  }
 
  std::cout << std::endl;
}


C++0x is cool!

killerbot

I can confirm Thomas' suggestion works :-)

So I now have among the previously working options :
  -std=c98++ -ansi -U__STRICT_ANSI__

What will be the real difference, with this being undefined, with respect to ensuring portable codes and very little extensions creeping in from gcc ?

How save is the workaround of just commenting out the 2 offending lines ? Is this something that will make it in the official (mingw)-gcc ??

TDragon

Rather than commenting out the two lines in cwchar, surround them with #ifndef __STRICT_ANSI__/#endif. This is actually the correct fix for the problem, which I believe is merely a small oversight. This issue should be discussed with the mingw-runtime maintainer and then forwarded to GCC (probably Danny Smith).
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

sahasranaman

I have been trying this for some time. I installed from the latest bundled installer, then I've got the new -2 packages seperately, still I keep getting the error. By the way, I'm linking with libsigc++, which was actually built using MinGW GCC 3.4.5. I'm pasting the error. Could someone help?


g++.exe -o dist/Debug/MinGW-Windows/urllib__ build/Debug/MinGW-Windows/urllibpp.o build/Debug/MinGW-Windows/main.o -L/C/Python26/libs -L/C/msys/1.0/local/lib -L../gtk+/lib -L/c/mingw/lib/gcc/mingw32/4.4.0 -lglibmm-2.4.dll -lpython26 -lboost_python-mgw44-mt-1_38 -lsigc-2.0 -lglib-2.0.dll
c:/mingw/lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Unregister':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:189: multiple definition of `_Unwind_SjLj_Unregister'
c:/msys/1.0/local/lib/libsigc-2.0.dll.a(d000019.o):(.text+0x0): first defined here
c:/mingw/lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Register':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:142: multiple definition of `_Unwind_SjLj_Register'
c:/msys/1.0/local/lib/libsigc-2.0.dll.a(d000016.o):(.text+0x0): first defined here
c:/mingw/lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Resume':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind.inc:220: multiple definition of `_Unwind_SjLj_Resume'
c:/msys/1.0/local/lib/libsigc-2.0.dll.a(d000017.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status

TDragon

Seems like libsigc-2.0.dll.a was actually built with the first release of 4.4.0-tdm-1, or some other build that doesn't properly hide the _Unwind_* symbols. Whatever the case, it needs to be rebuilt, preferably with 4.4.0-tdm-1 r2.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)