User forums > General (but related to Code::Blocks)
TDM-GCC 5 series (Latest: 5.1.0 - 2015-06-28)
stahta01:
--- Quote from: TDragon on June 29, 2015, 05:13:18 am ---Why are those pthread.h changes needed for wxWidgets?
I hadn't seen that PCH patch before; so, it's not present in the 5.1.0 release.
-John E. / TDM
--- End quote ---
Some reason two different defines of the struct timespec was seen.
So, I changed the one in pthread.h to use the one defined in parts/time.h.
The one in parts/time.h matches the one used by time.h and parts/time.h is included by the header unistd.h.
So, if you include pthread.h and parts/time.h you get an error.
I removed my change and this is the error it stops on while building wxWidgets 3.0.2 using 32 bit TDM GCC.
--- Code: ---g++ -c -o gcc_mswudll51Xsjlj\monodll_file.o -O2 -mthreads -DHAVE_W32API_H -D__
WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll51Xsjlj\mswu -I..\..\includ
e -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\p
ng -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scin
tilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D_
_WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL -Wno-ctor-dtor-pr
ivacy -Wmissing-include-dirs -std=gnu++11 -Wno-unused-local-typedefs -fno-keep-i
nline-dllexport -MTgcc_mswudll51Xsjlj\monodll_file.o -MFgcc_mswudll51Xsjlj\monod
ll_file.o.d -MD -MP ../../src/common/file.cpp
In file included from C:/Apps32/TDM-GCC5_1x-32/lib/gcc/mingw32/5.1.0/include/c++
/mingw32/bits/gthr-default.h:34:0,
from C:/Apps32/TDM-GCC5_1x-32/lib/gcc/mingw32/5.1.0/include/c++
/mingw32/bits/gthr.h:148,
from C:/Apps32/TDM-GCC5_1x-32/lib/gcc/mingw32/5.1.0/include/c++
/ext/atomicity.h:35,
from C:/Apps32/TDM-GCC5_1x-32/lib/gcc/mingw32/5.1.0/include/c++
/bits/basic_string.h:39,
from C:/Apps32/TDM-GCC5_1x-32/lib/gcc/mingw32/5.1.0/include/c++
/string:52,
from ..\..\include/wx/stringimpl.h:66,
from ..\..\include/wx/unichar.h:15,
from ..\..\include/wx/strvararg.h:22,
from ..\..\include/wx/string.h:46,
from ../../src/common/file.cpp:105:
C:/Apps32/TDM-GCC5_1x-32/include/pthread.h:227:8: error: redefinition of 'struct
timespec'
struct timespec {
^
In file included from C:/Apps32/TDM-GCC5_1x-32/include/unistd.h:95:0,
from ../../src/common/file.cpp:54:
C:/Apps32/TDM-GCC5_1x-32/include/parts/time.h:65:8: error: previous definition o
f 'struct timespec'
struct timespec
^
makefile.gcc:6494: recipe for target 'gcc_mswudll51Xsjlj\monodll_file.o' failed
mingw32-make: *** [gcc_mswudll51Xsjlj\monodll_file.o] Error 1
--- End code ---
Tim S.
stahta01:
Simplest code that gives the error.
--- Code: ---#include <pthread.h>
#include <unistd.h>
int main()
{
return 0;
}
--- End code ---
--- Code: ----------------- Build: Release in testgcc51x (compiler: gcc-5.1.x)---------------
mingw32-g++.exe -Wall -c C:\SourceCode\Test\testgcc51x\main.cpp -o obj\Release\main.o
In file included from C:/Apps32/TDM-GCC5_1x-32/include/unistd.h:95:0,
from C:\SourceCode\Test\testgcc51x\main.cpp:2:
C:/Apps32/TDM-GCC5_1x-32/include/parts/time.h:65:8: error: redefinition of 'struct timespec'
struct timespec
^
In file included from C:\SourceCode\Test\testgcc51x\main.cpp:1:0:
C:/Apps32/TDM-GCC5_1x-32/include/pthread.h:227:8: error: previous definition of 'struct timespec'
struct timespec {
^
--- End code ---
Tim S.
scarphin:
--- Quote from: stahta01 on June 28, 2015, 09:34:06 pm ---
--- Quote from: scarphin on June 28, 2015, 09:32:37 pm ---tdm-gcc is somehow less vulnerable to that bug, I suspect tdragon has already fixed that in his own builds (way before 5.1) or am I wrong?
--- End quote ---
It was NOT fixed in his 4.8 GCC based release. I do NOT remember if I tested the 4.9 based release for the bug or not.
Tim S.
--- End quote ---
I haven't checked the code (I even didn't know where to check before ollydbg spotted it). I am just judging by the fact that tdm-4.9.2 (iirc also tdm-4.8.1) can compile wx2.8 in 64-bit bitness. It might be another factor though.
ollydbg:
--- Quote from: TDragon on June 29, 2015, 05:13:18 am ---I hadn't seen that PCH patch before; so, it's not present in the 5.1.0 release.
--- End quote ---
Hi, John, I thought you could see it, because I post some messages in mingw-w64 maillist, see: [Mingw-w64-public] can anyone supply a debug version of cc1plus.exe? about one month ago.
The real bug report are in GCC bugzilla, see: 56926 – Crash (without ICE) while compiling Boost.Math, especially my Comment 17, in my comment, I see that the crash can be simply fixed by set a large value of "pch_VA_max_size". About two or three days ago, I see another person post a patch GCC bug 14940 Comment 47, he said this patch should work better than my change. I don't have ability to build GCC myself, so I can't confirm whether his patch works better. His comments are mainly in MinGW-w64 - for 32 and 64 bit Windows / Bugs / #382 PCH: cc1plus.exe crash on Windows8.1, see omgwtfbbq's comments in that Bug report.
Currently, PCH is disabled when building C::B with wx3.x under Windows, because of this crash issue. I hope next release of TDM gcc can solve this issue, thanks.
TDragon:
--- Quote from: stahta01 on June 29, 2015, 06:16:16 am ---Some reason two different defines of the struct timespec was seen.
--- End quote ---
Aha, the newer mingwrt-3.21 added a struct timespec definition that wasn't present in 3.20-2.
I think the correct place to fix this will be in winpthreads; now testing a patch. In the meantime I'm reverting to mingwrt-3.20 in the installer and as the recommended version as it didn't have this problem.
-John E. / TDM
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version