OLD | NEW |
1 ###################################### | 1 ###################################### |
2 Dynamic Linking and Loading with glibc | 2 Dynamic Linking and Loading with glibc |
3 ###################################### | 3 ###################################### |
4 | 4 |
5 .. contents:: | 5 .. contents:: |
6 :local: | 6 :local: |
7 :backlinks: none | 7 :backlinks: none |
8 :depth: 2 | 8 :depth: 2 |
9 | 9 |
10 .. Note:: | 10 .. Note:: |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 SDK toolchains | 105 SDK toolchains |
106 -------------- | 106 -------------- |
107 | 107 |
108 The Native Client SDK contains multiple toolchains, which are differentiated by | 108 The Native Client SDK contains multiple toolchains, which are differentiated by |
109 :ref:`target architecture <target_architectures>` and C library: | 109 :ref:`target architecture <target_architectures>` and C library: |
110 | 110 |
111 =================== ========= =============================== | 111 =================== ========= =============================== |
112 Target architecture C library Toolchain directory | 112 Target architecture C library Toolchain directory |
113 =================== ========= =============================== | 113 =================== ========= =============================== |
114 x86 newlib toolchain/<platform>_x86_newlib | |
115 x86 glibc toolchain/<platform>_x86_glibc | 114 x86 glibc toolchain/<platform>_x86_glibc |
116 ARM newlib toolchain/<platform>_arm_newlib | 115 ARM glibc toolchain/<platform>_arm_glibc |
| 116 x86 newlib toolchain/<platform>_pnacl |
| 117 ARM newlib toolchain/<platform>_pnacl |
117 PNaCl newlib toolchain/<platform>_pnacl | 118 PNaCl newlib toolchain/<platform>_pnacl |
118 =================== ========= =============================== | 119 =================== ========= =============================== |
119 | 120 |
120 In the directories listed above, <platform> is the platform of your development | 121 In the directories listed above, <platform> is the platform of your development |
121 machine (i.e., win, mac, or linux). For example, in the Windows SDK, the x86 | 122 machine (i.e., win, mac, or linux). For example, in the Windows SDK, the x86 |
122 toolchain that uses glibc is in ``toolchain/win_x86_glibc``. | 123 toolchain that uses glibc is in ``toolchain/win_x86_glibc``. |
123 | 124 |
124 .. Note:: | 125 .. Note:: |
125 :class: note | 126 :class: note |
126 | 127 |
127 **Note:** The ARM and PNaCl toolchains are currently restricted to newlib. | 128 **Note:** The PNaCl toolchain is currently restricted to newlib. |
128 | 129 |
129 To use the glibc library and dynamic linking in your application, you **must** | 130 To use the glibc library and dynamic linking in your application, you **must** |
130 use a glibc toolchain. (Currently the only glibc toolchain is | 131 use a glibc toolchain. Note that you must build all code in your application |
131 ``<platform>_x86_glibc``.) Note that you must build all code in your application | |
132 with one toolchain. Code from multiple toolchains cannot be mixed. | 132 with one toolchain. Code from multiple toolchains cannot be mixed. |
133 | 133 |
134 Specifying and delivering shared libraries | 134 Specifying and delivering shared libraries |
135 ------------------------------------------ | 135 ------------------------------------------ |
136 | 136 |
137 One significant difference between newlib and glibc applications is that glibc | 137 One significant difference between newlib and glibc applications is that glibc |
138 applications must explicitly list and deploy the shared libraries that they | 138 applications must explicitly list and deploy the shared libraries that they |
139 use. | 139 use. |
140 | 140 |
141 In a desktop environment, when the user launches a dynamically linked | 141 In a desktop environment, when the user launches a dynamically linked |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 into a Native Client executable (.nexe). | 199 into a Native Client executable (.nexe). |
200 | 200 |
201 Run ``make`` in the dlopen directory to see the commands the Makefile executes | 201 Run ``make`` in the dlopen directory to see the commands the Makefile executes |
202 to build x86 32-bit and 64-bit .nexe and .so files, and to generate a .nmf | 202 to build x86 32-bit and 64-bit .nexe and .so files, and to generate a .nmf |
203 file. These commands are described below. | 203 file. These commands are described below. |
204 | 204 |
205 .. Note:: | 205 .. Note:: |
206 :class: note | 206 :class: note |
207 | 207 |
208 **Note:** The Makefiles for most of the examples in the SDK build the | 208 **Note:** The Makefiles for most of the examples in the SDK build the |
209 examples using multiple toolchains (x86 newlib, x86 glibc, ARM, and PNaCl). | 209 examples using multiple toolchains (x86 newlib, x86 glibc, ARM newlib, ARM |
210 With a few exceptions (listed in the :ref:`Release Notes | 210 glibc, and PNaCl). With a few exceptions (listed in the :ref:`Release Notes |
211 <sdk-release-notes>`), running "make" in each example's directory builds | 211 <sdk-release-notes>`), running "make" in each example's directory builds |
212 multiple versions of the example using the SDK toolchains. The dlopen example | 212 multiple versions of the example using the SDK toolchains. The dlopen example |
213 is one of those exceptions – it is only built with the x86 glibc toolchain, | 213 is one of those exceptions – it is only built with the x86 glibc toolchain, |
214 as that is currently the only toolchain that supports glibc and thus dynamic | 214 as that is currently the only toolchain that supports glibc and thus dynamic |
215 linking and loading. Take a look at the example Makefiles and the generated | 215 linking and loading. Take a look at the example Makefiles and the generated |
216 .nmf files for details on how to build dynamically linked applications. | 216 .nmf files for details on how to build dynamically linked applications. |
217 | 217 |
218 .. _dynamic_loading_manifest: | 218 .. _dynamic_loading_manifest: |
219 | 219 |
220 Generating a Native Client manifest file for a dynamically linked application | 220 Generating a Native Client manifest file for a dynamically linked application |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 **undefined reference to 'dlopen' collect2: ld returned 1 exit status** | 429 **undefined reference to 'dlopen' collect2: ld returned 1 exit status** |
430 This is a linker ordering problem that usually results from improper ordering | 430 This is a linker ordering problem that usually results from improper ordering |
431 of command line flags when linking. Reconfigure your command line string to | 431 of command line flags when linking. Reconfigure your command line string to |
432 list libraries after the -o flag. | 432 list libraries after the -o flag. |
433 | 433 |
434 .. |menu-icon| image:: /images/menu-icon.png | 434 .. |menu-icon| image:: /images/menu-icon.png |
435 .. _objdump: http://en.wikipedia.org/wiki/Objdump | 435 .. _objdump: http://en.wikipedia.org/wiki/Objdump |
436 .. _GLIBC: http://www.gnu.org/software/libc/index.html | 436 .. _GLIBC: http://www.gnu.org/software/libc/index.html |
437 .. _POSIX: http://en.wikipedia.org/wiki/POSIX | 437 .. _POSIX: http://en.wikipedia.org/wiki/POSIX |
438 .. _newlib: http://sourceware.org/newlib/ | 438 .. _newlib: http://sourceware.org/newlib/ |
OLD | NEW |