[Haskell-iPhone] Targeting armv7 and armv7s

Stephen Blackheath [to GHC-iPhone] likeliest.complexions.stephen at blacksapphire.com
Wed Feb 27 14:25:43 CET 2013


Luke,

I tried your script with -march=armv7s and it didn't seem to work for 
me. I'm using a very recent XCode, namely 4.6 (4H127). My linker said

ld: warning: ignoring file /Users/blackh/src/Pear/haskell.a, file was 
built for archive which is not the architecture being linked (armv7): 
/Users/blackh/src/Pear/haskell.a

...which I assume means I have armv7s but no armv7

Your xcrun command confirms it with

input file haskell.a is not a fat file
Not-fat file: haskell.a is architecture: armv7s

I experimented and was able to build fat .o files (see below). Perhaps 
we can make a fancy arm-apple-darwin10-gcc script that will do it for 
each .o as we go. (But what does llvm do?)


Steve

-----------------------------------------------------
stephen-blackheaths-mac-mini:temp blackh$ vi ~/bin/arm-apple-darwin10-gcc
stephen-blackheaths-mac-mini:temp blackh$ arm-apple-darwin10-gcc -c -o 
fat.o fat.c
stephen-blackheaths-mac-mini:temp blackh$ otool -h fat.o
fat.o:
Mach header
       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds 
flags
  0xfeedface      12          9  0x00          1     3        500 0x00002000
stephen-blackheaths-mac-mini:temp blackh$ vi ~/bin/arm-apple-darwin10-gcc
stephen-blackheaths-mac-mini:temp blackh$ arm-apple-darwin10-gcc -c -o 
fat7.o fat.c
stephen-blackheaths-mac-mini:temp blackh$ vi ~/bin/arm-apple-darwin10-gcc
stephen-blackheaths-mac-mini:temp blackh$ arm-apple-darwin10-gcc -c -o 
fat7s.o fat.c
stephen-blackheaths-mac-mini:temp blackh$ lipo fat7.o fat7s.o -create 
-output fat.o
stephen-blackheaths-mac-mini:temp blackh$ otool -h fat.o
fat.o (architecture armv7):
Mach header
       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds 
flags
  0xfeedface      12          9  0x00          1     3        500 0x00002000
fat.o (architecture armv7s):
Mach header
       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds 
flags
  0xfeedface      12         11  0x00          1     3        500 0x00002000
stephen-blackheaths-mac-mini:temp blackh$
-----------------------------------------------------

On 23/02/13 13:10, Luke Iannini wrote:
> I actually just discovered a happy fact last night: changing -march to
> armv7s in env.sh and rebuilding results in a compiler that automagically
> builds a fat binary containing armv7 and armv7s! This is on
> master-merge-ios, so it's possible it's due to something new but give it
> a try!
>
> (you can check what architectures a .a contains with "xcrun -sdk
> iphoneos lipo -info <libname>.a")
>
> Cheers
> Luke
>
>
> On Fri, Feb 22, 2013 at 11:49 AM, Peter Jones <mlists at pmade.com
> <mailto:mlists at pmade.com>> wrote:
>
>     Robert Lorentz <robert.lorentz at me.com
>     <mailto:robert.lorentz at me.com>> writes:
>      > You can build 2 cross compilers yes - and fat elf them together.
>     I got
>      > that to work - I posted the details to this list previously - good
>      > luck
>
>     Robert, which post are you referring to?  Google can't seem to find it.
>     Here is the search I did:
>
>        Lorentz site:http://www.haskell.org/pipermail/iphone/
>
>     Thanks.
>
>     --
>     Peter Jones --- Love to Develop
>     303-219-0226 <tel:303-219-0226> http://devalot.com
>
>     _______________________________________________
>     iPhone mailing list
>     iPhone at haskell.org <mailto:iPhone at haskell.org>
>     http://www.haskell.org/mailman/listinfo/iphone
>
>
>
>
> _______________________________________________
> iPhone mailing list
> iPhone at haskell.org
> http://www.haskell.org/mailman/listinfo/iphone
>



More information about the iPhone mailing list