[GHC] #7690: iOS patch no 1: Select operating system

#7690: iOS patch no 1: Select operating system ------------------------------+--------------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Other | Architecture: arm Failure: None/Unknown | Blockedby: Blocking: | Related: ------------------------------+--------------------------------------------- This is the first in a series of patches for adding cross-compile ability for iOS. For now, 'arm-apple-darwin10' will be interpreted as iOS. Later we will need to tweak this to detect the difference between the iOS simulator (with an i386 cpu) and the native Mac. I am creating a new logical OS name 'ios' because the differences between iOS and Mac can be quite significant. I thought it would we best not to introduce the idea of an OS variant (as we did with ARM cpus) for two reasons: 1. it's over-complicating the issue and 2. it would require some modification of cabal. Versioning: I'm submitting patch version 1a here. If I have to revise a patch, I'll bump the letter. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ------------------------------+--------------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Other | Architecture: arm Failure: None/Unknown | Blockedby: Blocking: | Related: ------------------------------+--------------------------------------------- Changes (by StephenBlackheath): * status: new => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ------------------------------+--------------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Other | Architecture: arm Failure: None/Unknown | Blockedby: Blocking: | Related: ------------------------------+--------------------------------------------- Changes (by chak): * cc: chak@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ------------------------------+--------------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Other | Architecture: arm Failure: None/Unknown | Blockedby: Blocking: | Related: ------------------------------+--------------------------------------------- Comment(by chak): Stephen, it's great to see progress on this! I had a look at the patch (well, actually the `master-merge-ios` branch in the ghc-ios repo on !GitHub) and noticed that the changes in https://github.com/ghc-ios/ghc/blob/master-merge- ios/compiler/deSugar/DsForeign.lhs hardcoded iOS-specific settings, which can be traced back to this patch: https://github.com/ghc- ios/ghc/commit/6f01b16ba94c275683fccdc748f0b6e95f94e5d0 (e.g., the setting of `libFFI` and the removal of `insertRetAddr`) — it might be worthwhile to double check that that patch didn't hardcoded platform-specifics in other places as well. Do you know how to get at the platform info in `DsForeign`? Moreover, my compile dies with {{{ Configuring ghctags-0.1... Configuring ghc-pwd-0.1... Configuring ghc-pkg-6.9... Configuring hsc2hs-0.67... Configuring haddock-2.13.2... ghc-cabal: At least the following dependencies are missing: terminfo -any make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [all] Error 2 }}} (I wonder why we are using crappy Trac instead of !GitHub for such discussions?!?) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ------------------------------+--------------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Other | Architecture: arm Failure: None/Unknown | Blockedby: Blocking: | Related: ------------------------------+--------------------------------------------- Comment(by StephenBlackheath): Yes, master-merge-ios is full of iOS-specific changes hard-coded in, left over from the "just get it working" phase of the project, which I am in the process of progressively cleaning up. The patch I submitted here is not intended to actually do anything useful yet when you select iOS as a target. I mainly just need to know whether this method of OS selection is acceptable so I can get on with the rest of the work. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Os: Other Architecture: arm | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Changes (by simonmar): * difficulty: => Unknown Comment: Rather than adding `TargetPlatform_GNU`, could you use the existing `TargetPlatformFull`? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Os: Other Architecture: arm | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Comment(by StephenBlackheath): Hey chak & anyone who wants to build our work in progress at https://github.com/ghc-ios/, some instructions. There is currently some breakage with a Cabal change needed. {{ git clone git@github.com:ghc-ios/ghc.git git checkout master-merge-ios ./sync-all --no-dph get }} the usual cross-compile build.mk {{ cat > mk/build.mk << EOF HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO SPLIT_OBJS = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES EOF perl boot cp arm-apple-darwin10-bin/* ~/bin # or anywhere in your path PATH=~/bin:$PATH ./configure --target=arm-apple-darwin10 --prefix=/usr/local/ghc-ios-armv7/ make sudo make install }} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Os: Other Architecture: arm | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Comment(by StephenBlackheath): (Let's try that again.) Hey chak & anyone who wants to build our work in progress in the master- merge-ios branch at https://github.com/ghc-ios/, some instructions. There is currently some breakage with a Cabal change needed. {{{ git clone git@github.com:ghc-ios/ghc.git git checkout master-merge-ios ./sync-all --no-dph get }}} the usual cross-compile build.mk {{{ cat > mk/build.mk << EOF HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO SPLIT_OBJS = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES EOF perl boot cp arm-apple-darwin10-bin/* ~/bin # or anywhere in your path PATH=~/bin:$PATH ./configure --target=arm-apple-darwin10 --prefix=/usr/local/ghc-ios-armv7/ make sudo make install }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7690#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7690: iOS patch no 1: Select operating system
--------------------------------+-------------------------------------------
Reporter: StephenBlackheath | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Resolution: fixed | Keywords:
Os: Other | Architecture: arm
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
--------------------------------+-------------------------------------------
Changes (by igloo):
* status: patch => closed
* resolution: => fixed
Comment:
Applied, thanks:
{{{
commit 94914b967be27ae04cdba098d9557bbf161639c5
Author: Ian Lynagh
participants (1)
-
GHC