7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept xml:lang="en" id="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B"><title>Target Types</title><prolog><metadata><keywords/></metadata></prolog><conbody><ul><li id="GUID-2254E482-D730-5661-9878-6B90F17977F4"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B">Generation of STDEXE, STDDLL and STDLIB</xref> </p> </li> <li id="GUID-F57FF724-6A83-5746-B85E-7548B8BD911A"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA">WCHARENTRYPOINT - new keyword</xref> </p> </li> <li id="GUID-D9117869-204F-51ED-8E40-F6D5F4D5889B"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E">External functions and symbols exported by default</xref> </p> </li> </ul> <section id="GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B"><title>Generation of STDEXE, STDDLL and STDLIB</title> <p>The introduction of two new Symbian platform target types, <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph>, was required to enable the specific options for compilers and linkers to generate P.I.P.S. executables. </p> <p>P.I.P.S. executables are implemented using native Symbian platform executables linked statically to the glue code. The target types <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph> make symbol information available for lookup by name. </p> <p>For each new target type the following library files, system files and include paths are included <i>by default</i>. The table below shows the additional libraries and paths for the new target types. </p> <table id="GUID-8C82882E-0F2A-5CD0-B318-04FD5FC88A01"><tgroup cols="3"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/><tbody><row><entry><p> <b>Target Type</b> </p> </entry> <entry><p> <b>File/Path</b> </p> </entry> <entry><p> <b>Purpose</b> </p> </entry> </row> <row><entry><p> <codeph>STDEXE</codeph> </p> </entry> <entry><p> <filepath>libcrt0.lib</filepath> </p> </entry> <entry><p>Multithreaded 'glue code' library. Provides the <xref href="GUID-92602438-C8AC-3E15-ABB1-DCB8E8771E0C.dita"><apiname>E32Main()</apiname></xref> entry point for a <filepath>.exe</filepath> that uses the char <xref href="GUID-13E4A48A-07DB-34E6-B220-C4B134D6DF13.dita"><apiname>main()</apiname></xref> function. </p> </entry> </row> <row><entry><p> <codeph>STDEXE</codeph> </p> </entry> <entry><p> <filepath>libwcrt0.lib</filepath> </p> </entry> <entry><p>Multithreaded 'glue code' library. Provides the <codeph>E32Main()</codeph> entry point for a <filepath>.exe</filepath> that uses the wide char <codeph>main()</codeph> function. </p> </entry> </row> <row><entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph> </p> </entry> <entry><p> <filepath>euser.lib</filepath>, <filepath>backend.lib</filepath> </p> </entry> <entry><p>Fundamental libraries that are linked by default for <codeph>STDEXE</codeph> s and <codeph>STDDLL</codeph> s. </p> </entry> </row> <row><entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph> </p> </entry> <entry><p> <filepath>\epoc32\include\stdapis</filepath> </p> </entry> <entry><p>Location of standard header files for P.I.P.S.. </p> </entry> </row> </tbody> </tgroup> </table> <p>The new target types for P.I.P.S. are <codeph>STDEXE</codeph>, <codeph>STDDLL</codeph> and <codeph>STDLIB</codeph> (<codeph>STDLIB</codeph> s are the P.I.P.S. static libraries). For <codeph>STDLIB</codeph> s, the user need not annotate source with <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> or <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref>. All symbols with <codeph>extern</codeph> linkage are: </p> <ol id="GUID-9D6A6BB0-C2DC-50F5-B5D4-97CBD381D10A"><li id="GUID-7828C346-6ED2-5B6A-B89D-12D988FED39E"><p>exported if they are defined in the module, and </p> </li> <li id="GUID-42BFE700-719A-5DE9-8732-30E82DBAE304"><p>imported if they are referred to but not defined. </p> </li> </ol> <p>The compiler marks the symbols imported/exported for <codeph>STDLIB</codeph> s, while for native Static Libraries the user explicitly needs to specify <codeph>EXPORT_C</codeph> /<codeph>IMPORT_C</codeph>. </p> </section> <section id="GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA"><title>WCHARENTRYPOINT - new keyword</title> <p>The user should include the new keyword <codeph>WCHARENTRYPOINT</codeph> in MMP files to select the <xref href="GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D.dita#GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D/GUID-49C7F951-8317-5F41-B1B9-9F7B8803E655">Glue code (CRT0)</xref> library for the wide char main entry point, <filepath>libwcrt0.lib</filepath>. This option is valid only for the <codeph>STDEXE</codeph> target type and will be ignored if used with other target types. </p> </section> <section id="GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E"><title>External functions and symbols exported by default </title> <p>With a <codeph>STDDLL</codeph> library, functions and data with external linkage are exported by default, without any requirement for the <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref> and <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> declarations in header or source files. It is important to note that in the Linux world all symbols with external linkage are visible outside a shared object. </p> <p>When porting C APIs to Symbian platform, the user should use the new <codeph>STDDLL</codeph> target type to indicate to the tool chain that all functions and global data should be exported. </p> </section> </conbody></concept> |
12 <concept id="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B" xml:lang="en"><title>Target |
|
13 Types</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <ul> |
|
15 <li id="GUID-2254E482-D730-5661-9878-6B90F17977F4"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B">Generation of STDEXE, STDDLL and STDLIB</xref> </p> </li> |
|
16 <li id="GUID-F57FF724-6A83-5746-B85E-7548B8BD911A"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA">WCHARENTRYPOINT - new keyword</xref> </p> </li> |
|
17 <li id="GUID-D9117869-204F-51ED-8E40-F6D5F4D5889B"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E">External functions and symbols exported by default</xref> </p> </li> |
|
18 </ul> |
|
19 <section id="GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B"><title>Generation |
|
20 of STDEXE, STDDLL and STDLIB</title> <p>The introduction of two new Symbian |
|
21 platform target types, <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph>, |
|
22 was required to enable the specific options for compilers and linkers to generate |
|
23 P.I.P.S. executables. </p> <p>P.I.P.S. executables are implemented using native |
|
24 Symbian platform executables linked statically to the glue code. The target |
|
25 types <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph> make symbol information |
|
26 available for lookup by name. </p> <p>For each new target type the following |
|
27 library files, system files and include paths are included <i>by default</i>. |
|
28 The table below shows the additional libraries and paths for the new target |
|
29 types. </p> <table id="GUID-8C82882E-0F2A-5CD0-B318-04FD5FC88A01"> |
|
30 <tgroup cols="3"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/> |
|
31 <tbody> |
|
32 <row> |
|
33 <entry><p> <b>Target Type</b> </p> </entry> |
|
34 <entry><p> <b>File/Path</b> </p> </entry> |
|
35 <entry><p> <b>Purpose</b> </p> </entry> |
|
36 </row> |
|
37 <row> |
|
38 <entry><p> <codeph>STDEXE</codeph> </p> </entry> |
|
39 <entry><p> <filepath>libcrt0.lib</filepath> </p> </entry> |
|
40 <entry><p>Multithreaded 'glue code' library. Provides the <xref href="GUID-92602438-C8AC-3E15-ABB1-DCB8E8771E0C.dita"><apiname>E32Main()</apiname></xref> entry |
|
41 point for a <filepath>.exe</filepath> that uses the char <xref href="GUID-13E4A48A-07DB-34E6-B220-C4B134D6DF13.dita"><apiname>main()</apiname></xref> function. </p> </entry> |
|
42 </row> |
|
43 <row> |
|
44 <entry><p> <codeph>STDEXE</codeph> </p> </entry> |
|
45 <entry><p> <filepath>libwcrt0.lib</filepath> </p> </entry> |
|
46 <entry><p>Multithreaded 'glue code' library. Provides the <codeph>E32Main()</codeph> entry |
|
47 point for a <filepath>.exe</filepath> that uses the wide char <codeph>main()</codeph> function. </p> </entry> |
|
48 </row> |
|
49 <row> |
|
50 <entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph> </p> </entry> |
|
51 <entry><p> <filepath>euser.lib</filepath>, <filepath>backend.lib</filepath> </p> </entry> |
|
52 <entry><p>Fundamental libraries that are linked by default for <codeph>STDEXE</codeph> s |
|
53 and <codeph>STDDLL</codeph> s. </p> </entry> |
|
54 </row> |
|
55 <row> |
|
56 <entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph> </p> </entry> |
|
57 <entry><p> <filepath>\epoc32\include\stdapis</filepath> </p> </entry> |
|
58 <entry><p>Location of standard header files for P.I.P.S.. </p> </entry> |
|
59 </row> |
|
60 </tbody> |
|
61 </tgroup> |
|
62 </table> <p>The new target types for P.I.P.S. are <codeph>STDEXE</codeph>, <codeph>STDDLL</codeph> and <codeph>STDLIB</codeph> (<codeph>STDLIB</codeph> s are the P.I.P.S. static libraries). For <codeph>STDLIB</codeph> s, the |
|
63 user need not annotate source with <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> or <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref>. |
|
64 All symbols with <codeph>extern</codeph> linkage are: </p> <ol id="GUID-9D6A6BB0-C2DC-50F5-B5D4-97CBD381D10A"> |
|
65 <li id="GUID-7828C346-6ED2-5B6A-B89D-12D988FED39E"><p>exported if they are |
|
66 defined in the module, and </p> </li> |
|
67 <li id="GUID-42BFE700-719A-5DE9-8732-30E82DBAE304"><p>imported if they are |
|
68 referred to but not defined. </p> </li> |
|
69 </ol> <p>The compiler marks the symbols imported/exported for <codeph>STDLIB</codeph> s, |
|
70 while for native Static Libraries the user explicitly needs to specify <codeph>EXPORT_C</codeph> /<codeph>IMPORT_C</codeph>. </p> </section> |
|
71 <section id="GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA"><title>WCHARENTRYPOINT |
|
72 - new keyword</title> <p>The user should include the new keyword <codeph>WCHARENTRYPOINT</codeph> in |
|
73 MMP files to select the <xref href="GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D.dita#GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D/GUID-49C7F951-8317-5F41-B1B9-9F7B8803E655">Glue |
|
74 code (CRT0)</xref> library for the wide char main entry point, <filepath>libwcrt0.lib</filepath>. |
|
75 This option is valid only for the <codeph>STDEXE</codeph> target type and |
|
76 will be ignored if used with other target types. </p> </section> |
|
77 <section id="GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E"><title>External functions |
|
78 and symbols exported by default </title> <p>With a <codeph>STDDLL</codeph> library, |
|
79 functions and data with external linkage are exported by default, without |
|
80 any requirement for the <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref> and <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> declarations |
|
81 in header or source files. It is important to note that in the Linux world |
|
82 all symbols with external linkage are visible outside a shared object. </p> <p>When |
|
83 porting C APIs to the Symbian platform, the user should use the |
|
84 new <codeph>STDDLL</codeph> target type to indicate to the tool chain that |
|
85 all functions and global data should be exported. </p> </section> |
|
86 </conbody></concept> |