[GHC] #7639: Fix installation issues with cross compiling + honour Stage1Only properly

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Installing GHC failed | Blockedby: Blocking: | Related: ----------------------------------+----------------------------------------- This patch fixes three problems that occur during a cross compile to embedded Linux (details below): 1. arm-ldu-linux-gnueabi-ghc-pkg gets a symlink but no wrapper script upon installation, and this causes the installation to break later when it tries to run it. 2. hp2ps doesn't get the prefix like the other commands do (i.e. arm-ldu- linux-gnueabi-ghc- is missing from the name of the executable). This is just for consistency. 3. The stage2 compiler is built when Stage1Only is set to YES (though it does not get installed). This makes the build take longer than it needs to. mk/build.mk: SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES configure command: ./configure --target=arm-ldu-linux-gnueabi --prefix=/usr/local/ghc-ldu -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Installing GHC failed | Blockedby: Blocking: | Related: ----------------------------------+----------------------------------------- Changes (by StephenBlackheath): * status: new => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7639: Fix installation issues with cross compiling + honour Stage1Only properly
----------------------------------+-----------------------------------------
Reporter: StephenBlackheath | Owner:
Type: bug | Status: patch
Priority: normal | Component: Compiler
Version: 7.7 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Installing GHC failed | Blockedby:
Blocking: 7610 | Related:
----------------------------------+-----------------------------------------
Comment(by marlowsd@…):
commit b0fad0c580e0dd52d73743a877608af60408ec89
{{{
Author: Simon Marlow

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Installing GHC failed | Blockedby: Blocking: 7610 | Related: ----------------------------------+----------------------------------------- Comment(by StephenBlackheath): In case it's helpful, with this patch I am suggesting in this ticket... {{{ --- a/utils/ghc-pkg/ghc.mk +++ b/utils/ghc-pkg/ghc.mk @@ -99,6 +99,7 @@ utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL = YES utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL_SHELL_WRAPPER_NAME = ghc- pkg-$(ProjectVersion) utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL_INPLACE = NO +utils/ghc-pkg_$(GHC_PKG_DISTDIR)_WANT_INSTALLED_WRAPPER = YES ifeq "$(BootingFromHc)" "YES" utils/ghc-pkg_dist-install_OTHER_OBJS += $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_RTS_LIBS) $(libffi_STATIC_LIB) }}} ...if it isn't applied, then this is what I get (latest head, git hash ca5d15a61c45d6ea763872df46efe5c7b33f8186): {{{ blackh@amentet:~/src/ghc-ldu/ghc$ sudo make install ... ...snip... ... /usr/bin/install -c -m 644 utils/hsc2hs/template-hsc.h "/usr/local/ghc- ldu/lib/ghc-7.7.20130203" /usr/bin/install -c -m 755 -d "/usr/local/ghc-ldu/bin" "rm" -f "/usr/local/ghc-ldu/bin/arm-ldu-linux-gnueabi-ghc-pkg" ln -s arm-ldu-linux-gnueabi-ghc-pkg-7.7.20130203 "/usr/local/ghc-ldu/bin /arm-ldu-linux-gnueabi-ghc-pkg" /usr/bin/install -c -m 755 -d "/usr/local/ghc-ldu/bin" "rm" -f "/usr/local/ghc-ldu/bin /arm-ldu-linux-gnueabi-ghc-7.7.20130203" ... ...snip... ... /usr/local/ghc-ldu/lib/ghc-7.7.20130203/transformers-0.3.0.0 "/usr/local/ghc-ldu/lib/ghc-7.7.20130203/bin/ghc-pkg" --force --global- package-db "/usr/local/ghc-ldu/lib/ghc-7.7.20130203/package.conf.d" update rts/package.conf.install /bin/sh: /usr/local/ghc-ldu/lib/ghc-7.7.20130203/bin/ghc-pkg: No such file or directory make[1]: *** [install_packages] Error 127 make: *** [install] Error 2 blackh@amentet:~/src/ghc-ldu/ghc$ ls -l /usr/local/ghc-ldu/bin/ total 8 lrwxrwxrwx 1 root root 38 Feb 4 13:09 arm-ldu-linux-gnueabi-ghc -> arm- ldu-linux-gnueabi-ghc-7.7.20130203 -rwxr-xr-x 1 root root 308 Feb 4 13:09 arm-ldu-linux-gnueabi- ghc-7.7.20130203 lrwxrwxrwx 1 root root 42 Feb 4 13:09 arm-ldu-linux-gnueabi-ghc-pkg -> arm-ldu-linux-gnueabi-ghc-pkg-7.7.20130203 -rwxr-xr-x 1 root root 1113 Feb 4 13:09 arm-ldu-linux-gnueabi-hsc2hs blackh@amentet:~/src/ghc-ldu/ghc$ }}} So, arm-ldu-linux-gnueabi-ghc-pkg is a dangling symlink. If I then apply the patch, then the wrapper arm-ldu-linux-gnueabi-ghc- pkg-7.7.20130203 gets installed and the problem goes away. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ----------------------------------+----------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Installing GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: 7610 Related: | ----------------------------------+----------------------------------------- Changes (by simonmar): * difficulty: => Unknown Comment: Ok, a fix for the `ghc-pkg` issue is coming (I didn't understand the fix, so spent some time looking at it, and I think I've done it in a slightly cleaner way). Regarding the stage 2 issue, strictly speaking building `compiler/stage2` is correct, because it is the `ghc` package that can be used with the cross-compiler. If you don't want to build it, then setting `stage = 1` in your `mk/build.mk` should disable it. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7639: Fix installation issues with cross compiling + honour Stage1Only properly
----------------------------------+-----------------------------------------
Reporter: StephenBlackheath | Owner:
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Installing GHC failed
Difficulty: Unknown | Testcase:
Blockedby: | Blocking: 7610
Related: |
----------------------------------+-----------------------------------------
Comment(by marlowsd@…):
commit 0403da668db740c70c606329021fcfd0164c2573
{{{
Author: Simon Marlow

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ------------------------------------+--------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Build System | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Installing GHC failed | Difficulty: Unknown Testcase: | Blockedby: Blocking: 7610 | Related: ------------------------------------+--------------------------------------- Changes (by simonmar): * status: patch => closed * resolution: => fixed * component: Compiler => Build System * milestone: => 7.8.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7639: Fix installation issues with cross compiling + honour Stage1Only properly ------------------------------------+--------------------------------------- Reporter: StephenBlackheath | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Build System | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Installing GHC failed | Difficulty: Unknown Testcase: | Blockedby: Blocking: 7610 | Related: ------------------------------------+--------------------------------------- Comment(by StephenBlackheath): Thanks. Will try out 'stage = 1' and add a note to the CrossCompiling wiki page if it does the trick. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7639#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC