<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hello !<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks a lot for sharing this! I will try to compile it with our SDK and let you know if I get any testing results.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Greetings,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#1F497D">Maxime TORRELLI<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#1F497D">Embedded Software Engineer<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D">Conduent<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#1F497D">Conduent Business Solutions (France)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:#444444">1 rue Claude Chappe – BP 345<br>
07503 Guilherand Granges Cedex<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> openssl-users <openssl-users-bounces@openssl.org>
<b>De la part de</b> ????<br>
<b>Envoyé :</b> 19 March 2019 08:09<br>
<b>À :</b> openssl-users@openssl.org<br>
<b>Objet :</b> Building OpenSSL 1.1.1b for WinCE700<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>