Ticket #7709 (closed feature request: fixed)

Opened 3 months ago

Last modified 5 weeks ago

ios patch no 7: Omit ghc-pwd from final stage when cross compiling

Reported by: StephenBlackheath Owned by: igloo
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: #7724 Related Tickets:

Description

Without this patch, we get this error when cross compiling:

"cp" -p utils/ghc-pwd/dist-install/build/tmp/ghc-pwd inplace/bin/ghc-pwd
cp: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd: No such file or directory
make[1]: *** [inplace/bin/ghc-pwd] Error 1
make: *** [all] Error 2

Attachments

ios-patch-7a-omit-ghc-pwd-from-final-for-cross-compile.patch Download (0.5 KB) - added by StephenBlackheath 3 months ago.
iOS patch 7 rev a: Omit ghc-pwd from final stage when cross compiling

Change History

Changed 3 months ago by StephenBlackheath

iOS patch 7 rev a: Omit ghc-pwd from final stage when cross compiling

Changed 3 months ago by StephenBlackheath

  • status changed from new to patch

Changed 3 months ago by StephenBlackheath

  • type changed from bug to feature request

Changed 3 months ago by StephenBlackheath

  • blocking 7724 added

Changed 3 months ago by igloo

  • difficulty set to Unknown

I'm confused about what's going on here. Why isn't ghc-pwd built when cross-compiling?

Changed 3 months ago by StephenBlackheath

  • owner set to StephenBlackheath

Sorry - I am pretty sure I got this wrong. I'll have to figure it out and get back to you.

Changed 3 months ago by igloo

  • owner StephenBlackheath deleted
  • status changed from patch to new

OK, thanks

Changed 3 months ago by StephenBlackheath

Here's what's going on: ghc-pwd is built in the final stage and so it's for the target. Our iOS compiler generates .a files in place of executables, so it produces ghc-pwd.a.

Unfortunately it's not as simple as just changing exeext to .a, because we need to make sure a different exeext is used for host and target executables.

Should I just go through all the exeexts and change them based on whether it's host or target? Or is it better to keep it simple and come up with a way to avoid ghc-pwd being installed into inplace/bin/ when Stage1Only=YES is selected in mk/build.mk (as we do when building cross compilers)?

Changed 3 months ago by igloo

  • owner set to igloo

Ah, I see. We'd also have problems if anyone wanted to cross-compile to/from Windows.

I think we may be able to do this in a tidier way; I'll take a look.

Changed 6 weeks ago by igloo

  • milestone set to 7.8.1

Changed 5 weeks ago by ian@…

commit d65a61dfa99e613a3f16b85e592b1e35270d4098

Author: Ian Lynagh <ian@well-typed.com>
Date:   Sat Apr 20 18:51:18 2013 +0100

    Use different exeext variables for each stage; fixes #7709
    
    Currently they are all set to the same value, but when cross-compiling
    they could be set to different values.

 driver/ghci/ghc.mk     |    2 +-
 mk/project.mk.in       |    5 ++++-
 rules/build-prog.mk    |    2 +-
 utils/ghc-cabal/ghc.mk |    5 +++--
 utils/runghc/ghc.mk    |    2 +-
 5 files changed, 10 insertions(+), 6 deletions(-)

Changed 5 weeks ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Done

Note: See TracTickets for help on using tickets.