xcodebuild and LLVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

xcodebuild and LLVM

John Criswell
Dear All,

Is there a way to convince xcodebuild to build bitcode files for LLVM
for an arbitrary Xcode project?  So far, I've been able to get
xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-gcc"
on the command line.  I've also managed to get LLVM bitcode generates
for intermediate files by using "CC="lvm-gcc -emit-llvm"; however, this
gives an error during linking stating that ld does not understand the
-emit-llvm option.

Thanks in advance.

-- John T.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Ted Kremenek-2

On Sep 3, 2008, at 3:12 PM, John Criswell wrote:

> Dear All,
>
> Is there a way to convince xcodebuild to build bitcode files for LLVM
> for an arbitrary Xcode project?  So far, I've been able to get
> xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-gcc"
> on the command line.  I've also managed to get LLVM bitcode generates
> for intermediate files by using "CC="lvm-gcc -emit-llvm"; however,  
> this
> gives an error during linking stating that ld does not understand the
> -emit-llvm option.
>
> Thanks in advance.
>
> -- John T.
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

In addition to specifying CC, xcodebuild also consults the environment  
variables LD and LDPLUSPLUS for your linker commands (for C and C++  
sources respectively).  I would try LD=llvm-gcc and LDPLUSPLUS=llvm-g+
+ respectively.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Mike Stump
In reply to this post by John Criswell
On Sep 3, 2008, at 3:12 PM, John Criswell wrote:
> Is there a way to convince xcodebuild to build bitcode files for LLVM
> for an arbitrary Xcode project?  So far, I've been able to get
> xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-gcc"
> on the command line.  I've also managed to get LLVM bitcode generates
> for intermediate files by using "CC="lvm-gcc -emit-llvm"; however,  
> this
> gives an error during linking stating that ld does not understand the
> -emit-llvm option.

In the LINK_SPEC just add %{emit-llvm: } before %{e*} or, if that  
doesn't work, try %<emit-llvm.  One of those should work.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Devang Patel

On Sep 3, 2008, at 5:58 PM, Mike Stump wrote:

> On Sep 3, 2008, at 3:12 PM, John Criswell wrote:
>> Is there a way to convince xcodebuild to build bitcode files for LLVM
>> for an arbitrary Xcode project?  So far, I've been able to get
>> xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-
>> gcc"
>> on the command line.  I've also managed to get LLVM bitcode generates
>> for intermediate files by using "CC="lvm-gcc -emit-llvm"; however,
>> this
>> gives an error during linking stating that ld does not understand the
>> -emit-llvm option.
>
> In the LINK_SPEC just add %{emit-llvm: } before %{e*} or, if that
> doesn't work, try %<emit-llvm.  One of those should work.

Just to clarify,  Mike is talking about modifying llvm-gcc here.

-
Devang
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

John Criswell
In reply to this post by Ted Kremenek-2
Dear Ted and All,

Thanks.  This has helped some.  However, I'm now getting errors from
libtool about an object being modified after free.

Is libtool supposed to work with LLVM bitcode files?  If so, would
grabbing the latest source potentially fix the problem (I'm currently
using XCode 3.1), or will I need a way to convince xcodebuild to use
something other than libtool?

-- John T.

Ted Kremenek wrote:

> On Sep 3, 2008, at 3:12 PM, John Criswell wrote:
>
>  
>> Dear All,
>>
>> Is there a way to convince xcodebuild to build bitcode files for LLVM
>> for an arbitrary Xcode project?  So far, I've been able to get
>> xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-gcc"
>> on the command line.  I've also managed to get LLVM bitcode generates
>> for intermediate files by using "CC="lvm-gcc -emit-llvm"; however,
>> this
>> gives an error during linking stating that ld does not understand the
>> -emit-llvm option.
>>
>> Thanks in advance.
>>
>> -- John T.
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>    
>
> In addition to specifying CC, xcodebuild also consults the environment
> variables LD and LDPLUSPLUS for your linker commands (for C and C++
> sources respectively).  I would try LD=llvm-gcc and LDPLUSPLUS=llvm-g+
> + respectively.
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>  

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Ted Kremenek-2
Hi John,

I'm not certain if libtool works with LLVM bitcode files, and I don't  
think that all of the tools that manipulate/inspect object files on  
Mac OS X understand bitcode files either.  I suspect that this will  
change over time.

I believe that Devang and others who implemented LTO on Mac OS X can  
probably provide you with specific details of tool support for bitcode  
files.

Ted

On Sep 9, 2008, at 12:13 PM, John Criswell wrote:

> Dear Ted and All,
>
> Thanks.  This has helped some.  However, I'm now getting errors from
> libtool about an object being modified after free.
>
> Is libtool supposed to work with LLVM bitcode files?  If so, would
> grabbing the latest source potentially fix the problem (I'm currently
> using XCode 3.1), or will I need a way to convince xcodebuild to use
> something other than libtool?
>
> -- John T.
>
> Ted Kremenek wrote:
>> On Sep 3, 2008, at 3:12 PM, John Criswell wrote:
>>
>>
>>> Dear All,
>>>
>>> Is there a way to convince xcodebuild to build bitcode files for  
>>> LLVM
>>> for an arbitrary Xcode project?  So far, I've been able to get
>>> xcodebuild to use LLVM by installing XCode 3.1 and using CC="llvm-
>>> gcc"
>>> on the command line.  I've also managed to get LLVM bitcode  
>>> generates
>>> for intermediate files by using "CC="lvm-gcc -emit-llvm"; however,
>>> this
>>> gives an error during linking stating that ld does not understand  
>>> the
>>> -emit-llvm option.
>>>
>>> Thanks in advance.
>>>
>>> -- John T.
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> [hidden email]         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>
>>
>> In addition to specifying CC, xcodebuild also consults the  
>> environment
>> variables LD and LDPLUSPLUS for your linker commands (for C and C++
>> sources respectively).  I would try LD=llvm-gcc and LDPLUSPLUS=llvm-
>> g+
>> + respectively.
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Devang Patel

On Sep 11, 2008, at 9:30 PM, Ted Kremenek wrote:

> Hi John,
>
> I'm not certain if libtool works with LLVM bitcode files, and I don't
> think that all of the tools that manipulate/inspect object files on
> Mac OS X understand bitcode files either.

Yes. Right now only ld recognizes LLVM bitcode files.

> I suspect that this will
> change over time.

Yes.

-
Devang
>
>
> I believe that Devang and others who implemented LTO on Mac OS X can
> probably provide you with specific details of tool support for bitcode
> files.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

Chris Lattner-2

On Sep 14, 2008, at 11:42 AM, Devang Patel wrote:

>
> On Sep 11, 2008, at 9:30 PM, Ted Kremenek wrote:
>
>> Hi John,
>>
>> I'm not certain if libtool works with LLVM bitcode files, and I don't
>> think that all of the tools that manipulate/inspect object files on
>> Mac OS X understand bitcode files either.
>
> Yes. Right now only ld recognizes LLVM bitcode files.
>
>
>> I suspect that this will
>> change over time.
>
> Yes.

In fact, Xcode 3.1.1 was recently released, and you can get it from  
here (with an ADC account):
https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20214

Xcode 3.1.1 fixes a large number of LTO bugs and a bunch of additional  
tools in the toolchain now understand LLVM bc files.

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: xcodebuild and LLVM

eyal keren
In reply to this post by Ted Kremenek-2
Ted Kremenek <kremenek <at> apple.com> writes:

> In addition to specifying CC, xcodebuild also consults the environment  
> variables LD and LDPLUSPLUS for your linker commands (for C and C++  
> sources respectively).  I would try LD=llvm-gcc and LDPLUSPLUS=llvm-g+
> + respectively.
>

Hi Ted,

This does not seem to work anymore if the xcode project has swift code inside
of it, do you have a suggestion?


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev