Joined: 22 Jul 2007
|Posted: Mon Aug 22, 2011 2:10 pm Post subject: toolwhip (Mac OS X cross-compiler) on Gentoo with newer GCC
|Has anyone tried this?
Google is apparently using it to better automate building for Mac OS X without the need for Macs to be present.
I get as far as building ld64 properly (after some simple patching) and then gcc fails to build because ranlib/libtool crashes:
http://code.google.com/p/toolwhip/issues/detail?id=10 (I'm not the only one)
I tried solving the issue (details in the bug report), spent a few hours with it but nothing useful yet.
Can anyone actually build this thing in newer GCC? According to the bug report, that person was able to solve it by building with GCC 4.1. After finally merging 4.1 (there seem to be some lingering issues regarding -march primarily), I compiled cctools and ld64 again but still no go on GCC at the exact same point as shown in the bug report.
If you want to build ld64 you need to:
#include <stdio.h> in ld64/src/Options.h (I put it after stdint.h)
Move the class definition of BaseAtom above this line:
template <typename A>
Reference<A>::Reference(Kinds kind, const AtomAndOffset& at, const AtomAndOffset& toTarget)
: fFixUpOffsetInSrc(at.offset), fToTarget(toTarget), fToTargetName(NULL), fFromTargetName(NULL),
Then there are a few places to place the word typename before mach_o::relocatable::Reader<ppc>::Reader-like patterns:
|+ return this->addObject(new typename mach_o::relocatable::Reader<ppc>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); |
grep for return\ this->addObject\(new and similar.