UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 22525

11.1 EDK - Inline functions give errors during compilation when optimization is turned off

Description

When compiling code for the PPC using the EDK tools, the code contains some inline functions similar to the following:

extern inline void out_be8(volatile unsigned char *addr, unsigned int val) { ... }

The code works when compiled with optimization turned on, but when the optimization is turned off the compiler does not find some function calls in the header file. The error message is similar to the following:

"/cygdrive/c/edk_projects/simple_test/src/io.h:81: undefined reference to 'out_be8'"

How do I fix this problem?

Solution

Inlining of optimization functions works only if optimization is turned on in the compiler, unless the inline attribute "always_inline" is inserted.

The solution is to add following line as function prototype:

extern inline void out_be8(volatile unsigned char *addr, unsigned int val) __attribute__((always_inline));

AR# 22525
Date Created 09/04/2007
Last Updated 12/15/2012
Status Active
Type General Article