[GHC] #8746: Crosscompiling

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Keywords: Crosscompile | Operating System: Linux cross compile failed ncurses | Type of failure: Building GHC setupterm not found | failed Architecture: Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Hello! I tried to crosscompile from linux i386 to arm-linux-gnueabihf, but i cant make it happen, because it gives me this weird error while running 'make': {{{ checking ncurses.h usability... yes checking ncurses.h presence... yes checking for ncurses.h... yes checking for setupterm in -ltinfo... no checking for setupterm in -lncursesw... no checking for setupterm in -lncurses... no checking for setupterm in -lcurses... no configure: error: in '/home/edi/ghc_cross/ghc/libraries/terminfo': configure: error: curses library not found, so this package cannot be built See 'config.log' for more details make[2]: *** [libraries/terminfo/dist-install/package-data.mk] Error 1 make[1]: *** [all_libraries/terminfo] Error 2 make[1]: Leave Directory '/home/edi/ghc_cross/ghc' make: *** [all] Error 2 }}} What have i done: -) Compiled 7.8.0 from github (The log says 'That should have been 7.8.0', i chose 7.8 because i thought it would be more stable for crosscompiling) to my i386 (normal boot, configure, make, make install). This worked fine -) installed newest llvm from svn (LLVM version 3.5svn) -) replaced the libffi-3.0.11.tar.gz in ghc/libffi-tarballs with libffi-3.0.13 -) added this version of mk/build.mk: {{{ SRC_HC_OPTS = -H32m _o -fasm -Rghc-timing GhcStage1HcOpts = -O -fasm GhcStage2HcOpts = -O0 -DDEBUG -Wall GhcLibHcOpts = -O -fasm -XGenerics GhcLibWays = v dyn SplitObjs = NO Stage1Only = YES }}} -) downloaded the sourcecode of ncurses from http://ftp.de.debian.org/debian/pool/main/n/ncurses/ncurses_5.9.orig.tar.gz and builded it with "./configure arm-linux-gnueabihf --with-gcc=arm-linux- gnueabihf-gcc --target=arm-linux-gnueabihf --prefix=/usr/arm-linux- gnueabihf " + "make". afterwards i added the folder to my $PATH -)did "perl boot", "./configure --target=arm-linux-gnueabihf --with-gcc =arm-linux-gnueabihf-gcc --prefix=/usr/arm-linux-gnueabihf" and "make". ./configure worked, but make gives me this weird error. I also tried copying all included files from ncurses to the libraries/terminfo folder, but that also didn't work. I think the mistake is somewhere in the building process, but i'm not exactly sure, so thats why i'm posting this bug. Does anyone have an idea about that? PS: i also made sure that i met the prerequirements mentioned in https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux and https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling Greetings, Edi -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.2 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Crosscompile Operating System: Linux | cross compile failed ncurses Type of failure: Building GHC | setupterm not found failed | Architecture: Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: 7.8.1 => 7.8.2 Comment: Oh dear. If I remember correctly, the problem is that we sort of work- arounded it by commenting out `terminfo` for the Raspberry Pi cross compilers, but never found a real solution. It should be disabled, really (terminfo is only needed by haskeline, and haskeline is only needed by GHCi - which doesn't exist in a cross compilers.) One solution is just commenting out `terminfo` and `haskeline` from `ghc.mk`, I believe? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling
-------------------------------------+-------------------------------------
Reporter: Visionstar | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.8.2
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords: Crosscompile
Operating System: Linux | cross compile failed ncurses
Type of failure: Building GHC | setupterm not found
failed | Architecture: Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
-------------------------------------+-------------------------------------
Comment (by Visionstar):
Thank you very much for your response!
i somehow managed to go past this 'bug' by doing the following:
I configured the ncurses library like this:
{{{
./configure arm-linux-gnueabihf --with-gcc=arm-linux-gnueabihf-gcc
--target=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf --with-
shared --host=arm-linux-gnueabihf --with-build-cpp=arm-linux-gnueabihf-g++
}}}
Afterwards i did the "make" and added it to the path
Then i used the ./configure with an "sysroot" command command for GHC like
this:
{{{
--target=arm-linux-gnueabihf --with-gcc=arm-linux-gnueabihf-gcc --with-
shared --enable-unregisterised
}}}
Which probably didn't change anything, but it got me past that problem
with ncurses.
'''''But''''' i have now another problem: i get the following error when i
try to 'make' the application:
{{{
when making flags consistent: Warning:
Compiler unregisterised, so compiling via C
<

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.2 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Crosscompile Operating System: Linux | cross compile failed ncurses Type of failure: Building GHC | setupterm not found failed | Architecture: Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: -------------------------------------+------------------------------------- Comment (by Visionstar): Replying to [comment:1 thoughtpolice]:
Oh dear. If I remember correctly, the problem is that we sort of work- arounded it by commenting out `terminfo` for the Raspberry Pi cross compilers, but never found a real solution. It should be disabled, really (terminfo is only needed by haskeline, and haskeline is only needed by GHCi - which doesn't exist in a cross compilers.) One solution is just commenting out `terminfo` and `haskeline` from `ghc.mk`, I believe?
Thank you for your reply I replied to my own topic, check it out. Also: in which rows do i have to remove haskeline+terminfo? Thanks, Edi -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.8.1-rc1 Resolution: | Keywords: | Crosscompile cross compile failed | ncurses setupterm not found Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Build System -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.8.1-rc1 Resolution: invalid | Keywords: Crosscompile | cross compile failed ncurses | setupterm not found Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => invalid Comment: I'm afraid that cross-compiling isn't very well supported at the moment. I'm going to close this ticket as it has been inactive for some time. Visionstar, feel free to come speak to us in `#ghc` if you want further assistance. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.8.1-rc1 Resolution: | Keywords: Crosscompile | cross compile failed ncurses | setupterm not found Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: closed => new * resolution: invalid => Comment: I'd like to keep this one open. Users shouldn't have to comment out `terminfo` in the build system. That is something we can fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8746: Crosscompiling -------------------------------------+------------------------------------- Reporter: Visionstar | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.8.1-rc1 Resolution: invalid | Keywords: Crosscompile | cross compile failed ncurses | setupterm not found Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: I agree with thomie's sentiments, but: * `terminfo` already builds just fine when cross-compiling, so long as you have installed the terminfo C library properly for your cross-compiler. https://github.com/neurocyte/ghc-android does this for you for the case of cross-compiling to Android, and it sounds like the original reporter also got it to work eventually. * I'm guessing the "Unsupported GHC version" error was a result of an improperly checked-out GHC source tree, as described at https://mail.haskell.org/pipermail/ghc-devs/2014-March/004294.html. (My fuzzy understanding is that Haddock is built by the stage 2 compiler anyways, according to comments in `ghc.mk`, so perhaps it doesn't make sense to do anything with Haddock when cross-compiling. (But the error clearly shows something being built with `ghc-stage1`, so what's up with that?) In any case, one doesn't get this error if one sets `HADDOCK_DOCS = NO`.) So, going to close this again. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8746#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC