Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with nasm 2.14.02 fails on win64 #30

Open
gabrielschulhof opened this issue Oct 3, 2019 · 9 comments
Open

Build with nasm 2.14.02 fails on win64 #30

gabrielschulhof opened this issue Oct 3, 2019 · 9 comments
Labels

Comments

@gabrielschulhof
Copy link

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?

@gbtucker
Copy link
Contributor

gbtucker commented Oct 3, 2019

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

@gabrielschulhof
Copy link
Author

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

@gbtucker
Copy link
Contributor

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

@arun-kv
Copy link

arun-kv commented Feb 2, 2021

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?

@gbtucker
Copy link
Contributor

gbtucker commented Feb 2, 2021

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?

@arun-kv
Copy link

arun-kv commented Feb 3, 2021

@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.

@gbtucker
Copy link
Contributor

gbtucker commented Feb 3, 2021

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

@arun-kv
Copy link

arun-kv commented Feb 5, 2021

@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$@ $?

@gbtucker
Copy link
Contributor

gbtucker commented Feb 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants