News:

Come Chat with us live! Learn how HERE!

Main Menu

Compiling: "does not support x86-64" and "-mstackrealign"

Started by Mad_Joe, September 06, 2011, 01:52:44 AM

Mad_Joe

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:


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

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.

Quote from: tuple on February 15, 2008, 11:54:10 PMThats what we need, helpful players, not more powerful admins.

Mad_Joe

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

What did you edit in the Makefile? Just added -mstackrealign?
"The reports of my death are greatly exaggerated" ~Mark Twain

David

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

Quote from: Celestial_Rage on September 06, 2011, 08:29:55 AM
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.

Quote from: David on September 06, 2011, 11:16:00 AM
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

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.
Quote from: AngelKnight on September 24, 2010, 03:58:01 AM
eh, i prefer gregorian.net chat better than this. NO download and its LIVE!
:basilisk: FTW![wiki]basilisk[/wiki]

Mad_Joe

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

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

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

#10
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":


$ 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:

$ 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?

gimhael

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

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:


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

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).