Author Topic: Compiling: "does not support x86-64" and "-mstackrealign"  (Read 8069 times)

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Compiling: "does not support x86-64" and "-mstackrealign"
« on: September 06, 2011, 01:52:44 am »
I'm trying to build Tremulous on Mac OS X 10.7 (Lion) on a Macbook Pro. When I run make, I get the following errors:

Code: [Select]
CC src/client/cl_cgame.c
src/client/cl_cgame.c:1: error: CPU you selected does not support x86-64 instruction set
src/client/cl_cgame.c:1: error: CPU you selected does not support x86-64 instruction set
src/client/cl_cgame.c:1: error: -mstackrealign not supported in the 64bit mode
make[2]: *** [build/release-darwin-x86/client/cl_cgame.o] Error 1

This only happens when I try compiling the client or the server. I can compile the QVM fine.

Any ideas what the issue is? My processor is an Intel Core i7--it should support x86-64, right?

Let me know if you need any more information. Thanks for the help.

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #1 on: September 06, 2011, 03:23:18 am »
What version/revision are you trying to build and how are you trying to build it?
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #2 on: September 06, 2011, 04:45:10 am »
I checked out the latest revision from svn.icculus.org/tremulous/trunk, and I'm building it just with make using Apple's gcc v4.2.1. I haven't messed around with any other configuration stuff except the Makefile.local dictating which things to build.

Celestial_Rage

  • Posts: 636
  • Turrets: +120/-8
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #3 on: September 06, 2011, 08:29:55 am »
What did you edit in the Makefile? Just added -mstackrealign?
"The reports of my death are greatly exaggerated" ~Mark Twain

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #4 on: September 06, 2011, 11:16:00 am »
None of the mac stuff has been updated since Tiger, so it's possible Lion broke something.

I'm not sure who's currently responsible for the mac support.

You could try running "ARCH=x86 make" to get a 32bit version, that's what make-macosx-ub.sh does.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #5 on: September 06, 2011, 02:10:55 pm »
What did you edit in the Makefile? Just added -mstackrealign?

I didn't edit anything in the Makefile itself, just added a Makefile.local specifying BUILD_CLIENT, BUILD_SERVER, etc. The Makefile references -mstackrealign in line 389.

You could try running "ARCH=x86 make" to get a 32bit version, that's what make-macosx-ub.sh does.

Hmm, funny... when I try that I get the same errors. In fact, when I run "make" straight, it seems to set by itself ARCH to x86. I tried make-macosx-ub.sh, but it tells me I need the proper Mac OS X SDKs installed, without telling me what those are, haha.

Thanks for everyone's help so far.

c4

  • Posts: 554
  • Turrets: +9/-22
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #6 on: September 06, 2011, 08:48:53 pm »
I know you're trying to build tremulous, but why?  I specifically tested the default GPP client and Kiwi's SEGFAULT port to mac on OSX 10.7 betas and found no errors.
eh, i prefer gregorian.net chat better than this. NO download and its LIVE!
 :basilisk: FTW![wiki]basilisk[/wiki]

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #7 on: September 06, 2011, 09:16:41 pm »
Oh yeah, to be sure, the OS X client seems to work great. I want to tinker around and see how stuff works, and have the knowledge to implement an improvement when one occurs to me.

doomagent13

  • Posts: 506
  • Turrets: +18/-18
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #8 on: September 06, 2011, 11:36:16 pm »
By my experiences, you need to add "CC=gcc-4.0" to the beginning of any attempt at building the client and/or server.  You may need the OS X 10.4 SDK to get gcc-4.0...  I will admit to not having Lion or the latest version of Xcode.

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #9 on: September 08, 2011, 02:38:38 pm »
You're right, I need something else other than the OS X 10.7 SDK to get gcc-4.0. In the process of looking for a way to get it...

wack-a-mole

  • Posts: 1
  • Turrets: +0/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #10 on: September 12, 2011, 05:19:03 pm »
I'm having the exact same problem on Snow Leopard. Mad_Joe, where you able to get to the bottom of this?

Here's what I get when I run "ARCH=x86 make":


Code: [Select]
$ ARCH=x86 make

DED_CC src/qcommon/vm.c
src/qcommon/vm.c:1: error: CPU you selected does not support x86-64 instruction set
src/qcommon/vm.c:1: error: CPU you selected does not support x86-64 instruction set
src/qcommon/vm.c:1: error: -mstackrealign not supported in the 64bit mode
make[2]: *** [build/release-darwin-x86/ded/vm.o] Error 1
make[1]: *** [targets] Error 2
make: *** [release] Error 2

If I add "CC=gcc-4.0" as doomagent13 suggested, things seem to advance a little bit more but it fails with a different error:

Code: [Select]
$ ARCH=x86 CC=gcc-4.0 make

DED_CC src/qcommon/vm.c
src/qcommon/vm.c: In function ‘VM_Call’:
src/qcommon/vm.c:759: warning: implicit declaration of function ‘va_start’
src/qcommon/vm.c:761: warning: implicit declaration of function ‘va_arg’
src/qcommon/vm.c:761: error: syntax error before ‘int’
src/qcommon/vm.c:763: warning: implicit declaration of function ‘va_end’
make[2]: *** [build/release-darwin-x86/ded/vm.o] Error 1
make[1]: *** [targets] Error 2
make: *** [release] Error 2

Any ideas?
« Last Edit: September 12, 2011, 05:37:54 pm by wack-a-mole »

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #11 on: September 12, 2011, 06:38:28 pm »
The -mstackrealign switch is no longer needed, the one place where the stack could become unaligned has been fixed some time ago, so the only remaining purpose of the switch is to make the program slow.

The vm.c error looks like a missing stdarg.h include - try to add an #include <stdarg.h> near the top of vm.c and see if that helps.

Mad_Joe

  • Posts: 67
  • Turrets: +4/-0
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #12 on: September 13, 2011, 01:32:46 pm »
Nope, I  haven't gotten it working yet.

If I take out -mstackrealign, it doesn't give me that error but still gives me the "CPU doesn't support x86-64" error:

Code: [Select]
CC src/client/cl_cgame.c
src/client/cl_cgame.c:1: error: CPU you selected does not support x86-64 instruction set
src/client/cl_cgame.c:1: error: CPU you selected does not support x86-64 instruction set
make[2]: *** [build/release-darwin-x86/client/cl_cgame.o] Error 1
make[1]: *** [targets] Error 2
make: *** [release] Error 2

It's the same whether I run "make" or "ARCH=x86 make".

Aelita

  • Posts: 742
  • Turrets: +147/-34
Re: Compiling: "does not support x86-64" and "-mstackrealign"
« Reply #13 on: September 18, 2011, 03:04:38 pm »
Do you have a -march/-mcpu/-mtune (don't remember which is deprecated and which isn't) flag set? You'll probably want to try -march=native or -march=corei7 (but be aware the resulting binaries likely won't run anywhere but your machine or other machines with similar hardware. Older gcc versions might not have -march=corei7 either, but I don't know what 10.7 has).