Advertisement

angelscript and xcode 2.4

Started by September 24, 2006 02:11 PM
42 comments, last by urkle 18 years, 1 month ago
I am having some difficulties compiling Angelscript on OS X 10.4.7 w/ Xcode 2.4 If I compile using the GNUC makefile it does build, however it doesn't build a PIC library (Position Indipendant Code) which is required in order to link angelscript to another library. So I can not link angelscript w/ the game engine library I am porting. ../dependencies/lib/macosx/libangelscript.a(as_callfunc_ppc.o) has local relocation entries in non-writable section (__TEXT,__text) However, if I load up the XCode project ALL files compile except for one.. the as_callfunc_ppc.cpp (ie.. the most important one IMHO). I do not receive a line number for the error just an error message of: {standard input}:unknown:missing indirect symbols for section (__TEXT,__picsymbolstub1__TEXT) The gcc commandline arguments are as follows /usr/bin/gcc-4.0 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -mtune=G5 -mmacosx-version-min=10.4 -I/Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/build/angelscript.build/Release/as.build/as.hmap -F/Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/build/Release -I/usr/include -I/Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/build/Release/include -I/Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/build/angelscript.build/Release/as.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c /Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/../../source/as_callfunc_ppc.cpp -o /Users/urkle/Projects/penumbra/angelscript-2.7.0/angelscript/projects/xcode/build/angelscript.build/Release/as.build/Objects-normal/ppc/as_callfunc_ppc.o http://www.gamedev.net/community/forums/topic.asp?topic_id=395625 [Edited by - urkle on September 25, 2006 11:39:22 PM]
It would be best if someone that already uses AngelScript on Mac OS X could take a look at this.

I do not have access to Mac OS X myself so I cannot help you out on this.

However, you should be able to use the library in portability mode, by definining the AS_MAX_PORTABILITY flag when compiling the library. You'll have to write wrapper functions using the asCALL_GENERIC calling convention, but at least it works.

Let me know if you figure out the solution, so that I can include it in the official version.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
i've cleaned up and maede that piece of code compile in macosx some time ago.
i think i've used gcc 3.x to compile it. and at least it was compiling and linking
on my machine (ppc g4 - xcode 2.3), but there was errors trying to make it running...
dunnow why you are encoutering some errors in linking, maybe try switch your compiler
to a previous version (i.e. not use 4.x)...
Quote: Original post by kunitoki
i've cleaned up and maede that piece of code compile in macosx some time ago.
i think i've used gcc 3.x to compile it. and at least it was compiling and linking
on my machine (ppc g4 - xcode 2.3), but there was errors trying to make it running...
dunnow why you are encoutering some errors in linking, maybe try switch your compiler
to a previous version (i.e. not use 4.x)...


Tried that already.. Tried compiling with gcc3.3 and same thing occured. And this is a fresh clean install of Xcode 2.4.

Did you compile yours w/ PIC or without PIC?
Quote: Original post by kunitoki
i've cleaned up and maede that piece of code compile in macosx some time ago.
i think i've used gcc 3.x to compile it. and at least it was compiling and linking
on my machine (ppc g4 - xcode 2.3), but there was errors trying to make it running...
dunnow why you are encoutering some errors in linking, maybe try switch your compiler
to a previous version (i.e. not use 4.x)...


Update..

I figured out why the "gnuc" makefile project compiles.. the ppc source file hadn't been added to it.

The error I'm getting is Gcc3.3 AND 4.0 not liking the way the assembly is done.. as if I comment it out,it compiled (though it obviously wouldn't work then :-D )

i don't know exactly, but i think i was compiling without pic. anyway i was using xcode 2.3, and the ppc file was currently in the project...
some time passed from when i had checked this, but since i needed to focus on
other stuff, i leaved it for a while.
Advertisement
OK.. I got it compiling w/ PIC enabled now.

And you'll laugh at the fix.

I added ".text\n" to the beginning of the asm ("") block.

Also, the as_config.h needs to be updated to check for __i386__ and NOT __INTEL__
as __INTEL__ isn't defined in gcc4.0.1 (at least), however __i386__ is defined when compiling -arch i386.

next to see if it works and do further debugging (already went through and read up on the ABI.. pretty icky).
nice... i was really really stuck when i tried to debug that. it seems that the bytecode generated is correct,
but when running it some strange things happens, since i'm not that guru of ppc asm programming...
kunitoki, were you at aLL successful in getting things running on PPC? even in PORTABILITY mode?

As right now I've compiled up the test_features app and it's segfaulting in the asCContext::ExecuteNext function. and while stepping through that function in GDB on the mac and comparing it w/ walking it through my linux box (x86) I am seeing some nice discrpencies of which AngelScript instructions it's trying to run.

example..

the first 2 words are as follows:

00000062 00000040

And on the PPC Mac it calculates the first instruction as
BC_POP, where as the linux box iterprets it as BC_PGA. So the VM (ExecuteNext) and/or compile is not taking into account the endianess of the PPC.

So either the compiler needs to take into account the endianess and swap the bytes there for the interpreter, or the interprater needs to swap the bytes as it's interpreting (probably having the compiler adjust them would be faster)
I know AngelScript is working on PPC in portability mode. It is already being used in some projects.

I wish I could help. It's frustrating to see that you're having so much trouble getting my library to work.

[edit]Apparently I didn't know so well ;)[/edit]

[Edited by - WitchLord on October 4, 2006 7:38:54 PM]

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement