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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
8,183 Views
Registered: ‎09-19-2014

C Preprocessor predefined macro for Xilinx standalone OS

Jump to solution

Is there a predefined macro to indicate the compiler is for the Xilinx standalone OS? E.g. __linux__ macro is predefined to indicate the compiler is targetting the Linux OS.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
14,415 Views
Registered: ‎09-19-2014

Re: C Preprocessor predefined macro for Xilinx standalone OS

Jump to solution

Actually, the answer to my question is therefore "no".

 

I did a diff between your two predefined Linux and predefined Xilinx standalone outputs. The only extra macro that was in the Xilinx standalone compiler that was not in the Linux compiler was:

#define __USES_INITFINI__ 1

 

And I don't think that's a satisfactory way of determining if we are targetting the Xilinx standalone OS.

View solution in original post

0 Kudos
2 Replies
Scholar sampatd
Scholar
7,679 Views
Registered: ‎09-05-2011

Re: C Preprocessor predefined macro for Xilinx standalone OS

Jump to solution

Yes, it does.

 

Use the following command to get a dump of all the compiler predefined macros:

 

arm-xilinx-linux-gnueabi-gcc -dM -E - < /dev/null >predefine_linux.txt

 

output is attached. 

 

For standalone, refer to this post:

https://forums.xilinx.com/t5/Embedded-Development-Tools/LwIP-example-appliction-why-is-arm-not-defined-in-the-LwIP-stack/m-p/675870#M38785

0 Kudos
Highlighted
Adventurer
Adventurer
14,416 Views
Registered: ‎09-19-2014

Re: C Preprocessor predefined macro for Xilinx standalone OS

Jump to solution

Actually, the answer to my question is therefore "no".

 

I did a diff between your two predefined Linux and predefined Xilinx standalone outputs. The only extra macro that was in the Xilinx standalone compiler that was not in the Linux compiler was:

#define __USES_INITFINI__ 1

 

And I don't think that's a satisfactory way of determining if we are targetting the Xilinx standalone OS.

View solution in original post

0 Kudos