<div dir="ltr"><div dir="ltr">Hello,<br><br>It works with our custommized cURL code.<br>I wrote a detailed build instruction for CE.<br>  <a href="https://qiita.com/souju/items/94117c024862f57459c3">https://qiita.com/souju/items/94117c024862f57459c3</a><br><br>> It would be good if you created a github PR for this so the changes can be<br>> considered for inclusion.<br><br>Thank you. I post the PR.<br>  <a href="https://github.com/openssl/openssl/pull/8596">https://github.com/openssl/openssl/pull/8596</a><br><br>Regards,<br>Souju TANAKA<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2019年3月19日(火) 18:39 Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 19/03/2019 07:08, 田中創樹 wrote:<br>
> Hello,<br>
> <br>
> I have successfully build OpenSSL 1.1.1b (only libraries, no app) for<br>
> WINCE700-ARMV4I, though I don't do any tests. Here is what I did. I hope<br>
> original sources will be changed so as there is no need to change.<br>
<br>
It would be good if you created a github PR for this so the changes can be<br>
considered for inclusion.<br>
<br>
Matt<br>
<br>
<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<br>
> 9.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows CE<br>
> Tools\SDKs\YOUR_SDK_NAME\Lib\ARMV4I;C:\Program Files\Microsoft<br>
> SDKs\Windows\v6.0A\Lib;C:\Program Files (x86)\Microsoft Visual Studio<br>
> 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<br>
> Tools\SDKs\YOUR_SDK_NAME\Include\ARMV4I;C:\Program Files (x86)\Microsoft Visual<br>
> Studio 9.0\VC\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio<br>
> 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<br>
> Studio 9.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio<br>
> 9.0\VC\VCPackages;C:\Program Files\Microsoft<br>
> SDKs\Windows\v6.0A\bin;C:\cygwin64\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program<br>
> Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files<br>
> (x86)\Microsoft Visual Studio 9.0\VC\BIN;%Path%<br>
> set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio<br>
> 9.0\VC\ATLMFC\LIB;"C:\Program Files (x86)\Windows CE<br>
> Tools\SDKs\YOUR_SDK_NAME\Lib\ARMV4I";C:\Program Files (x86)\Microsoft Visual<br>
> Studio 9.0\VC\lib;C:\Program Files (x86)\Microsoft Visual Studio<br>
> 9.0\VC\ce\lib\ARMV4I;<br>
> <br>
> 3. Configure<br>
> <br>
> (for ARM)(Configurations/windows-makefile.tmpl) Delete a line of "setargv.obj".<br>
> setargv.obj in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib is for<br>
> 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<br>
> no-stdio no-async no-engine VC-CE<br>
> <br>
> Using full path to specify Strawberry perl. I recommend Strawberry perl here to<br>
> 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<br>
> 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<br>
> crypto\async\arch\async_win.c)<br>
> By "no-stdio" option, we build only libraries. No command line application are<br>
> 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<br>
> $(WCECOMPAT)\lib\wcecompat.lib $(WCECOMPAT)\lib\wcecompatex.lib corelibc.lib<br>
> 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 "#<br>
> 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,<br>
> Change "#if defined(_WIN32) && defined(CP_UTF8)" to "#if defined(_WIN32) &&<br>
> 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<br>
> "_InterlockedExchangeAdd()" to be "InterlockedExchangeAdd()". There is no<br>
> _InterlockedExchangeAdd() for non x86 in C:\Program Files (x86)\Windows CE<br>
> Tools\SDKs\YOUR_SDK_NAME\Include\Armv4i\winbase.h.<br>
> <br>
> (crypt/threads_win.c 27l) For lack of InitializeCriticalSectionAndSpinCount() in<br>
> 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>
</blockquote></div>