Hi,
I want to bring this problem up again and want to ask for adding a patch
for winpthreads.
using two patches:
(1) gcc/libgomp/config/mingw32/time.c
diff -rupN a/gcc-4.8.2/libgomp/config/mingw32/time.c
b/gcc-4.8.2/libgomp/config/mingw32/time.c
--- a/gcc-4.8.2/libgomp/config/mingw32/time.c 2013-01-14
19:18:49.000000000 +0100
+++ b/gcc-4.8.2/libgomp/config/mingw32/time.c 2013-12-16
17:04:52.014237600 +0100
@@ -31,8 +31,8 @@
double
omp_get_wtime (void)
{
- struct _timeb timebuf;
- _ftime (&timebuf);
+ struct __timeb64 timebuf;
+ _ftime64 (&timebuf);
return (timebuf.time + (long)(timebuf.millitm) / 1e3);
}
(2) winpthreads/src/misc.c
diff -rupN a/winpthreads-v3/src/misc.c b/winpthreads-v3/src/misc.c
--- a/winpthreads-v3/src/misc.c 2014-01-06 15:08:29.077875000 +0100
+++ b/winpthreads-v3/src/misc.c 2014-01-07 14:35:02.892621500 +0200
@@ -25,9 +25,9 @@
unsigned long long _pthread_time_in_ms(void)
{
- struct _timeb tb;
+ struct __timeb64 tb;
- _ftime(&tb);
+ _ftime64(&tb);
return (unsigned long long)tb.time * 1000ULL + (unsigned long long)
tb.millitm;
}
The first patch is meant for the nixman's mingw-builds scripts, see
https://github.com/niXman/mingw-builds/issues/340 .
using __ftime64 instead of _ftime would allow winpthread as well as openMP
usage with runtime MSVCR90 and higher. _ftime in included in msvcrt only.
Both symbols are equivalent, unless _USE_32BIT_TIME_T is defined.
Cheers,
Carl
2013-12-19 12:56 GMT+01:00 Carl Kleffner <[email protected]>:
> Hi,
>
> using a fully static build toolchain:
>
> gcc.exe (rev0, Built by MinGW-W64 project) 4.8.2
>
> build with the mingw-build scripts (github) on msys2 (Windows7) I've
> problems with the import of symbols only available on msvcrt. I use a
> customized 'specs' to ensure exclusive msvcr90 runtime dependancy due to my
> needs.
>
> gfortran g90_gomp.f90 -fopenmp
>
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/libgomp.a(time.o):(.text+0xb):
> undefined reference to `__imp__ftime'
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-misc.o):misc.c:(.text+0xb):
> undefined reference to `__imp__ftime'
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-misc.o):misc.c:(.text+0x95):
> undefined reference to `__imp__ftime'
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-misc.o):
> bad reloc address 0x0 in section `.pdata'
> d:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
> final link failed: Invalid operation
> collect2.exe: error: ld returned 1 exit status
>
> Is there any other option other than patching the sources to use _ftime64
> instead og _ftime?
>
> Regards
>
> Carl
>
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public