intel/isa-l_crypto

Build with nasm 2.14.02 fails on win64

Opened this issue · 9 comments

I get isa-l_crypto\sha256_mb\sha256_mb_mgr_flush_avx2.asm:99: error: COFF format does not support any special symbol type when I try to assemble this file on Windows.

Is there a way around this?

You should have got %error nasm not supported in windows. You need to switch to yasm in windows for now.

@gbtucker OK, I'll try to get yasm running.

@gabrielschulhof, nasm should work now. You might give it another try.

Hi @gbtucker , I get below error while building isa-l_crypto on win64

nasm --version
NASM version 2.14.02 compiled on Dec 26 2018

nmake -f Makefile.nmake
....
....

Creating library isa-l_crypto.lib and object isa-l_crypto.exp
sm3_multibinary.obj : error LNK2001: unresolved external symbol sm3_ctx_mgr_init_avx2
sm3_multibinary.obj : error LNK2001: unresolved external symbol sm3_ctx_mgr_submit_avx2
sm3_multibinary.obj : error LNK2001: unresolved external symbol sm3_ctx_mgr_flush_avx2
isa-l_crypto.dll : fatal error LNK1120: 3 unresolved externals

Do you know if this is a known issue or how to resolve it?

Thanks @arun-kv, looks like we may have left out a few files from nmake. Can you try again from tip I just pushed b524e65?

@gbtucker its still failing.

link -out:isa-l_crypto.dll -dll -def:isa-l_crypto.def -nologo -incremental:no -debug @C:\Users\akv\AppData\Local\Temp\nmBE1B.tmp
Creating library isa-l_crypto.lib and object isa-l_crypto.exp
sm3_ctx_avx2.obj : error LNK2019: unresolved external symbol sm3_mb_mgr_submit_avx2 referenced in function sm3_ctx_mgr_flush_avx2
sm3_mb_mgr_submit_avx2.obj : error LNK2001: unresolved external symbol sm3_mb_mgr_submit_avx2
sm3_mb_mgr_submit_avx2.obj : error LNK2001: unresolved external symbol start_loop
sm3_mb_mgr_submit_avx2.obj : error LNK2001: unresolved external symbol len_is_0
sm3_mb_mgr_submit_avx2.obj : error LNK2001: unresolved external symbol return
sm3_mb_mgr_submit_avx2.obj : error LNK2001: unresolved external symbol return_null
isa-l_crypto.dll : fatal error LNK1120: 5 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.EXE"' : return code '0x460'
Stop.

I have actually tried the same fix before asking the question.

Thanks again @arun-kv. I think I found a simple solution to this issue also. I'm pushing through testing now and trying to see why it wasn't caught.

--- a/sm3_mb/sm3_mb_mgr_submit_avx2.asm
+++ b/sm3_mb/sm3_mb_mgr_submit_avx2.asm
@@ -34,7 +34,10 @@
 %include "reg_sizes.asm"

 extern sm3_mb_x8_avx2
+
+[bits 64]
 default rel
+section .text

@gbtucker thank you so much for the help, its getting compiled now.

The test directory is not getting compiled, so i have made the below changed to make it work.

--- a/tests/extended/Makefile.nmake
+++ b/tests/extended/Makefile.nmake
@@ -40,7 +40,7 @@ DLL = isa-l_crypto.dll

tests: lib $(tests)
$(tests): $(@b).obj
-link /out:$@ $(LINKFLAGS) libeay32.lib $(LIBS) $.obj
+link /out:$@ $(LINKFLAGS) libcrypto.lib $(LIBS) $
.obj
%.obj: %.c
$(CC) $(CFLAGS) -Fo$@ $?

Thanks for testing this. As openSSL changed the lib name in 1.1.0 we should change also.