forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ps2toolchain on Mac OS X Leopard Intel

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
umjammer



Joined: 15 Jan 2009
Posts: 2

PostPosted: Thu Jan 15, 2009 9:40 pm    Post subject: ps2toolchain on Mac OS X Leopard Intel Reply with quote

Question

I could not build ps2toolchain on Mac OS X Leopard (intel).
I got errors as follows.

log of toolchain.sh
Code:

/usr/local/src/ps2toolchain/build/gcc-3.2.2/build-ee-stage1/gcc/xgcc -B/usr/loca
l/src/ps2toolchain/build/gcc-3.2.2/build-ee-stage1/gcc/ -B/usr/local/ps2dev/ee/e
e/bin/ -B/usr/local/ps2dev/ee/ee/lib/ -isystem /usr/local/ps2dev/ee/ee/include -
O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmi
ssing-prototypes -isystem ./include  -G 0 -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEE
DED -Dinhibit_libc -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/config -I../../
gcc/../include  -DL_muldi3 -c ../../gcc/libgcc2.c -o libgcc/./_muldi3.o
/usr/local/src/ps2toolchain/build/gcc-3.2.2/build-ee-stage1/gcc/xgcc -B/usr/loca
l/src/ps2toolchain/build/gcc-3.2.2/build-ee-stage1/gcc/ -B/usr/local/ps2dev/ee/e
e/bin/ -B/usr/local/ps2dev/ee/ee/lib/ -isystem /usr/local/ps2dev/ee/ee/include -
O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmi
ssing-prototypes -isystem ./include  -G 0 -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEE
DED -Dinhibit_libc -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/config -I../../
gcc/../include  -DL_negdi2 -c ../../gcc/libgcc2.c -o libgcc/./_negdi2.o
FATAL:/usr/bin/../libexec/gcc/darwin/i386/as: I don't understand 'G' flag!
FATAL:/usr/bin/../libexec/gcc/darwin/i386/as: I don't understand 'G' flag!
make[2]: *** [libgcc/./_negdi2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[1]: *** [libgcc.a] Error 2
make: *** [all-gcc] Error 2


What I did

* patch binutils like psptoolchain for osx patches.
* patch config.gcc to support i686-apple-darwin9.6.0

My Environment
Code:

 $ uname -a
 Darwin xxx.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24
 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 i386
 MacBookPro5,1 Darwin

Code:

 $ svn info
 URL: svn://svn.ps2dev.org/ps2/trunk/ps2toolchain
 :
 Revision: 1502
 :
 Last Changed Date: 2007-08-23 18:23:49 +0900 (Thu, 23 Aug 2007)

Code:

 $gcc --version
 i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)


* I succeed to build psptoolchain on this environment.

Help me!
Back to top
View user's profile Send private message
umjammer



Joined: 15 Jan 2009
Posts: 2

PostPosted: Tue Jan 20, 2009 10:41 pm    Post subject: Success to build! Reply with quote

Result

I succeed to build ps2toolchain on Mac OS X Leopard (Intel)!

Cause

I forgot to strip .dSYM in binutils...
Quote:

ee/ee/bin/*.dSYM
iop/iop/bin/*.dSYM
dvp/dvp/bin/*.dSYM


Patch

I give you my patches.

http://www.mediafire.com/?m1yyi2zyndj
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Jan 21, 2009 3:25 am    Post subject: Reply with quote

I would much rather apply these patches directly to the source rather than hack them into the ps2toolchain script.

Will these changes affect building the software on non-OSX machines?
Back to top
View user's profile Send private message Visit poster's website
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Wed Jan 21, 2009 8:13 am    Post subject: Reply with quote

The gcc patch is fine. The binutils patches will break setups using a cross compiler to build the ps2 toolchain for other hosts. They won't affect anything when compiling the ps2 toolchain with a native toolchain, unless the native toolchain is broken as the test checking for that is commented.
Back to top
View user's profile Send private message
druckluft



Joined: 20 Jan 2004
Posts: 2
Location: Denmark

PostPosted: Mon Jan 26, 2009 8:23 am    Post subject: Reply with quote

Thanks for the patch. Using it I managed to install the toolchain on macos 10.5.5. But I had to make a few other changes for it to work.

The problem was the three configure scripts for binutils2.14/bfd binutils2.14/binutils and binutils2.14/opcodes. They all stop with an error saying the native macos gcc compiler does not work. This has to do with the way the configure scripts figure out the suffix for executables (for example .exe). To find the suffix (variable ac_cv_exeext) the scripts run gcc on conftest.c and detect what files are created with name conftest.*. Files ending with .c .o .obj .ilk .pdb are ignored. Seeing the newly created directory conftest.dSYM the configure scripts think that this is the exefile and that .dSYM is the suffix. This causes trouble later when the script tries to compile a file with that name which it cannot since there already is a directory with that name. One solution to the problem is to add .dSYM to the list of endings that should be ignored. This requires change of 2-3 lines in each of the three configure scripts.

I have no experience in making patches, so I thought I would just write this comment here to help others with the same problem.

The GNU_FTP variable must also be set for the patch to work.
Back to top
View user's profile Send private message Visit poster's website
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Tue Jan 27, 2009 9:47 am    Post subject: Reply with quote

I saw a patch that did that in the PSP forums for the psp toolchain as well. I think gcc still appended the .dSYM suffix to the exectuables during the compile or install phase, though, since they needed to be stripped off afterwards. Would doing
Code:
export EXEEXT=""
help at all?
Back to top
View user's profile Send private message
druckluft



Joined: 20 Jan 2004
Posts: 2
Location: Denmark

PostPosted: Thu Jan 29, 2009 5:49 am    Post subject: Reply with quote

No, unfortunately just doing
Code:
export EXEEXT=""

before running the toolchain.sh script does not work:

Code:
configure: error: installation or configuration problem: C compiler cannot create executables
Back to top
View user's profile Send private message Visit poster's website
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Thu Jan 29, 2009 11:57 am    Post subject: Reply with quote

Ahh, ok. Thanks for trying :D. I'll snoop around the net for some more info.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group