[Haskell-iPhone] ld: warning with HEAD

Maxwell Swadling maxwellswadling at gmail.com
Sat Dec 21 01:49:45 UTC 2013


Can you run arm-apple-darwin10-ghc  Blocks.hs -o Blocks.a ?

Also I'm not sure why you have a Main.a as well. You should link the Blocks.a in Xcode. You shouldn't need two .a's. 

__END__
Maxwell Swadling

> On 21 Dec 2013, at 12:43 pm, Carter Schonwald <carter.schonwald at gmail.com> wrote:
> 
> Aren't there some settings that need to be manipulated in Xcode? Like "don't run strip. Just don't"?  Are you doing that stuff?
> 
>> On Friday, December 20, 2013, Schell Scivally wrote:
>> Sorry in the last message I meant "(with the list of _warnings_ mentioned on the wiki)".
>> 
>> 
>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally <efsubenovex at gmail.com> wrote:
>> I'll sum up the process I'm going through. I `cd` into Blocks where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal --config-file=path/to/arm/config build`. The config file was created by arm-apple-darwin10-cabal the first time I ran it. The build ends in two different ways depending on the `ghc-options` field in the Blocks.cabal file. With ghc-options: -staticlib -threaded it errors (or warns, or outputs - as it isn't specified):
>> Resolving dependencies...
>> 
>> Configuring Blocks-0.1.0.0...
>> 
>> Building Blocks-0.1.0.0...
>> 
>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0...
>> 
>> Linking dist-arm/build/Blocks/Blocks.a ...
>> 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpthread
>> 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpthread is not an object file (not allowed in a library)
>> 
>> With ghc-options: -staticlib it looks like the build completes (with the list of errors mentioned on the wiki). I then have two libs, src/Main.a and dist-arm/build/Blocks/Blocks.a
>> 
>> I then add either Blocks.a or Main.a to my project (or both, which I've also tried). Then I build for my device with command-b. Both static libs are ignored for each architecture and then clang ends in a linker error. Here is the build log from Xcode: http://lpaste.net/97304 and my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: https://github.com/schell/blocks-ios/
>> 
>> Please let me know if you need more information. 
>> 
>> 
>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally <efsubenovex at gmail.com> wrote:
>> Currently I'm using `arm-apple-darwin10-cabal --config-file=path/to/my/arm/config build
>> 
>> The cabal file and the rest of the source can be found at https://github.com/schell/blocks-ios/
>> 
>> I'm following the directions at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much as possible but I don't really know how to use ghc to build all the files in a project (when I try it can't find the IOS.Touch module), which is why I'm trying to use cabal. That wiki page says nothing of using cabal so I'm assuming that I'm in dragon territory with most of this, so forgive me if I'm making some obvious mistake.
>> 
>> 
>> 
>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling <maxwellswadling at gmail.com> wrote:
>> How are you compiling the static library? What command are you using?
>> 
>> __END__
>> Maxwell Swadling
>> 
>>> On 21 Dec 2013, at 10:24 am, Schell Scivally <efsubenovex at gmail.com> wrote:
>>> 
>>> Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined:
>>> 
>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a
>>> 
>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/iphone/attachments/20131221/ea46247a/attachment.html>


More information about the iPhone mailing list