Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,358
    • Issues 5,358
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 566
    • Merge requests 566
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18143
Closed
Open
Issue created May 05, 2020 by Sergei Trofimovich@trofiReporter

Cross-compilation from linux to windows broke (stage1 uses local rts headers, not system ones).

Building ghc as:

$ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-w64-mingw32 --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/ghc-9999 --htmldir=/usr
/share/doc/ghc-9999/html --libdir=/usr/lib64 AR=x86_64-w64-mingw32-ar CC=x86_64-w64-mingw32-gcc Windres=x86_64-w64-mingw32-windres DllWra
p=x86_64-w64-mingw32-dllwrap --disable-ld-override LD=x86_64-w64-mingw32-ld --enable-bootstrap-with-devel-snapshot --disable-dwarf-unwind
 --disable-numa

fails in the following way:

$ make
...
"/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/bin/ghc" -optc-O2 -optc-pipe -optc-Wall -optc-Icompiler/stage1/build/./autogen -optc-Icompiler/. -optc-Icompiler/stage1 -optc-Icompiler/stage1/build/. -optc-Icompiler/stage1/build/stage1 -optc-Iincludes/dist/build -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/process-1.6.8.2/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/process-1.6.8.2/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/unix-2.7.2.2/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/unix-2.7.2.2/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/time-1.9.3/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/time-1.9.3/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/bytestring-0.10.10.0/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/bytestring-0.10.10.0/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/base-4.14.0.0/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/base-4.14.0.0/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/integer-gmp-1.0.3.0/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/integer-gmp-1.0.3.0/dist-install/build/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/include' -optc-I'/tmp/portage/cross-x86_64-w64-mingw32/ghc-9999/work/usr/lib64/ghc-8.10.1/dist-install/build/include' -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -static  -H32m -O -Wall  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf  -this-unit-id ghc-8.11.0.20200505 -hide-all-packages -i -icompiler/. -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/stage1   -optP-Iincludes/dist/build -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.4.0 -package-id base-4.14.0.0 -package-id binary-0.8.7.0 -package-id bytestring-0.10.10.0 -package-id containers-0.6.2.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.6.0 -package-id exceptions-0.10.4 -package-id filepath-1.4.2.1 -package-id ghc-boot-8.11.0.20200505 -package-id ghc-boot-th-8.11.0.20200505 -package-id ghc-heap-8.11.0.20200505 -package-id ghci-8.11.0.20200505 -package-id hpc-0.6.1.0 -package-id process-1.6.8.2 -package-id template-haskell-2.17.0.0 -package-id terminfo-0.4.1.4 -package-id time-1.9.3 -package-id transformers-0.5.6.2 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -Iincludes/dist/build -Rghc-timing -Wcpp-undef  -no-user-package-db -rtsopts        -c compiler/cbits/genSym.c -o compiler/stage1/build/cbits/genSym.o
...
In file included from compiler/cbits/genSym.c:1:0: error:

includes/Rts.h:29:10: error:
     fatal error: windows.h: No such file or directory
       29 | #include <windows.h>
          |          ^~~~~~~~~~~
   |
29 | #include <windows.h>
   |          ^

Note: the host is linux, building stage1 should not user target's RTS definitions. It should use installed RTS instead.

It happens because -Iincludes include local Rts.h.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking