weblog d’un abbe

20060718

GCC architecture specific preprocessor defines

Filed under: Hacking, Research — abbe @ 0256

Want to write architecture specific code in C language, precisely for GCC, and doesn’t how to separate architecture specific code, hmmm… Below is the hint:

[abbe@chateau-d-lf: ~]$ echo | gcc -E -dM -

It will list all the preprocessor defines defined by your GCC. So, you’ve to just figure out your target architecture’s preprocessor define. To compile code for 32 bit architecture from a non 32-bit architecture (say, a 64bit architecture, or a 128-bit architecure :) ), use -m32 switch of GCC. Here is the corresponding thread from gnu.gcc.help USENET group.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.