Building cross compiler fails

I am after a ghc cross compiler. I have been cross compiling stuff for years and also built cross-compiling gcc from time to time but am having trouble building a cross-compiling ghc. I have read https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation and associated pages. In the ghc-7.8.3 directory I do ./configure --target=arm-linux-gnueabi -with-gcc=arm-linux-gnueabi-gcc but make eventually fails (in stage 1) configure: error: in `/home/jon/build/ghc-7.8.3/libraries/terminfo': configure:3386: arm-linux-gnueabi-gcc -o conftest -fno-stack-protector conftest.c -lncurses >&5 /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lncurses Firstly the requirement for termcap is surely unnecessary. We don't need it as the target will just be processing data. We do have an libncurses kicking about and I know _exactly_ what -L option to pass to (in this case) arm-linux-gnueabi-gcc to make this work but where to specify it to ghc's build system escapes me. I have tried setting CFLAGS, LDFLAGS, CONF_GCC_LINKER_OPTS_STAGE1 the configure commandline and also mk/build.mk .
From searching it is clear this has tripped people up time and time again and that there is something missing from the documentation.
So in summary please could https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation be updated to show where to specify the CFLAGS and LDFLAGS that should accompany the compiler specified with -with-gcc (or derived from --target). Also more generally could the build documentation show how to omit frills like curses and termcap if at all possible. Jon

Hi, cross-compilation with GHC is not ideal yet. I've hit your issue in the past to and solved this with wrapper and sysroot[1]. I think this should also work in your case. Karel [1]: https://ghcarm.wordpress.com/tag/cross-compiler/ On 10/14/14 02:23 PM, Jon Schneider wrote:
I am after a ghc cross compiler. I have been cross compiling stuff for years and also built cross-compiling gcc from time to time but am having trouble building a cross-compiling ghc.
I have read https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation and associated pages.
In the ghc-7.8.3 directory I do ./configure --target=arm-linux-gnueabi -with-gcc=arm-linux-gnueabi-gcc
but make eventually fails (in stage 1)
configure: error: in `/home/jon/build/ghc-7.8.3/libraries/terminfo': configure:3386: arm-linux-gnueabi-gcc -o conftest -fno-stack-protector conftest.c -lncurses>&5 /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lncurses
Firstly the requirement for termcap is surely unnecessary. We don't need it as the target will just be processing data.
We do have an libncurses kicking about and I know _exactly_ what -L option to pass to (in this case) arm-linux-gnueabi-gcc to make this work but where to specify it to ghc's build system escapes me.
I have tried setting CFLAGS, LDFLAGS, CONF_GCC_LINKER_OPTS_STAGE1 the configure commandline and also mk/build.mk .
From searching it is clear this has tripped people up time and time again and that there is something missing from the documentation.
So in summary please could https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation be updated to show where to specify the CFLAGS and LDFLAGS that should accompany the compiler specified with -with-gcc (or derived from --target).
Also more generally could the build documentation show how to omit frills like curses and termcap if at all possible.
Jon
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Jon Schneider
-
Karel Gardas