compiling core8-6 branch on windows/msys2 with clang
Closed / Works For Me2f507c8f7354e431dc1921478853584223a506ecCreated 6 years agoUpdated 41 days ago
Descriptionplain2020-11-04 12:38:09
Hi, I'm trying to compile Tcl core8-6 branch using clang. compilation seems ok but not the linking C:\msys64\mingw64\bin\ld▒: bn_mp_mul.o:bn_mp_mul.c:(.rdata$.refptr.KARATSUBA_MUL_CUTOFF[.refptr.KARATSUBA_MUL_CUTOFF]+0x0)▒: r▒f▒rence ind▒finie vers ▒▒KARATSUBA_MUL_CUTOFF▒▒ C:\msys64\mingw64\bin\ld▒: bn_mp_mul.o:bn_mp_mul.c:(.rdata$.refptr.TOOM_MUL_CUTOFF[.refptr.TOOM_MUL_CUTOFF]+0x0)▒: r▒f▒rence ind▒finie vers ▒▒TOOM_MUL_CUTOFF▒▒ C:\msys64\mingw64\bin\ld▒: bn_mp_sqr.o:bn_mp_sqr.c:(.rdata$.refptr.KARATSUBA_SQR_CUTOFF[.refptr.KARATSUBA_SQR_CUTOFF]+0x0)▒: r▒f▒rence ind▒finie vers ▒▒KARATSUBA_SQR_CUTOFF▒▒ C:\msys64\mingw64\bin\ld▒: bn_mp_sqr.o:bn_mp_sqr.c:(.rdata$.refptr.TOOM_SQR_CUTOFF[.refptr.TOOM_SQR_CUTOFF]+0x0)▒: r▒f▒rence ind▒finie vers ▒▒TOOM_SQR_CUTOFF▒▒ /mingw64/bin/clang -shared -o tcldde14.dll -pipe -static-libgcc -municode -Wl,--out-implib,libtcldde14.dll.a tclWinDde.o libtclstub86.a -lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32 C:/Users/nico/dev/dlight/win64/tcl-165a804445/compat/zlib/win64/libz.dll.a clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:492 : tcl86.dll] Erreur 1 make: *** Attente des tâches non terminées.... cp tclsh.exe.manifest tcldde14.dll.manifest best regards, Nicolas
jan.nijtmans Ticket [2f507c8f73]: 3 changes
[History diff]2020-11-04 13:01:15
jan.nijtmanswiki2020-12-10 14:21:48
In Makefile.in:
CC_SWITCHES = $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS -DMP_NO_STDINT
In tommath_private.h:
#ifdef MP_FIXED_CUTOFFS # include "tommath_cutoffs.h" # define MP_KARATSUBA_MUL_CUTOFF MP_DEFAULT_KARATSUBA_MUL_CUTOFF # define MP_KARATSUBA_SQR_CUTOFF MP_DEFAULT_KARATSUBA_SQR_CUTOFF # define MP_TOOM_MUL_CUTOFF MP_DEFAULT_TOOM_MUL_CUTOFF # define MP_TOOM_SQR_CUTOFF MP_DEFAULT_TOOM_SQR_CUTOFF #else # define MP_KARATSUBA_MUL_CUTOFF KARATSUBA_MUL_CUTOFF # define MP_KARATSUBA_SQR_CUTOFF KARATSUBA_SQR_CUTOFF # define MP_TOOM_MUL_CUTOFF TOOM_MUL_CUTOFF # define MP_TOOM_SQR_CUTOFF TOOM_SQR_CUTOFF #endif
So, if MP_FIXED_CUTOFFS is defined, KARATSUBA_MUL_CUTOFF and friends shouldn't be used. Are you really compiling with -DMP_FIXED_CUTOFFS ???
anonymousplain2020-12-22 07:11:19
Hi Jan, so I've added -DMP_FIXED_CUTOFFS and compilation is fine. here's what I'm doing: export CC=/mingw64/bin/clang.exe ./configure --enable-threads --disable-symbols --enable-64bit --prefix=/opt/local make -j 4 CFLAGS="-DMP_FIXED_CUTOFFS" ++ Nicolas
jan.nijtmansplain2020-12-22 07:24:16
Well, Makefile.in already contains
CC_SWITCHES = ... -DMP_FIXED_CUTOFFS ...
So, I simply don't understand why you have to add it to CFLAGS as well....
serhiy.storchakawiki2026-10-15 11:29:06
Closing: no reply since 2020.
serhiy.storchaka Ticket [2f507c8f73]: 3 changes
[History diff]2026-10-22 17:19:26
Log in (anonymous is fine) to add a comment.