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

描述

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?

解决方案

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
日期 12/15/2012
状态 Active
Type 综合文章
的页面