Artifacts Associated With Ticket 3059922fffffffff
Ticket change [9576e32277] (rid 106160) by mescalinum on 2010-09-05 18:29:02:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
mingw64 doesn't have SEH, and apparently amd64 arch (w64) doesn't need it.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mescalinum"
- subsystem initialized to: "52. Portability Support"
- title initialized to: "fixes for mingw64 - gcc4.5.1 tdm64-1"
- type initialized to: "Patch"
Add attachment "tcl8.5.8-mingw64-fix.diff" [46ad981376] (rid 99557) by mescalinum on 2010-09-06 01:29:03.
Ticket change [9b65344dd1] (rid 111111) by mescalinum on 2010-09-06 01:29:03:
- icomment:
File Added - 385692: tcl8.5.8-mingw64-fix.diff
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [d9ca9095dc] (rid 107671) by mescalinum on 2010-09-06 01:30:58:
- icomment:
tested against tcl8.5.8 and tcl8.5.9rc4
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [e513e117ed] (rid 88072) by dgp on 2010-09-07 20:04:34:
- assignee changed to: "andreas_kupries"
- icomment:
Andreas, is this configuration one of your test systems? Does this patch cause any trouble with your test systems?
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
Ticket change [5e59f37d43] (rid 115624) by nijtmans on 2010-09-07 21:42:05:
- icomment:
This sounds to me that HAVE_NO_SEH is ill-determined in the configure script. It should not be necessary to test for _WIN64 separately.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [46c4ad86b7] (rid 99570) by andreas_kupries on 2010-09-07 23:28:44:
- icomment:
@dgp While we have a 64bit windows box we are using the C compiler of the platform SDK, not gcc. The mingw we are using, is only to run bash, configure, etc., and it is a 32bit version too, just checked with depends.exe, cputype is x86, not amd64. So, no, this is not one of our configurations.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [b3b6b88ca8] (rid 124901) by andreas_kupries on 2010-09-07 23:28:45:
- assignee changed to: "dgp"
Ticket change [5dbf486acf] (rid 115524) by dgp on 2010-09-08 00:02:50:
- assignee changed to: "andreas_kupries"
- icomment:
nijtmans' comments sound right to me. Is it understood why HAVE_NO_SEH goes wrong on this platform?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [e7d9b5f846] (rid 104542) by andreas_kupries on 2010-09-08 01:13:47:
- icomment:
I have no understanding of SEH at all, except that I know that the acronym expands to 'structured exception handling'. I also seem to remember that Kevin talked about it at some point in some way, the exact nature of which I have forgotten (It was over a year ago at least, more likely over two years). Another person which might know it is David Gravereaux IIRC. tclguy less so actually, I believe.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [636267aac5] (rid 92568) by mescalinum on 2010-09-08 02:17:51:
- icomment:
excuse me I didn't state explicitly what the patch was going (trying) to correct, which is a compile failure on mingw w64, because it has no SEH, and the assembler workaround is valid only for x86 (pushl, movl, are not amd64 instructions). I think the macro HAVE_NO_SEH it's set correct. maybe the check should be #if defined(__MINGW32__) && defined(_AMD64) && defined(HAVE_NO_SEH)
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [4be56d2c31] (rid 126782) by nijtmans on 2010-09-08 02:20:57:
- icomment:
I knew I saw it before: This is a duplicate of [Patch #1910041], which contains a better solution. See my remarks there. I cannot test it, but I think we should be grateful to Kai Tietz and NightStrike for providing such a complete solution.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [1d3a6928d8] (rid 90768) by nijtmans on 2010-09-08 02:20:58:
- resolution changed to: "Duplicate"
Ticket change [73185f135c] (rid 104986) by dgp on 2010-09-08 20:38:57:
- icomment:
File Added - 386005: kai-update.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "kai-update.patch" [1b2e659835] (rid 123101) by dgp on 2010-09-08 20:38:57.
Ticket change [a4b9239ff8] (rid 110252) by dgp on 2010-09-08 20:40:12:
- icomment:
Here's my updated version of Patch 1910041. It needs testing on the mingw/amd64 system, which I do not have. mescalinum? Can you give it a test?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9fa78851d8] (rid 96675) by mescalinum on 2010-09-08 20:55:23:
- icomment:
@dgp: compiler output: gcc -c -O2 -fomit-frame-pointer -Wall -I"./../generic" -DTCL_TOMMATH -DMP_PREC=4 -I"./../libtommath" -I"." -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_NO_SEH=1 -DHAVE_NO_LPFN_DECLS=1 -DHAVE_ALLOCA_GCC_INLINE=1 -DHAVE_CAST_TO_UNION=1 -DTCL_CFGVAL_ENCODING=\"cp1252\" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DBUILD_tcl "tclWin32Dll.c" -o tclWin32Dll.o tclWin32Dll.c: In function 'TclWinCPUID': tclWin32Dll.c:1125:28: warning: unused variable 'registration' \Temp\cc2FmRDa.s: Assembler messages: \Temp\cc2FmRDa.s:61: Error: Incorrect register `%rax' used with `l' suffix make: *** [tclWin32Dll.o] Error 1
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [327ea788f2] (rid 93623) by dgp on 2010-09-08 21:01:02:
- icomment:
Why are those lines being compiled?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4f2acac64b] (rid 125778) by dgp on 2010-09-08 21:03:53:
- icomment:
I think I misread the message. If you change "movl" to "movq" on line 428, does it make things better?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d665843446] (rid 123798) by dgp on 2010-09-08 21:08:22:
- icomment:
kennykb comments at 1910041 suggest the approach of the patch here is the better way to go.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "3059922.patch" [cf14e4f238] (rid 112904) by dgp on 2010-09-08 21:24:48.
Ticket change [02585b71e8] (rid 119629) by dgp on 2010-09-08 21:24:48:
- icomment:
File Added - 386010: 3059922.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [37eb7848d3] (rid 112113) by dgp on 2010-09-08 21:25:50:
- icomment:
I believe the new attached patch 3059922.patch gets all the logic errors corrected, without adding new assembly. Needs testing on all windows configurations.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [52cee2a8d4] (rid 126381) by mescalinum on 2010-09-08 21:27:13:
- icomment:
@dgp: > If you change "movl" to "movq" on > line 428, does it make things better? yep, that made the trick. there's still a linker error at the end: Creating library file: libtcl85.atclWin32Dll.o:tclWin32Dll.c:(.text+0xc4): undefined reference to `_Tcl_Finalize' tclWinChan.o:tclWinChan.c:(.text+0xa69): undefined reference to `_CloseHandle ' collect2: ld returned 1 exit status make: *** [tcl85.dll] Error 1 these functions are referenced from assembler. maybe needs a different syntax.
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [6d3ba6fd56] (rid 128657) by mescalinum on 2010-09-08 22:02:23:
- icomment:
@dgp: yes, 3059922.patch is ok. tested with tcl8.5.9rc4
- login: "mescalinum"
- mimetype: "text/plain"
- username: "mescalinum"
- icomment:
Ticket change [329f464e5a] (rid 93643) by dgp on 2010-09-08 22:49:28:
- icomment:
committed to core-8-5-branch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [fd7714a04a] (rid 108418) by dgp on 2010-09-09 04:03:01:
- assignee changed to: "dgp"
- closedate changed to: "2010-09-08T21:03:01"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 ....and to HEAD
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"
Ticket change [3e1b434857] (rid 121209) by kennykb on 2010-09-09 08:55:27:
- icomment:
The correct fix, in my arrogant opinion, is to use no SEH on 64-bitters. There's no need to protect CPUID, because all 64-bitters have it. There's also no need to *do* CPUID, because the 64-bit BIOSes have pretty well done away with the performance counter synchronisation issues that plague the 32-bitters. The remaining SEH calls in Tcl are all protecting against Windows operating system bugs that have been fixed for years - certainly prior to the release of any 64-bit version of Windows. So by all means fix the build if it's broken, but don't preserve the mess of assembly language code. It's not needed on Win64.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [ba0807f4a2] (rid 129248) by nijtmans on 2010-12-14 18:46:04:
- icomment:
allow_comments - 0 When running the test suite on Tcl 8.6 (copmpiled with mingw-w64 for AMD64), I got the following test failure (see below). Either the test case should be disabled for Win64, or the cpuid should be implemented. I think that cpuid is useful for more than only the preformance counter, e.g. determining the number of available cores. Here is a patch (305992_2), which should work with both gcc and MSVC. I definitely works with gcc, but I don't have a MSVC 64-bit environment to test that part. The 64-bit assembler parts are basically the same as the 32-bit versions, only the SEH part is not needed here (as Kevin already noted) See attached patch (305992_2.patch). ==== platform-3.1 CPU ID on Windows FAILED ==== Contents of test case: set cpudata [testwincpuid 0] binary format iii [lindex $cpudata 1] [lindex $cpudata 3] [lindex $cpudata 2] ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: operation not available while executing "testwincpuid 0" ("uplevel" body line 2) invoked from within "uplevel 1 $script" ---- errorCode: NONE ==== platform-3.1 FAILED - login: "nijtmans"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- status changed to: "Open"
- username: "nijtmans"
- icomment:
Add attachment "3059922_2.patch" [37b70a9b95] (rid 112076) by nijtmans on 2010-12-14 18:47:04.
Ticket change [3968575e0b] (rid 112383) by nijtmans on 2010-12-14 18:47:05:
- icomment:
File Added - 396063: 3059922_2.patch
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [51cd860254] (rid 126192) by nijtmans on 2010-12-20 02:04:31:
- assignee changed to: "andreas_kupries"
- icomment:
AMD inline assembler version put in HEAD. Investigated how to do the same in Win64/MSVC, it turns out that inline assembler is not supported any more, but in stead intrinsics should be used. Here is a patch (3059922_3.patch) doing this. Andreas, does this work on MSVC/64-bit? Or - in other words - does the platform-3.1 test pass after this patch? Thanks, Andreas! (knowing you have a platform available.....)
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
Add attachment "3059922_3.patch" [6f6704d330] (rid 100312) by nijtmans on 2010-12-20 02:05:38.
Ticket change [dd3a772a06] (rid 114629) by nijtmans on 2010-12-20 02:05:38:
- icomment:
File Added - 396480: 3059922_3.patch
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [d02c830a4a] (rid 113120) by nijtmans on 2010-12-21 17:08:22:
- closedate changed to: "2010-12-21T10:08:22"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Andreas, never mind.... VS10 has intrinsics for Win32 as well, so I was able to test this for Win32. Fixed in HEAD, now TclWinCPUID should work correct on all AMD64/i586 Windows version, both with GCC and MSVC
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "nijtmans"