Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2019-12-23
11:30 • Closed ticket [ce3b9f2b04]: compilation errors with clang (windows msys2) pl... artifact: 6209b74fb7 user: jan.nijtmans
11:26
Workaround for [ce3b9f2b04]: compilation errors with clang (windows msys2) check-in: 53c630ddf2 user: jan.nijtmans tags: core-8-6-branch
10:29 • Ticket [ce3b9f2b04] compilation errors with clang (windows msys2) status sti... artifact: 759afcba07 user: jan.nijtmans
08:16 • Ticket [ce3b9f2b04]: 3 changes artifact: fea4427c19 user: bll
08:10 • New ticket [ce3b9f2b04]. artifact: dbfc7b4180 user: bll

compilation errors with clang (windows msys2)

Closed / Fixedce3b9f2b048ff2788d9aae2d490a428a460f5f48Created 7 years agoUpdated 7 years ago
Descriptionplain2019-12-23 08:10:26
clang -c -m32 -O2 -fomit-frame-pointer -D_ATL_XP_TARGETING -DMP_FIXED_CUTOFFS
 -DMP_NO_STDINT -Wall -Wdeclaration-after-statement  
-I"C:/msys64/home/bll/t/tcl8610work/tcl8.6.10/compat/zlib" 
-I"C:/msys64/home/bll/t/tcl8610work/tcl8.6.10/generic" 
-DTCL_TOMMATH -DMP_PREC=4 
-I"C:/msys64/home/bll/t/tcl8610work/tcl8.6.10/libtommath" 
-I"C:/msys64/home/bll/t/tcl8610work/tcl8.6.10/win" -pipe -DPACKAGE_NAME=\"\" 
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" 
-DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 
-DTCL_CFGVAL_ENCODING=\"utf-8\" -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 -DMODULE_SCOPE=extern 
-DHAVE_NO_SEH=1 -DHAVE_CAST_TO_UNION=1 -DHAVE_ZLIB=1 -DHAVE_INTPTR_T=1 
-DHAVE_UINTPTR_T=1 -DHAVE_INTRIN_H=1 -DHAVE_WSPIAPI_H=1 -DNDEBUG=1 
-DTCL_CFG_OPTIMIZED=1    -DBUILD_tcl "tclWinChan.c" -o tclWinChan.o
tclWinChan.c:1160:53: error: invalid variant '4'
            "pushl      %%ebx"                          "\n\t"
                                                           ^
<inline asm>:12:26: note: instantiated into assembly here
        call       _CloseHandle@4
                                ^
1 error generated.
make: *** [Makefile:591: tclWinChan.o] Error 1



clang version 9.0.0
Referenced by1
  • 53c630ddf2Workaround for [ce3b9f2b04]: compilation errors with clang (windows msys2) check-in2019-12-23 11:26:31
bll Ticket [ce3b9f2b04]: 3 changes [History diff]2019-12-23 08:16:23
jan.nijtmansplain2019-12-23 10:29:14
Yes, I can reproduce this with Clang 8.0.

However, since this works fine as-is with gcc, this must be a clang 'bug/feature'. It looks like @4 is interpreted as symbol variant, something that Win32 doesn't understand. I guess Clang must be built without this feature, as "@4" is really part of the symbol name on win32.

On 64-bit this is no issue. Workaround: compile with gcc.
jan.nijtmanswiki2019-12-23 11:30:12

Workaround committed now to all branches.

Since this assembler-code is only used for protecting the CloseHandle call, which might crash on earlier Win32 version, it is harmless to diable it. I don't see any ill-effects when running the test-suite.

Log in (anonymous is fine) to add a comment.