<div dir="ltr"><div dir="ltr">Hello,<br><br>I have successfully build OpenSSL 1.1.1b (only libraries, no app) for WINCE700-ARMV4I, though I don't do any tests. Here is what I did. I hope original sources will be changed so as there is no need to change.<br><br>1. Modify wcecompat.<br><br>Add an alias, "_access" for access() in wcecompat io.h as below.<br>--<br>#define access _wceaccess<br>#define _access _wceaccess<br>--<br><br>2. Set Environmental variables<br><br>set OSVERSION=WCE700<br>set PLATFORM=VC-CE<br>set TARGETCPU=ARMV4I<br>set WCECOMPAT=C:\Users\dev\tanaka\wcecompat<br>set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows CE Tools\SDKs\YOUR_SDK_NAME\Lib\ARMV4I;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\lib\ARMV4I;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib<br>set INCLUDE=C:\Program Files (x86)\Windows CE Tools\SDKs\YOUR_SDK_NAME\Include\ARMV4I;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;<br>set Path=C:\WINCE700\sdk\bin\i386\arm;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;C:\cygwin64\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;%Path%<br>set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;"C:\Program Files (x86)\Windows CE Tools\SDKs\YOUR_SDK_NAME\Lib\ARMV4I";C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\lib\ARMV4I;<br><br>3. Configure<br><br>(for ARM)(Configurations/windows-makefile.tmpl) Delete a line of "setargv.obj". setargv.obj in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib is for x86 and cannot be linked with ARM objs.<br><br>C:\Strawberry\perl\bin\perl Configure no-idea no-mdc2 no-rc5 no-asm no-ssl3 no-stdio no-async no-engine VC-CE<br><br>Using full path to specify Strawberry perl. I recommend Strawberry perl here to avoid error messages, I used 5.24.4.1-32bit.<br><br>I added 3 options of "no-stdio" and "no-engine", "no-async". Because..<br>  * no-stdio: GetStdHandle() and STD_INPUT_HANDLE cannot be used in WinCE. (used in apps\apps.c)<br>  * no-engine: Lack of CreatePipe() in WinCE (used in engines\e_dasync.c)<br>  * no-async: Lack of ConvertFiberToThread() in WinCE (used in crypto\async\arch\async_win.c)<br>By "no-stdio" option, we build only libraries. No command line application are generated.<br><br>4. Modify "makefile"<br><br>  * Add -D_MSC_VER=1300 in "CFLAGS="<br>  * In "CNF_CPPFLAGS=", change -I"\$(WCECOMPAT)/include" to -I$(WCECOMPAT)/include<br>  * Change CNF_EX_LIBS=3 to CNF_EX_LIBS=ws2.lib crypt32.lib kernel32.lib $(WCECOMPAT)\lib\wcecompat.lib $(WCECOMPAT)\lib\wcecompatex.lib corelibc.lib coredll.lib<br><br>5. Modify C Source<br><br>Comment out a line of "#  define stat    _stat" in<br>  crypto\conf\conf_def.c<br>  crypto\rand\randfile.c<br>  crypto\store\loader_file.c<br>Comment out a line of "#  define fstat   _fstat" in crypto\rand\randfile.c.<br><br>(crypt/init.c 167l and 777l) For lack of GetModuleHandleEx() in CE, Change "# ifdef DSO_WIN32" to "# if defined(DSO_WIN32) && !defined(_WIN32_WCE)"<br>-----------------<br># ifdef DSO_WIN32<br>    {<br>        HMODULE handle = NULL;<br>        BOOL ret;<br><br>        /* We don't use the DSO route for WIN32 because there is a better way */<br>        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS<br>-----------------<br><br>(crypto\rand\randfile.c 257l) For lack of GetEnvironmentVariableW() in CE, Change "#if defined(_WIN32) && defined(CP_UTF8)" to "#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)"<br><br>(for ARM)(include\internal\refcount.h)<br>  * Add "#include <winbase.h>" for InterlockedExchangeAdd().<br>  * (106l) In function CRYPTO_UP_REF() and CRYPTO_DOWN_REF(), change 2 "_InterlockedExchangeAdd()" to be "InterlockedExchangeAdd()". There is no _InterlockedExchangeAdd() for non x86 in C:\Program Files (x86)\Windows CE Tools\SDKs\YOUR_SDK_NAME\Include\Armv4i\winbase.h.<br><br>(crypt/threads_win.c 27l) For lack of InitializeCriticalSectionAndSpinCount() in CE, change<br>------------------<br>    /* 0x400 is the spin count value suggested in the documentation */<br>    if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {<br>        OPENSSL_free(lock);<br>        return NULL;<br>    }<br>------------------<br>to<br>------------------<br>#ifndef _WIN32_WCE<br>    /* 0x400 is the spin count value suggested in the documentation */<br>    if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {<br>        OPENSSL_free(lock);<br>        return NULL;<br>    }<br>#else<br>    InitializeCriticalSection(lock);<br>#endif<br>------------------<br><br>6. Build<br><br>nmake<br><br>Then we will get the following artifacts.<br>  libcrypto.lib<br>  libcrypto-1_1.dll<br>  libcrypto-1_1.pdb<br>  libssl.lib<br>  libssl-1_1.dll<br>  libssl-1_1.pdb<br><br>Regards,<br>Soju TANAKA<br><br></div></div>