[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#853285: ghc: Patch to add support for cross-compilation of GHC

On 01/31/2017 08:17 PM, Helmut Grohne wrote:
> On Tue, Jan 31, 2017 at 09:20:46AM +0100, John Paul Adrian Glaubitz wrote:
>>   Setting "--target" allows enabling cross-compiling, adding
>>   --enable-unregisterised is important for architectures not
>>   having native code generation support. Disabling the documentation
>>   is required by GHC itself. Trying to build the documentation
>>   when cross-compiling causes an error message.
> I'm not entirely sold on the idea that we cannot cross build haddock.
> What about using the haddock from the ghc:native package to build the
> documentation? But then maybe I understand too little of the
> requirements here.

Oh, I'm absolutely with you on this. The problem is just that GHC upstream
currently doesn't support building the documentation when cross-building
because of these lines in the main ghc.mk makefile:

ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
$(error Can not build haddock docs when CrossCompiling or Stage1Only. \
  Set HADDOCK_DOCS=NO in your mk/build.mk file. \
  See Note [No stage2 packages when CrossCompiling or Stage1Only])

> In any case, disabling haddock should not be a thing that just happens
> for cross compilation. We want cross builds to be reproducible (when
> compared against native builds). So disabling haddock should be a
> concious choice (even if cross building without disabling haddock
> doesn't work). Also building ghc without haddock should produce a
> package that doesn't list haddock under Provides. This calls for a build
> profile. So I went ahead and split out this part of your patch into a
> patch that adds a pkg.ghc.nohaddock build profile.

I actually want the cross-built GHC package to match the natively built
package as closely as possible because I prefer it as an alternative to
building GHC on slower architectures. Building GHC on m68k can take
over 20 days since m68k also doesn't have a native code generator.

> I hope that this makes sense and that the resulting profile is useful
> for cross compiling ghc. Do you agree?

As long as the cross-built GHC package can be fully used on the target
system, I'm all for these changes. But, as I explained in my initial
report, the are still issues with ghc-pkg when trying to build haskell-text
that I haven't resolved yet.


 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply to: