Tremulous Forum
General => Troubleshooting => Topic started by: Mad_Joe 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:
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.
-
What version/revision are you trying to build and how are you trying to build it?
-
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.
-
What did you edit in the Makefile? Just added -mstackrealign?
-
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.
-
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.
-
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.
-
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.
-
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.
-
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...
-
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?
-
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.
-
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".
-
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).