Make GCC build x86_64 code on default

Discussion in 'Mac Programming' started by Ravernomina, Jul 26, 2010.

  1. Ravernomina macrumors member

    Nov 15, 2009
    Hello everyone. As the top says i would like to change the default Architecture from i686 to x86_64 for gcc. Can anyone tell me how to do this? Thanks!
  2. rdyornot macrumors newbie

    Sep 15, 2007
  3. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Alternatively, I believe clang defaults to 64 bit. Switching to it has other benefits as well.
  4. misee macrumors member

    Jul 4, 2010
    Theres also a compiler switch. I think it's -xarch_x86_64 (check the man page for valid architectures). Then, you could create an alias if you compile in your terminal. For bash & co. that would be
    alias gcc_64 gcc -xarch_x86_64
    Then you can just type gcc_64 instead of gcc.

Share This Page