04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiler Command-line Options<br />

Note<br />

When building a System V or <strong>ARM</strong> Linux shared library, use<br />

--apcs /fpic together with --no_hide_all.<br />

Restrictions<br />

There are restrictions when you compile code with /ropi, or /rwpi, or /fpic.<br />

/ropi<br />

/rwpi<br />

The main restrictions when compiling with /ropi are:<br />

• The use of --apcs=/ropi is not supported when compiling C++.<br />

• Some constructs that are legal C do not work when compiled for<br />

--apcs=/ropi. For example:<br />

extern const int ci; // ro<br />

const int *p2 = &ci; // this static initialization<br />

// does not work with --apcs=/ropi<br />

To enable such static initializations to work, compile your code<br />

using the --lower_ropi option. For example:<br />

armcc --apcs=/ropi --lower_ropi<br />

The main restrictions when compiling with /rwpi are:<br />

• Some constructs that are legal C do not work when compiled for<br />

--apcs=/rwpi. For example:<br />

int i;<br />

// rw<br />

int *p1 = &i; // this static initialization<br />

// does not work with --apcs=/rwpi<br />

// --no_lower_rwpi<br />

To enable such static initializations to work, compile your code<br />

using the --lower_rwpi option. For example:<br />

armcc --apcs=/rwpi<br />

Note<br />

You do not have to specify --lower_rwpi, because this is the default.<br />

/fpic<br />

The main restrictions when compiling with /fpic are:<br />

• If you use --apcs=/fpic, the compiler exports only functions and<br />

data marked __declspec(dllexport).<br />

• If you use --apcs=/fpic and --no_hide_all on the same command<br />

line, the compiler uses default ELF dynamic visibility for all<br />

extern variables and functions that do not use __declspec(dll*).<br />

The compiler disables auto-inlining for functions with default ELF<br />

visibility.<br />

<strong>ARM</strong> DUI 0348C Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. 2-7<br />

ID101213<br />

Non-Confidential,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!