[cfe-dev] odcctools-20090808

Alexei Svitkine alexei.svitkine at gmail.com
Sat Aug 8 17:39:16 PDT 2009


Is it independent of Google's project to make cctools portable, as per:

http://code.google.com/p/toolwhip/

?

-Alexei

On Sat, Aug 8, 2009 at 5:45 PM, Peter O'Gorman<peter at pogma.com> wrote:
> Chris Lattner wrote:
>>
>> On Aug 8, 2009, at 2:03 PM, Peter O'Gorman wrote:
>>
>>> Hi,
>>>
>>> I spent some time a month or so ago bringing odcctools up to the latest
>>> Xcode-3.1.2 source release. I had planned to do more, but got distracted
>>> by work etc. So I thought I had better make some kind of release of what
>>> I had done.
>>
>> Hi Peter,
>>
>> What is odcctools?
>
> Sorry, I didn't say, did I. It is Apple's cctools and ld64, but patched
> for portability to build on other systems, making it possible to compile
> and link binaries on linux that will run on a darwin host.
>
> Peter
>
>>
>> -Chris
>>
>>>
>>> This release is only minimally tested, I built a couple of "hello world"
>>> type programs on my linux/x86 system and ran them on my darwin/x86
>>> machine without problems using both a gcc cross compiler and clang. No
>>> serious testing has been done. I have not tested it at all on darwin,
>>> though it did at least build for me once, a few weeks ago.
>>>
>>> Other notable things:
>>> ld64 has a -force_load flag to load all members of specific archives.
>>> (this is a feature from the iphoneos 3.0 source release).
>>> ld64 will use libLTO if configure detects it.
>>> Builds as for all 5 arches.
>>> requires libuuid.
>>>
>>> I don't have much time to devote to odcctools, however if you have
>>> problems, please do email me. If you want the problems fixed soon,
>>> sending patches will help.
>>>
>>> This release wouldn't have been possible without the previous work of
>>> Shantonu Sen, and Apple's release of the source code for all the
>>> projects that are required to build ld64 and cctools (I hope the sources
>>> for the new projects that are required to build the ld64/cctools for Mac
>>> OS X 10.6 are also made available when that is released).
>>>
>>> The tarball is available here (yes, it is just checked in to svn):
>>> http://svn.macosforge.org/repository/odcctools/release/odcctools-20090808.tar.bz2
>>>
>>> SHA1 sum is:
>>> 8099a75396d5ac1621f04c977212067d97e3c540
>>>
>>> The svn repository is hosted at macosforge.org
>>> (http://svn.macosforge.org/repository/odcctools/trunk/).
>>>
>>> For clang, I used this small patch to make sure that clang tried for
>>> <triple>-tool before trying plain tool:
>>> Index: lib/Driver/ToolChain.cpp
>>> ===================================================================
>>> --- lib/Driver/ToolChain.cpp    (revision 77972)
>>> +++ lib/Driver/ToolChain.cpp    (working copy)
>>> @@ -31,5 +31,8 @@
>>> llvm::sys::Path ToolChain::GetProgramPath(const Compilation &C,
>>>                                           const char *Name,
>>>                                           bool WantFile) const {
>>> +  std::string prefixedName = getTripleString() + "-" + Name;
>>> +  llvm::sys::Path prefixed =
>>> Host.getDriver().GetProgramPath(prefixedName.c_str(), *this, WantFile);
>>> +  if (prefixed.exists()) return prefixed;
>>>   return Host.getDriver().GetProgramPath(Name, *this, WantFile);
>>> }
>>>
>>> I am not sure that it is the "correct" way to do it, but it seemed to
>>> work for me.
>>>
>>> Also, I really like how, with clang, it is not necessary to build a
>>> cross compiler, just clang -ccc-host-triple i386-apple-darwin9.7 -c -o
>>> foo foo.c, and I have a working foo.
>>>
>>> Thanks,
>>> Peter
>>> --
>>> Peter O'Gorman
>>> http://pogma.com
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
> --
> Peter O'Gorman
> http://pogma.com
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list