<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Build cst 3.3.1 built with libcrypto static library in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1194010#M166020</link>
    <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;We are currently building cst 3.3.1 for a linux 64b machine using the following command:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;make -j8 OSTYPE=linux64 rel_bin&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As a result we get both srktool and cst binaries linking to the &lt;STRONG&gt;libcrypto&lt;/STRONG&gt; shared library, which makes it mandatory for any other machine we deploy these artifacts to to have the same shared library.&lt;/P&gt;&lt;P&gt;~/cst-3.3.1/code/cst$ ldd release/linux64/bin/cst&lt;BR /&gt;linux-vdso.so.1 =&amp;gt; (0x00007ffe19fea000)&lt;BR /&gt;&lt;STRONG&gt;libcrypto.so.1.0.0&lt;/STRONG&gt; =&amp;gt; /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f4f803d8000)&lt;BR /&gt;libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f8000e000)&lt;BR /&gt;libdl.so.2 =&amp;gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f7fe0a000)&lt;BR /&gt;/lib64/ld-linux-x86-64.so.2 (0x00007f4f8081d000)&lt;/P&gt;&lt;P&gt;We noticed the precompiled srktool and cst binaries under path &lt;STRONG&gt;linux64/bin&lt;/STRONG&gt; do not link to that shared library, and have a bigger size instead, so we guess the libcrypto library was linked as static in these artifacts:&lt;/P&gt;&lt;P&gt;~/cst-3.3.1$ ldd linux64/bin/cst&lt;BR /&gt;linux-vdso.so.1 =&amp;gt; (0x00007ffcc4809000)&lt;BR /&gt;libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8baceee000)&lt;BR /&gt;/lib64/ld-linux-x86-64.so.2 (0x00007f8bad2b8000)&lt;/P&gt;&lt;P&gt;We are interested into reproducing similar binaries and we would like to know what is the command (or the changes) that was used to create this artifacts with the static library.&lt;/P&gt;&lt;P&gt;My machine is an Ubuntu 16.04 with OpenSSL 1.0.2g 1 Mar 2016.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gonzalo&lt;/P&gt;</description>
    <pubDate>Fri, 04 Dec 2020 17:45:30 GMT</pubDate>
    <dc:creator>gonzalo_ruiz</dc:creator>
    <dc:date>2020-12-04T17:45:30Z</dc:date>
    <item>
      <title>Build cst 3.3.1 built with libcrypto static library</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1194010#M166020</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;We are currently building cst 3.3.1 for a linux 64b machine using the following command:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;make -j8 OSTYPE=linux64 rel_bin&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As a result we get both srktool and cst binaries linking to the &lt;STRONG&gt;libcrypto&lt;/STRONG&gt; shared library, which makes it mandatory for any other machine we deploy these artifacts to to have the same shared library.&lt;/P&gt;&lt;P&gt;~/cst-3.3.1/code/cst$ ldd release/linux64/bin/cst&lt;BR /&gt;linux-vdso.so.1 =&amp;gt; (0x00007ffe19fea000)&lt;BR /&gt;&lt;STRONG&gt;libcrypto.so.1.0.0&lt;/STRONG&gt; =&amp;gt; /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f4f803d8000)&lt;BR /&gt;libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f8000e000)&lt;BR /&gt;libdl.so.2 =&amp;gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f7fe0a000)&lt;BR /&gt;/lib64/ld-linux-x86-64.so.2 (0x00007f4f8081d000)&lt;/P&gt;&lt;P&gt;We noticed the precompiled srktool and cst binaries under path &lt;STRONG&gt;linux64/bin&lt;/STRONG&gt; do not link to that shared library, and have a bigger size instead, so we guess the libcrypto library was linked as static in these artifacts:&lt;/P&gt;&lt;P&gt;~/cst-3.3.1$ ldd linux64/bin/cst&lt;BR /&gt;linux-vdso.so.1 =&amp;gt; (0x00007ffcc4809000)&lt;BR /&gt;libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8baceee000)&lt;BR /&gt;/lib64/ld-linux-x86-64.so.2 (0x00007f8bad2b8000)&lt;/P&gt;&lt;P&gt;We are interested into reproducing similar binaries and we would like to know what is the command (or the changes) that was used to create this artifacts with the static library.&lt;/P&gt;&lt;P&gt;My machine is an Ubuntu 16.04 with OpenSSL 1.0.2g 1 Mar 2016.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gonzalo&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 17:45:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1194010#M166020</guid>
      <dc:creator>gonzalo_ruiz</dc:creator>
      <dc:date>2020-12-04T17:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Build cst 3.3.1 built with libcrypto static library</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1201329#M166668</link>
      <description>&lt;P&gt;Hi Gonzalo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which i.MX product is this question related to?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Ivan&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 16:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1201329#M166668</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-12-17T16:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Build cst 3.3.1 built with libcrypto static library</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1201743#M166719</link>
      <description>&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;The question affects a bunch of our products based on: i.MX6, i.MX6UL, i.MX8X and i.MX8MNano.&lt;/P&gt;&lt;P&gt;I was able to statically link the &lt;STRONG&gt;libcrypto&lt;/STRONG&gt; library with this change:&lt;/P&gt;&lt;P&gt;diff --git a/code/cst/code/build/make/gcc.mk b/code/cst/code/build/make/gcc.mk&lt;BR /&gt;index 0394f5a..cc57f6b 100755&lt;BR /&gt;--- a/code/cst/code/build/make/gcc.mk&lt;BR /&gt;+++ b/code/cst/code/build/make/gcc.mk&lt;BR /&gt;@@ -28,7 +28,7 @@ COPTIONS += -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Werror -pedantic -fPIC -g&lt;BR /&gt;#==============================================================================&lt;BR /&gt;LDOPTIONS += -g&lt;BR /&gt;&lt;BR /&gt;-LDLIBS := -lcrypto&lt;BR /&gt;+LDLIBS := -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -lpthread -ldl&lt;BR /&gt;&lt;BR /&gt;# Archiver flags&lt;BR /&gt;#==============================================================================&lt;/P&gt;&lt;P&gt;But I was forced to link to the libpthread and libdl shared libraries in my host machine.&lt;/P&gt;&lt;P&gt;Is there a better way to achieve binaries similar to the ones provided by default?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gonzalo&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 09:41:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1201743#M166719</guid>
      <dc:creator>gonzalo_ruiz</dc:creator>
      <dc:date>2020-12-18T09:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Build cst 3.3.1 built with libcrypto static library</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1202633#M166806</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think libcrypto.a need to be rebuilt because I noticed OPENSSL_CONFIG in cst-3.3.1/code/cst/Makefile&lt;BR /&gt;According to&amp;nbsp;CST_UG.pdf, cst-3.3.1 is built using OpenSSL 1.1.1.&lt;BR /&gt;The following are the steps we followed:&lt;/P&gt;
&lt;P&gt;1, Download&amp;nbsp;OpenSSL from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.openssl.org/source/old/1.1.1/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.openssl.org/source/old/1.1.1/&lt;/A&gt;. Decompress into cst-3.3.1/code/ and rename to "openssl"&lt;BR /&gt;2, modify&amp;nbsp;cst-3.3.1/code/cst/code/build/make/gcc.mk&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;@@ -22,13 +22,13 @@ OBJCOPY := objcopy

 # C compiler flags
 #==============================================================================
-COPTIONS += -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Werror -pedantic -fPIC -g
+COPTIONS += -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Werror -pedantic -fPIC -g -I../openssl/include

 # Linker flags
 #==============================================================================
 LDOPTIONS += -g

-LDLIBS := -lcrypto
+LDLIBS := -l:../openssl/libcrypto.a

 # Archiver flags
 #==============================================================================
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3, cd&amp;nbsp;cst-3.3.1/code/cst&lt;BR /&gt;4,&amp;nbsp;make -j8 OSTYPE=linux64 openssl&lt;BR /&gt;5,&amp;nbsp;make -j8 OSTYPE=linux64 clean&lt;BR /&gt;6,&amp;nbsp;make -j8 OSTYPE=linux64 rel_bin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Ivan.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 21:04:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Build-cst-3-3-1-built-with-libcrypto-static-library/m-p/1202633#M166806</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-12-21T21:04:58Z</dc:date>
    </item>
  </channel>
</rss>

