Make GCC build x86_64 code on default

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

  1. Ravernomina macrumors member

    Joined:
    Nov 15, 2009
    #1
    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

    Joined:
    Sep 15, 2007
    #2
  3. Catfish_Man macrumors 68030

    Catfish_Man

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

    Joined:
    Jul 4, 2010
    #4
    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
    Code:
    alias gcc_64 gcc -xarch_x86_64
    Then you can just type gcc_64 instead of gcc.
     

Share This Page