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.

Advertisements

3 Comments »

  1. Thank u a ton much… now there is hope :) seeing the path clear…

    Comment by ronybc — 20110613 @ 1039

    • Good to know that it was helpful. You’ve a nice site, keep it up :-)

      Comment by Ashish — 20130407 @ 0614

  2. Fine way of explaining, and good article to take data about my presentation topic,
    which i am going to deliver in university.

    Comment by ราคา ขาย เบอร์ สวย 777 — 20170531 @ 0457


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: