1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.8.�Object File Portability</title><link rel="stylesheet" href="cs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Sourcery CodeBench Lite"><link rel="up" href="chap-target.html" title="Chapter�3.�Sourcery CodeBench Lite for ARM EABI"><link rel="prev" href="arm-mcount.html" title="3.7.�ARM Profiling Implementation"><link rel="next" href="chap-building.html" title="Chapter�4.�Using Sourcery CodeBench from the Command Line"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.8.�Object File Portability</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="arm-mcount.html">Prev</a>�</td><th width="60%" align="center">Chapter�3.�Sourcery CodeBench Lite for ARM EABI</th><td width="20%" align="right">�<a accesskey="n" href="chap-building.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="portable-objects"></a>3.8.�Object File Portability</h2></div></div></div><p> 2 It is possible to create object files using Sourcery CodeBench for 3 ARM 4 EABI 5 that are link-compatible with the 6 GNU C library provided with Sourcery CodeBench for ARM 7 GNU/Linux as well as with the CodeSourcery C Library or 8 Newlib C Library provided with 9 ARM bare-metal toolchains. 10 <span> 11 These object files are additionally link-compatible with 12 other ARM C Library ABI-compliant static linking environments 13 and toolchains. 14 </span> 15 16 </p><p> 17 To use this feature, when compiling your files with the bare-metal 18 ARM 19 EABI 20 toolchain define the preprocessor constant 21 <code class="constant">_AEABI_PORTABILITY_LEVEL</code> to 1 22 before including any system header files. 23 For example, pass the option <code class="option">-D_AEABI_PORTABILITY_LEVEL=1</code> 24 on your compilation command line. 25 No special options are required when linking the resulting object files. 26 When building applications for ARM 27 EABI, 28 files compiled with this definition may be linked freely with those 29 compiled without it. 30 </p><p> 31 Files compiled in this manner may not use the 32 functions <code class="function">fgetpos</code> 33 or <code class="function">fsetpos</code>, or reference the 34 type <code class="type">fpos_t</code>. This is because Newlib assumes a 35 representation for <code class="type">fpos_t</code> that is not AEABI-compliant. 36 </p><p> 37 Note that object files are only portable from bare-metal toolchains 38 to GNU/Linux, and 39 not vice versa; object files compiled for ARM 40 GNU/Linux targets cannot be linked into ARM 41 EABI 42 executables. 43 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="arm-mcount.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="chap-target.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="chap-building.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.7.�ARM Profiling Implementation�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�4.�Using Sourcery CodeBench from the Command Line</td></tr></table></div></body></html> 44