[GHC] #15837: Hadrian should build dynamically linked ghc binary

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this: 1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 this change], depends on 3. and 4.). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by davide): * owner: (none) => davide -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by davide): * cc: alpmestan (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by davide: Old description:
The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this:
1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 this change], depends on 3. and 4.).
New description: The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this: 1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 this change], depends on 3. and 4.). 6. Build ghc-iserv-dyn, as it is will be required required by many tests (see/depends on [https://phabricator.haskell.org/D5255 patch for ghc- iserv-prof]) -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by davide: Old description:
The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this:
1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 this change], depends on 3. and 4.). 6. Build ghc-iserv-dyn, as it is will be required required by many tests (see/depends on [https://phabricator.haskell.org/D5255 patch for ghc- iserv-prof])
New description: The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this: 1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 patch D5281], depends on 3. and 4.). 6. Build ghc-iserv-dyn, as it is will be required required by many tests (see/depends on [https://phabricator.haskell.org/D5255 D5255 patch for ghc-iserv-prof]) -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Tritlo): * cc: Tritlo (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by snowleopard): * cc: snowleopard (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | -------------------------------------+------------------------------------- Changes (by alpmestan): * differential: => Phab:D5385 Comment: The Cabal PR got merged, and I just pushed [https://phabricator.haskell.org/D5385 D5385] which updates the Cabal submodule to point to my commit, makes use of `extra-dynamic-library- flavours` in `rts.cabal.in` when the `dynamic` flag is passed, and arranges for that flag to be passed by Hadrian whenever appropriate. Once this lands, we will be done with 1., 2. and 3. from the original comment. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Changes (by davide): * differential: Phab:D5385 => Phab:D5385 Phab:D5327 Old description:
The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this:
1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see [https://phabricator.haskell.org/D5281 patch D5281], depends on 3. and 4.). 6. Build ghc-iserv-dyn, as it is will be required required by many tests (see/depends on [https://phabricator.haskell.org/D5255 D5255 patch for ghc-iserv-prof])
New description: The ghc binary is dynamically linked via make in various flavors (e.g. quick). Hadrian builds a static linked binary in these cases (this is a bug). Various change are needed to fix this: 1. Add new .cabal file field extra-dynamic-library-flavours (see [https://github.com/haskell/cabal/pull/5606 this PR]). 2. Use .cabal extra-dynamic-library-flavours for the RTS (see [https://github.com/snowleopard/hadrian/issues/695#issue-367436377 this comment], depends on 1.) 3. Hadrian: fix management of nontrivial dynamic flavours of libHSrts (see [https://github.com/snowleopard/hadrian/pull/698 this PR]). 4. Hadrian should build ghc with the `-fPIC -dynamic` options (see [https://github.com/DavidEichmann/ghc/commit/752021f69f577b678630302b567fd712... #diff-408bbe46d4afae11991cbadb2c531b78 this comment], depends on 3.). 5. Use the correct relative path to the dynamically linked libraries (see Phab:D5281, depends on 3. and 4.). 6. Build ghc-iserv-dyn, as it is will be required required by many tests (Phab:D5327) 7. Hadrian should only use "-shared -dynload deploy" when linking shared libraries (definitely not when linking executables). This problem causes ghc-iserv-dyn to segfault because it is built as a shared library instead of as an executable. -- Comment: Update: With changes 1 to 7 I'm able to build a dynamically linked ghc and this fixes a significant number of tests! The end is in sight! The current status is: * (1, 2, 3) Are done and merged (Thank you Alp!). * (6) Phab:D5327 done and merged! * (4, 7) Should be fixed in a small patch that I am currently preparing. * (5) Phab:D52816 after 4 and 7 are fixed, this needs some updating, but is on the right track. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by davide): I've changed the plan. Now all remaining work (points 4, 5, and 7) are all in Phab:D52816. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary
-------------------------------------+-------------------------------------
Reporter: davide | Owner: davide
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build System | Version: 8.6.1
(Hadrian) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5385
Wiki Page: | Phab:D5327
-------------------------------------+-------------------------------------
Comment (by Alp Mestanogullari

#15837: Hadrian should build dynamically linked ghc binary
-------------------------------------+-------------------------------------
Reporter: davide | Owner: davide
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build System | Version: 8.6.1
(Hadrian) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5385
Wiki Page: | Phab:D5327
-------------------------------------+-------------------------------------
Comment (by Alp Mestanogullari

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Changes (by alpmestan): * status: new => closed * resolution: => fixed Comment: Both of our patches landed on master. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by adamse): I was wondering if the dynamic GHC building should respect the Hadrian equivalent of {{{DYNAMIC_GHC_PROGRAMS=NO}}}. I don't think the current code will do that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by davide): My commit (79d5427e1f9d) breaks the hadrian build in some cases. When building the default flavour, the ghc binary is linked with -lffi. When there is no system wide libffi .so installed, this will fail, even though there should be a locally built libffi. Here is an example of the command line generated by hadrian: {{{ $ _build/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -fPIC -dynamic -hide-all-packages -no-user-package-db '-package-db _build/stage1/lib/package.conf.d' '-package-id array-0.5.2.0' '-package-id base-4.12.0.0' '-package-id bytestring-0.10.9.0' '-package-id containers-0.6.0.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.3.1' '-package-id filepath-1.4.2.1' '-package-id ghc-8.7' '-package-id ghc-boot-8.7' '-package-id ghc-prim-0.5.3' '-package-id ghci-8.7' '-package-id haskeline-0.7.4.3' '-package-id process-1.6.3.0' '-package-id time-1.9.2' '-package-id transformers-0.5.5.0' '-package-id unix-2.7.2.2' -i -i_build/stage1/ghc/build -i_build/stage1/ghc/build/ghc/autogen -ighc/. -Iincludes -I_build/generated -I_build/stage1/ghc/build -I/nix/store /x5ms5m9ga6v7vy3akc58yx279ggfnbnl-ghc-build-environment/include -I/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64-linux- ghc-8.7.20181205/ghc-8.7/include -I/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64-linux- ghc-8.7.20181205/process-1.6.3.0/include -I/home/david/MEGA/File_Dump /Well-Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64 -linux-ghc-8.7.20181205/unix-2.7.2.2/include -I/home/david/MEGA/File_Dump /Well-Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64 -linux-ghc-8.7.20181205/time-1.9.2/include -I/home/david/MEGA/File_Dump /Well-Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64 -linux-ghc-8.7.20181205/bytestring-0.10.9.0/include -I/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64-linux- ghc-8.7.20181205/base-4.12.0.0/include -I/nix/store /x5ms5m9ga6v7vy3akc58yx279ggfnbnl-ghc-build-environment/include -I/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64-linux- ghc-8.7.20181205/integer-gmp-1.0.2.0/include -I/home/david/MEGA/File_Dump /Well-Typed/GHC/_nosync_git/_build/T-15837_default/stage1/lib/x86_64 -linux-ghc-8.7.20181205/rts-1.0/include -I_build/generated -optc- I_build/generated -optP-include -optP_build/stage1/ghc/build/ghc/autogen/cabal_macros.h -optc-fno-stack- protector -optP-DGHCI -odir _build/stage1/ghc/build -hidir _build/stage1/ghc/build -stubdir _build/stage1/ghc/build -dynamic -optl- Wl,-rpath -optl-Wl,$ORIGIN/../lib/x86_64-linux-ghc-8.7.20181205 -no-auto- link-packages -no-hs-main -optl-lgmp -Wnoncanonical-monad-instances -optc- Werror=unused-but-set-variable -optc-Wno-error=inline _build/stage1/ghc/build/c/hschooks.o _build/stage1/ghc/build/Main.o _build/stage1/ghc/build/GHCi/Leak.o _build/stage1/ghc/build/GHCi/UI.o _build/stage1/ghc/build/GHCi/UI/Info.o _build/stage1/ghc/build/GHCi/UI/Monad.o _build/stage1/ghc/build/GHCi/UI/Tags.o -o _build/stage1/bin/ghc -O2 -H32m -Wall -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -fno-warn-name-shadowing -threaded -XHaskell2010 -XNoImplicitPrelude -ghcversion- file=/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/_build/generated/ghcversion.h -I_build/stage1/compiler/build -Wcpp-undef }}} Note that there is no mention of libffi (i.e. no use of `-lffi`). Ghc sees rts as a dependency, and sees `hs-libraries: HSrts-1.0 Cffi` in the ghc- pkg database and then adds `-lffi` to the linking command. Further more, bgamari has suggested that we may not be supposed to link with libffi. We build libffi via hadrian but don't generate a .so. Instead we copy the same .a file as as both an .a and an .so for all flavours {{{ | Copy file: _build/stage1/libffi/build/inst/include/ffi.h => _build/stage1/rts/build/ffi.h | Copy file: _build/stage1/libffi/build/inst/include/ffitarget.h => _build/stage1/rts/build/ffitarget.h | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_p.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126.so | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_thr.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_thr_p.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_debug_p.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_thr_debug_p.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_l.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_thr_l.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_debug.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi_thr_debug.a | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126_thr.so | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126_debug.so | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126_l.so | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126_thr_debug.so | Copy file (untracked): _build/stage1/libffi/build/inst/lib/libffi.a => _build/stage1/rts/build/libCffi-ghc8.7.20181126_thr_l.so }}} Though this may work for the .a files, it wont work for the .so. It's an easy fix to also build the .so and copy that instead: * modify `hadrian/src/Settings/Builders/Configure.hs` to use `--enable- shared=yes` when the way is dynamic. * modify `hadrian/src/Rules/Libffi.hs` to copy .so instead of .a when the way is dynamic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Changes (by davide): * status: closed => new * owner: davide => (none) * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Changes (by davide): * owner: (none) => davide -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by davide): Note that the make build system succeeds and can be used as a reference here. Here is the verbose (-v3) output of the make build command that builds/links the ghc binary: {{{ # Model ghc build (make default) "inplace/bin/ghc-stage1" -o ghc/stage2/build/tmp/ghc-stage2 -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -H32m -O -Wall -hide-all- packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP- DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id array-0.5.2.0 -package-id base-4.12.0.0 -package-id bytestring-0.10.9.0 -package-id containers-0.6.0.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.3.1 -package-id filepath-1.4.2.1 -package-id ghc-8.7 -package-id ghc-boot-8.7 -package-id ghc-prim-0.5.3 -package-id ghci-8.7 -package-id haskeline-0.7.4.3 -package-id process-1.6.3.0 -package-id time-1.9.2 -package-id transformers-0.5.5.0 -package-id unix-2.7.2.2 -Wall -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -fno- warn-name-shadowing -threaded -XHaskell2010 -XNoImplicitPrelude -O2 -haddock -Wcpp-undef -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad-instances -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -fPIC -dynamic -H32m -O -Wall -hide-all-packages -i -ighc/. -ighc/stage2/build -Ighc/stage2/build -ighc/stage2/build/ghc/autogen -Ighc/stage2/build/ghc/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/ghc/autogen/cabal_macros.h -package-id array-0.5.2.0 -package-id base-4.12.0.0 -package-id bytestring-0.10.9.0 -package-id containers-0.6.0.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.3.1 -package-id filepath-1.4.2.1 -package-id ghc-8.7 -package-id ghc-boot-8.7 -package-id ghc-prim-0.5.3 -package-id ghci-8.7 -package-id haskeline-0.7.4.3 -package-id process-1.6.3.0 -package-id time-1.9.2 -package-id transformers-0.5.5.0 -package-id unix-2.7.2.2 -Wall -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -fno-warn-name-shadowing -threaded -XHaskell2010 -XNoImplicitPrelude -O2 -haddock -Wcpp-undef -no-hs-main -threaded -no-user-package-db -rtsopts -Wnoncanonical-monad- instances -fno-use-rpaths -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../haskeline-0.7.4.3' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../stm-2.5.0.0' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghc-8.7' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../terminfo-0.4.1.2' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../process-1.6.3.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../hpc-0.6.0.3' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghci-8.7' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../transformers-0.5.5.0' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../template-haskell-2.15.0.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../pretty-1.1.3.6' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghc- heap-8.7' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghc-boot-8.7' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../ghc-boot-th-8.7' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../directory-1.3.3.1' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../unix-2.7.2.2' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../time-1.9.2' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../filepath-1.4.2.1' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../binary-0.8.6.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../containers-0.6.0.1' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../bytestring-0.10.9.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../deepseq-1.4.4.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../array-0.5.2.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../base-4.12.0.0' -optl-Wl,-rpath -optl-Wl,'$ORIGIN /../integer-gmp-1.0.2.0' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghc- prim-0.5.3' -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../rts' -optl-Wl,-zorigin ghc/stage2/build/Main.dyn_o ghc/stage2/build/GHCi/Leak.dyn_o ghc/stage2/build/GHCi/UI.dyn_o ghc/stage2/build/GHCi/UI/Info.dyn_o ghc/stage2/build/GHCi/UI/Monad.dyn_o ghc/stage2/build/GHCi/UI/Tags.dyn_o ghc/stage2/build/hschooks.dyn_o Glasgow Haskell Compiler, Version 8.7.20181205, stage 1 booted by GHC version 8.4.4 Using binary package database: /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/inplace/lib/package.conf.d/package.cache package flags [-package-id array-0.5.2.0{unit array-0.5.2.0 True ([])}, -package-id base-4.12.0.0{unit base-4.12.0.0 True ([])}, -package-id bytestring-0.10.9.0{unit bytestring-0.10.9.0 True ([])}, -package-id containers-0.6.0.1{unit containers-0.6.0.1 True ([])}, -package-id deepseq-1.4.4.0{unit deepseq-1.4.4.0 True ([])}, -package-id directory-1.3.3.1{unit directory-1.3.3.1 True ([])}, -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])}, -package-id ghc-8.7{unit ghc-8.7 True ([])}, -package-id ghc-boot-8.7{unit ghc-boot-8.7 True ([])}, -package-id ghc-prim-0.5.3{unit ghc-prim-0.5.3 True ([])}, -package-id ghci-8.7{unit ghci-8.7 True ([])}, -package-id haskeline-0.7.4.3{unit haskeline-0.7.4.3 True ([])}, -package-id process-1.6.3.0{unit process-1.6.3.0 True ([])}, -package-id time-1.9.2{unit time-1.9.2 True ([])}, -package-id transformers-0.5.5.0{unit transformers-0.5.5.0 True ([])}, -package-id unix-2.7.2.2{unit unix-2.7.2.2 True ([])}, -package-id array-0.5.2.0{unit array-0.5.2.0 True ([])}, -package-id base-4.12.0.0{unit base-4.12.0.0 True ([])}, -package-id bytestring-0.10.9.0{unit bytestring-0.10.9.0 True ([])}, -package-id containers-0.6.0.1{unit containers-0.6.0.1 True ([])}, -package-id deepseq-1.4.4.0{unit deepseq-1.4.4.0 True ([])}, -package-id directory-1.3.3.1{unit directory-1.3.3.1 True ([])}, -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])}, -package-id ghc-8.7{unit ghc-8.7 True ([])}, -package-id ghc-boot-8.7{unit ghc-boot-8.7 True ([])}, -package-id ghc-prim-0.5.3{unit ghc-prim-0.5.3 True ([])}, -package-id ghci-8.7{unit ghci-8.7 True ([])}, -package-id haskeline-0.7.4.3{unit haskeline-0.7.4.3 True ([])}, -package-id process-1.6.3.0{unit process-1.6.3.0 True ([])}, -package-id time-1.9.2{unit time-1.9.2 True ([])}, -package-id transformers-0.5.5.0{unit transformers-0.5.5.0 True ([])}, -package-id unix-2.7.2.2{unit unix-2.7.2.2 True ([])}] loading package database /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/inplace/lib/package.conf.d wired-in package ghc-prim mapped to ghc-prim-0.5.3 wired-in package integer-wired-in mapped to integer-gmp-1.0.2.0 wired-in package base mapped to base-4.12.0.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.15.0.0 wired-in package ghc mapped to ghc-8.7 ("getPreloadPackagesAnd pkgids:",[]) ("getPreloadPackagesAnd preload:",["haskeline-0.7.4.3","stm-2.5.0.0","ghc","terminfo-0.4.1.2","process-1.6.3.0","hpc-0.6.0.3","ghci-8.7","transformers-0.5.5.0 ","template-haskell","pretty-1.1.3.6","ghc-heap-8.7","ghc-boot-8.7","ghc- boot- th-8.7","binary-0.8.6.0","directory-1.3.3.1","unix-2.7.2.2","time-1.9.2","filepath-1.4.2.1","containers-0.6.0.1","bytestring-0.10.9.0","deepseq-1.4.4.0","array-0.5.2.0","base ","integer-wired-in","ghc-prim","rts"]) Warning: -rtsopts and -with-rtsopts have no effect with -no-hs-main. Call hs_init_ghc() from your main() function to set these options. Created temporary directory: /run/user/1000/ghc13514_0 *** C Compiler: /nix/store/qanjz18apdwi0vl98sdrvyf4z4hv65df-gcc-wrapper-7.3.0/bin/cc -fno- stack-protector -DTABLES_NEXT_TO_CODE -c /run/user/1000/ghc13514_0/ghc_1.c -o /run/user/1000/ghc13514_0/ghc_2.o -no-pie -fPIC -U__PIC__ -D__PIC__ -I/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/rts/dist/build -I/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/includes -I/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/includes/dist- derivedconstants/header ("getPreloadPackagesAnd pkgids:",[]) ("getPreloadPackagesAnd preload:",["haskeline-0.7.4.3","stm-2.5.0.0","ghc","terminfo-0.4.1.2","process-1.6.3.0","hpc-0.6.0.3","ghci-8.7","transformers-0.5.5.0 ","template-haskell","pretty-1.1.3.6","ghc-heap-8.7","ghc-boot-8.7","ghc- boot- th-8.7","binary-0.8.6.0","directory-1.3.3.1","unix-2.7.2.2","time-1.9.2","filepath-1.4.2.1","containers-0.6.0.1","bytestring-0.10.9.0","deepseq-1.4.4.0","array-0.5.2.0","base ","integer-wired-in","ghc-prim","rts"]) @@@ Stripping prefix for "Cffi" to "ffi" for package "rts" ("collectLinkOpts",(["-lHShaskeline-0.7.4.3-ghc8.7.20181205","-lHSstm-2.5.0.0-ghc8.7.20181205","-lHSghc-8.7-ghc8.7.20181205","-lHSterminfo-0.4.1.2-ghc8.7.20181205","-lHSprocess-1.6.3.0-ghc8.7.20181205","-lHShpc-0.6.0.3-ghc8.7.20181205","-lHSghci-8.7-ghc8.7.20181205","-lHStransformers-0.5.5.0-ghc8.7.20181205 ","-lHStemplate- haskell-2.15.0.0-ghc8.7.20181205","-lHSpretty-1.1.3.6-ghc8.7.20181205 ","-lHSghc-heap-8.7-ghc8.7.20181205","-lHSghc-boot-8.7-ghc8.7.20181205 ","-lHSghc-boot- th-8.7-ghc8.7.20181205","-lHSbinary-0.8.6.0-ghc8.7.20181205","-lHSdirectory-1.3.3.1-ghc8.7.20181205","-lHSunix-2.7.2.2-ghc8.7.20181205","-lHStime-1.9.2-ghc8.7.20181205","-lHSfilepath-1.4.2.1-ghc8.7.20181205","-lHScontainers-0.6.0.1-ghc8.7.20181205","-lHSbytestring-0.10.9.0-ghc8.7.20181205","-lHSdeepseq-1.4.4.0-ghc8.7.20181205","-lHSarray-0.5.2.0-ghc8.7.20181205","-lHSbase-4.12.0.0-ghc8.7.20181205 ","-lHSinteger-gmp-1.0.2.0-ghc8.7.20181205","-lHSghc- prim-0.5.3-ghc8.7.20181205","-lHSrts_thr- ghc8.7.20181205","-lffi"],["-ltinfo","-lrt","-lutil","-ldl","-lgmp","-lm","-lrt","-ldl","-lnuma"],["-Wl,-u,base_GHCziTopHandler_runIO_closure","-Wl,-u,base_GHCziTopHandler_runNonIO_closure","-Wl,-u,ghczmprim_GHCziTuple_Z0T_closure","-Wl,-u,ghczmprim_GHCziTypes_True_closure","-Wl,-u,ghczmprim_GHCziTypes_False_closure","-Wl,-u,base_GHCziPack_unpackCString_closure","-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure","-Wl,-u,base_GHCziIOziException_stackOverflow_closure","-Wl,-u,base_GHCziIOziException_heapOverflow_closure","-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure","-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure","-Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure","-Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure","-Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure","-Wl,-u,base_Controlz iExceptionziBase_nonTermination_closure","-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure","-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure","-Wl,-u,base_GHCziConcziSync_runSparks_closure","-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure","-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure","-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure","-Wl,-u,base_GHCziTopHandler_runMainIO_closure","-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info","-Wl,-u,base_GHCziPtr_Ptr_con_info","-Wl,-u,base_GHCziPtr_FunPtr_con_info","-Wl,-u,base_GHCziInt_I8zh_con_info","-Wl,-u,base_GHCziInt_I16zh_con_info","-Wl,-u,base_GHCziInt_I32zh_con_info","-Wl,-u,base_GHCziInt_I64zh_con_info","-Wl,-u,base_GHCziWord_W8zh_con_info","-Wl,-u,base_GHCziWord_W16 zh_con_info","-Wl,-u,base_GHCziWord_W32zh_con_info","-Wl,-u,base_GHCziWord_W64zh_con_info","-Wl,-u,base_GHCziStable_StablePtr_con_info","-Wl,-u,hs_atomic_add8","-Wl,-u,hs_atomic_add16","-Wl,-u,hs_atomic_add32","-Wl,-u,hs_atomic_add64","-Wl,-u,hs_atomic_sub8","-Wl,-u,hs_atomic_sub16","-Wl,-u,hs_atomic_sub32","-Wl,-u,hs_atomic_sub64","-Wl,-u,hs_atomic_and8","-Wl,-u,hs_atomic_and16","-Wl,-u,hs_atomic_and32","-Wl,-u,hs_atomic_and64","-Wl,-u,hs_atomic_nand8","-Wl,-u,hs_atomic_nand16","-Wl,-u,hs_atomic_nand32","-Wl,-u,hs_atomic_nand64","-Wl,-u,hs_atomic_or8","-Wl,-u,hs_atomic_or16","-Wl,-u,hs_atomic_or32","-Wl,-u,hs_atomic_or64","-Wl,-u,hs_atomic_xor8","-Wl,-u,hs_atomic_xor16","-Wl,-u,hs_atomic_xor32","-Wl,-u,hs_atomic_xor64","-Wl,-u,hs_cmpxchg8","-Wl,-u,hs_cmpxchg16","-Wl,-u,hs_cmpxchg32","-Wl,-u,hs_cmpxchg64","-Wl,-u,hs_atomicread8","-Wl,-u,hs_atomicread16","-Wl,-u,hs_atomicread32","-Wl,-u,hs_atomicread64","-Wl,-u,hs_atomicwrite8","-Wl,-u,hs_atomicwrite16","-Wl,-u,hs_atomicwrite32","-Wl ,-u,hs_atomicwrite64"])) *** C Compiler: /nix/store/qanjz18apdwi0vl98sdrvyf4z4hv65df-gcc-wrapper-7.3.0/bin/cc -fno- stack-protector -DTABLES_NEXT_TO_CODE -c /run/user/1000/ghc13514_0/ghc_4.s -o /run/user/1000/ghc13514_0/ghc_5.o ("getPreloadPackagesAnd pkgids:",[]) ("getPreloadPackagesAnd preload:",["haskeline-0.7.4.3","stm-2.5.0.0","ghc","terminfo-0.4.1.2","process-1.6.3.0","hpc-0.6.0.3","ghci-8.7","transformers-0.5.5.0 ","template-haskell","pretty-1.1.3.6","ghc-heap-8.7","ghc-boot-8.7","ghc- boot- th-8.7","binary-0.8.6.0","directory-1.3.3.1","unix-2.7.2.2","time-1.9.2","filepath-1.4.2.1","containers-0.6.0.1","bytestring-0.10.9.0","deepseq-1.4.4.0","array-0.5.2.0","base ","integer-wired-in","ghc-prim","rts"]) @@@ Stripping prefix for "Cffi" to "ffi" for package "rts" ("collectLinkOpts",(["-lHShaskeline-0.7.4.3-ghc8.7.20181205","-lHSstm-2.5.0.0-ghc8.7.20181205","-lHSghc-8.7-ghc8.7.20181205","-lHSterminfo-0.4.1.2-ghc8.7.20181205","-lHSprocess-1.6.3.0-ghc8.7.20181205","-lHShpc-0.6.0.3-ghc8.7.20181205","-lHSghci-8.7-ghc8.7.20181205","-lHStransformers-0.5.5.0-ghc8.7.20181205 ","-lHStemplate- haskell-2.15.0.0-ghc8.7.20181205","-lHSpretty-1.1.3.6-ghc8.7.20181205 ","-lHSghc-heap-8.7-ghc8.7.20181205","-lHSghc-boot-8.7-ghc8.7.20181205 ","-lHSghc-boot- th-8.7-ghc8.7.20181205","-lHSbinary-0.8.6.0-ghc8.7.20181205","-lHSdirectory-1.3.3.1-ghc8.7.20181205","-lHSunix-2.7.2.2-ghc8.7.20181205","-lHStime-1.9.2-ghc8.7.20181205","-lHSfilepath-1.4.2.1-ghc8.7.20181205","-lHScontainers-0.6.0.1-ghc8.7.20181205","-lHSbytestring-0.10.9.0-ghc8.7.20181205","-lHSdeepseq-1.4.4.0-ghc8.7.20181205","-lHSarray-0.5.2.0-ghc8.7.20181205","-lHSbase-4.12.0.0-ghc8.7.20181205 ","-lHSinteger-gmp-1.0.2.0-ghc8.7.20181205","-lHSghc- prim-0.5.3-ghc8.7.20181205","-lHSrts_thr- ghc8.7.20181205","-lffi"],["-ltinfo","-lrt","-lutil","-ldl","-lgmp","-lm","-lrt","-ldl","-lnuma"],["-Wl,-u,base_GHCziTopHandler_runIO_closure","-Wl,-u,base_GHCziTopHandler_runNonIO_closure","-Wl,-u,ghczmprim_GHCziTuple_Z0T_closure","-Wl,-u,ghczmprim_GHCziTypes_True_closure","-Wl,-u,ghczmprim_GHCziTypes_False_closure","-Wl,-u,base_GHCziPack_unpackCString_closure","-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure","-Wl,-u,base_GHCziIOziException_stackOverflow_closure","-Wl,-u,base_GHCziIOziException_heapOverflow_closure","-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure","-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure","-Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure","-Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure","-Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure","-Wl,-u,base_Controlz iExceptionziBase_nonTermination_closure","-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure","-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure","-Wl,-u,base_GHCziConcziSync_runSparks_closure","-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure","-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure","-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure","-Wl,-u,base_GHCziTopHandler_runMainIO_closure","-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info","-Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info","-Wl,-u,base_GHCziPtr_Ptr_con_info","-Wl,-u,base_GHCziPtr_FunPtr_con_info","-Wl,-u,base_GHCziInt_I8zh_con_info","-Wl,-u,base_GHCziInt_I16zh_con_info","-Wl,-u,base_GHCziInt_I32zh_con_info","-Wl,-u,base_GHCziInt_I64zh_con_info","-Wl,-u,base_GHCziWord_W8zh_con_info","-Wl,-u,base_GHCziWord_W16 zh_con_info","-Wl,-u,base_GHCziWord_W32zh_con_info","-Wl,-u,base_GHCziWord_W64zh_con_info","-Wl,-u,base_GHCziStable_StablePtr_con_info","-Wl,-u,hs_atomic_add8","-Wl,-u,hs_atomic_add16","-Wl,-u,hs_atomic_add32","-Wl,-u,hs_atomic_add64","-Wl,-u,hs_atomic_sub8","-Wl,-u,hs_atomic_sub16","-Wl,-u,hs_atomic_sub32","-Wl,-u,hs_atomic_sub64","-Wl,-u,hs_atomic_and8","-Wl,-u,hs_atomic_and16","-Wl,-u,hs_atomic_and32","-Wl,-u,hs_atomic_and64","-Wl,-u,hs_atomic_nand8","-Wl,-u,hs_atomic_nand16","-Wl,-u,hs_atomic_nand32","-Wl,-u,hs_atomic_nand64","-Wl,-u,hs_atomic_or8","-Wl,-u,hs_atomic_or16","-Wl,-u,hs_atomic_or32","-Wl,-u,hs_atomic_or64","-Wl,-u,hs_atomic_xor8","-Wl,-u,hs_atomic_xor16","-Wl,-u,hs_atomic_xor32","-Wl,-u,hs_atomic_xor64","-Wl,-u,hs_cmpxchg8","-Wl,-u,hs_cmpxchg16","-Wl,-u,hs_cmpxchg32","-Wl,-u,hs_cmpxchg64","-Wl,-u,hs_atomicread8","-Wl,-u,hs_atomicread16","-Wl,-u,hs_atomicread32","-Wl,-u,hs_atomicread64","-Wl,-u,hs_atomicwrite8","-Wl,-u,hs_atomicwrite16","-Wl,-u,hs_atomicwrite32","-Wl ,-u,hs_atomicwrite64"])) *** Linker: /nix/store/qanjz18apdwi0vl98sdrvyf4z4hv65df-gcc-wrapper-7.3.0/bin/cc -fno- stack-protector -DTABLES_NEXT_TO_CODE '-Wl,--hash-size=31' -Wl,--reduce- memory-overheads -Wl,--no-as-needed -Wl,-rpath '-Wl,$ORIGIN/../haskeline-0.7.4.3' -Wl,-rpath '-Wl,$ORIGIN/../stm-2.5.0.0' -Wl,-rpath '-Wl,$ORIGIN/../ghc-8.7' -Wl,-rpath '-Wl,$ORIGIN/../terminfo-0.4.1.2' -Wl,-rpath '-Wl,$ORIGIN/../process-1.6.3.0' -Wl,-rpath '-Wl,$ORIGIN/../hpc-0.6.0.3' -Wl,-rpath '-Wl,$ORIGIN/../ghci-8.7' -Wl,-rpath '-Wl,$ORIGIN/../transformers-0.5.5.0' -Wl,-rpath '-Wl,$ORIGIN/../template- haskell-2.15.0.0' -Wl,-rpath '-Wl,$ORIGIN/../pretty-1.1.3.6' -Wl,-rpath '-Wl,$ORIGIN/../ghc-heap-8.7' -Wl,-rpath '-Wl,$ORIGIN/../ghc-boot-8.7' -Wl,-rpath '-Wl,$ORIGIN/../ghc-boot-th-8.7' -Wl,-rpath '-Wl,$ORIGIN/../directory-1.3.3.1' -Wl,-rpath '-Wl,$ORIGIN/../unix-2.7.2.2' -Wl,-rpath '-Wl,$ORIGIN/../time-1.9.2' -Wl,-rpath '-Wl,$ORIGIN/../filepath-1.4.2.1' -Wl,-rpath '-Wl,$ORIGIN/../binary-0.8.6.0' -Wl,-rpath '-Wl,$ORIGIN/../containers-0.6.0.1' -Wl,-rpath '-Wl,$ORIGIN/../bytestring-0.10.9.0' -Wl,-rpath '-Wl,$ORIGIN/../deepseq-1.4.4.0' -Wl,-rpath '-Wl,$ORIGIN/../array-0.5.2.0' -Wl,-rpath '-Wl,$ORIGIN/../base-4.12.0.0' -Wl,-rpath '-Wl,$ORIGIN /../integer-gmp-1.0.2.0' -Wl,-rpath '-Wl,$ORIGIN/../ghc-prim-0.5.3' -Wl,-rpath '-Wl,$ORIGIN/../rts' -Wl,-zorigin -o ghc/stage2/build/tmp/ghc- stage2 -lm -no-pie -fPIC -U__PIC__ -D__PIC__ -Wl,--gc-sections ghc/stage2/build/Main.dyn_o ghc/stage2/build/GHCi/Leak.dyn_o ghc/stage2/build/GHCi/UI.dyn_o ghc/stage2/build/GHCi/UI/Info.dyn_o ghc/stage2/build/GHCi/UI/Monad.dyn_o ghc/stage2/build/GHCi/UI/Tags.dyn_o ghc/stage2/build/hschooks.dyn_o -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/haskeline/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/haskeline/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/stm /dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/stm /dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/compiler/stage2/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/compiler/stage2/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/terminfo/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/terminfo/dist-install/build -L/nix/store/x5ms5m9ga6v7vy3akc58yx279ggfnbnl-ghc-build-environment/lib -Xlinker -rpath-link -Xlinker /nix/store/x5ms5m9ga6v7vy3akc58yx279ggfnbnl- ghc-build-environment/lib -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/process/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/process/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/hpc /dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/hpc /dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/ghci/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/ghci/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/transformers/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/transformers/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries /template-haskell/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries /template-haskell/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/pretty/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/pretty/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- heap/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- heap/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/ghc-boot/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/ghc-boot/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- boot-th/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- boot-th/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/binary/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/binary/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/directory/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/directory/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/unix /dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/unix /dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/time/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/time/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/filepath/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/filepath/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/containers/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/containers/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/bytestring/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/bytestring/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/deepseq/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/deepseq/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/array/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/array/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/base /dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/base /dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/integer-gmp/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/libraries/integer-gmp/dist-install/build -L/home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- prim/dist-install/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/libraries/ghc- prim/dist-install/build -L/home/david/MEGA/File_Dump/Well- Typed/GHC/_nosync_git/ghc/rts/dist/build -Xlinker -rpath-link -Xlinker /home/david/MEGA/File_Dump/Well-Typed/GHC/_nosync_git/ghc/rts/dist/build /run/user/1000/ghc13514_0/ghc_2.o /run/user/1000/ghc13514_0/ghc_5.o -Wl,-u,base_GHCziTopHandler_runIO_closure -Wl,-u,base_GHCziTopHandler_runNonIO_closure -Wl,-u,ghczmprim_GHCziTuple_Z0T_closure -Wl,-u,ghczmprim_GHCziTypes_True_closure -Wl,-u,ghczmprim_GHCziTypes_False_closure -Wl,-u,base_GHCziPack_unpackCString_closure -Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,base_GHCziIOziException_stackOverflow_closure -Wl,-u,base_GHCziIOziException_heapOverflow_closure -Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure -Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure -Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure -Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure -Wl,-u,base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure -Wl,-u,base_GHCziConcziSync_runSparks_closure -Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -Wl,-u,base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,base_GHCziTopHandler_runMainIO_closure -Wl,-u,ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info -Wl,-u,base_GHCziPtr_FunPtr_con_info -Wl,-u,base_GHCziInt_I8zh_con_info -Wl,-u,base_GHCziInt_I16zh_con_info -Wl,-u,base_GHCziInt_I32zh_con_info -Wl,-u,base_GHCziInt_I64zh_con_info -Wl,-u,base_GHCziWord_W8zh_con_info -Wl,-u,base_GHCziWord_W16zh_con_info -Wl,-u,base_GHCziWord_W32zh_con_info -Wl,-u,base_GHCziWord_W64zh_con_info -Wl,-u,base_GHCziStable_StablePtr_con_info -Wl,-u,hs_atomic_add8 -Wl,-u,hs_atomic_add16 -Wl,-u,hs_atomic_add32 -Wl,-u,hs_atomic_add64 -Wl,-u,hs_atomic_sub8 -Wl,-u,hs_atomic_sub16 -Wl,-u,hs_atomic_sub32 -Wl,-u,hs_atomic_sub64 -Wl,-u,hs_atomic_and8 -Wl,-u,hs_atomic_and16 -Wl,-u,hs_atomic_and32 -Wl,-u,hs_atomic_and64 -Wl,-u,hs_atomic_nand8 -Wl,-u,hs_atomic_nand16 -Wl,-u,hs_atomic_nand32 -Wl,-u,hs_atomic_nand64 -Wl,-u,hs_atomic_or8 -Wl,-u,hs_atomic_or16 -Wl,-u,hs_atomic_or32 -Wl,-u,hs_atomic_or64 -Wl,-u,hs_atomic_xor8 -Wl,-u,hs_atomic_xor16 -Wl,-u,hs_atomic_xor32 -Wl,-u,hs_atomic_xor64 -Wl,-u,hs_cmpxchg8 -Wl,-u,hs_cmpxchg16 -Wl,-u,hs_cmpxchg32 -Wl,-u,hs_cmpxchg64 -Wl,-u,hs_atomicread8 -Wl,-u,hs_atomicread16 -Wl,-u,hs_atomicread32 -Wl,-u,hs_atomicread64 -Wl,-u,hs_atomicwrite8 -Wl,-u,hs_atomicwrite16 -Wl,-u,hs_atomicwrite32 -Wl,-u,hs_atomicwrite64 -lHShaskeline-0.7.4.3-ghc8.7.20181205 -lHSstm-2.5.0.0-ghc8.7.20181205 -lHSghc-8.7-ghc8.7.20181205 -lHSterminfo-0.4.1.2-ghc8.7.20181205 -lHSprocess-1.6.3.0-ghc8.7.20181205 -lHShpc-0.6.0.3-ghc8.7.20181205 -lHSghci-8.7-ghc8.7.20181205 -lHStransformers-0.5.5.0-ghc8.7.20181205 -lHStemplate-haskell-2.15.0.0-ghc8.7.20181205 -lHSpretty-1.1.3.6-ghc8.7.20181205 -lHSghc-heap-8.7-ghc8.7.20181205 -lHSghc-boot-8.7-ghc8.7.20181205 -lHSghc-boot-th-8.7-ghc8.7.20181205 -lHSbinary-0.8.6.0-ghc8.7.20181205 -lHSdirectory-1.3.3.1-ghc8.7.20181205 -lHSunix-2.7.2.2-ghc8.7.20181205 -lHStime-1.9.2-ghc8.7.20181205 -lHSfilepath-1.4.2.1-ghc8.7.20181205 -lHScontainers-0.6.0.1-ghc8.7.20181205 -lHSbytestring-0.10.9.0-ghc8.7.20181205 -lHSdeepseq-1.4.4.0-ghc8.7.20181205 -lHSarray-0.5.2.0-ghc8.7.20181205 -lHSbase-4.12.0.0-ghc8.7.20181205 -lHSinteger-gmp-1.0.2.0-ghc8.7.20181205 -lHSghc-prim-0.5.3-ghc8.7.20181205 -lHSrts_thr-ghc8.7.20181205 -lffi -ltinfo -lrt -lutil -ldl -lgmp -lm -lrt -ldl -lnuma *** Deleting temp files: Deleting: /run/user/1000/ghc13514_0/ghc_1.c /run/user/1000/ghc13514_0/ghc_3.rsp /run/user/1000/ghc13514_0/ghc_4.s /run/user/1000/ghc13514_0/ghc_6.rsp /run/user/1000/ghc13514_0/ghc_7.rsp /run/user/1000/ghc13514_0/ghc_2.o /run/user/1000/ghc13514_0/ghc_5.o *** Deleting temp dirs: Deleting: /run/user/1000/ghc13514_0 }}} Note that **make also uses `-lffi`**. Hence I will proceed under the assumption that `-lffi` is correct, and the problem that needs to be solved in getting the linker to correctly find the locally built libffi .so file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by davide): The locally built libffi is bundled with the rts package. As libffi is ''not'' a haskell library, the naming convention is to call the library `Cffi` in `rts/rts.cabal.in` (see specifically the line `extra-bundled- libraries: Cffi`). When ghc is calculating the linker options, ghc sees that `Cffi` is bundled with rts and tries to link with it. The "C" prefix is striped, but unlike haskell libraries a version number is not suffixed (this logic is in `compiler/main/Packages.hs:packageHsLibs`). Hence ghc links with the `-lffi` option instead of e.g. `-lCffi` or `-lCffi-7.0`. This means the linker is looking for a corresponding .so file named `libffi.so`. As per comment:14 it is easy to produce the `libffi.so` file, but it isn't in the correct location at the moment. There are 2 relevant steps that hadrian takes here: 1. After building libffi, copy the .so from `_build/stage1/libffi/build/inst/lib/libffi.so` to `_build/stage1/rts/build/X`. 2. "Install" the .so by copying it from `_build/stage1/rts/build/` to `_build/stage1/lib/x86_64-linux-ghc-8.7.20181205/X` Currently X in 1 and 2 uses a naming convention convention of e.g .`libCffi-ghc8.7.20181126_thr_debug.so`. This naming convention does **not** match ghc's as described before. It seems that changing X to match the ghc naming convention would solve the problem, but is that the correct solution? Changing the naming convention for the static libffi libraries also sounds necessary, but I thought the the static build been working so far. How is that possible? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 -------------------------------------+------------------------------------- Comment (by davide): When looking at the output of make I get: {{{ $ find . -name "*ffi*.so*" -or -name "*ffi*.a*" ./libffi/build/x86_64-unknown-linux-gnu/.libs/libffi_convenience.a ./libffi/build/x86_64-unknown-linux-gnu/.libs/libffi.so.7.1.0 ./libffi/build/x86_64-unknown-linux-gnu/.libs/libffi.so.7 ./libffi/build/x86_64-unknown-linux-gnu/.libs/libffi.so ./libffi/build/x86_64-unknown-linux-gnu/.libs/libffi.a ./libffi/build/inst/lib/libffi.so.7.1.0 ./libffi/build/inst/lib/libffi.so.7 ./libffi/build/inst/lib/libffi.so ./libffi/build/inst/lib/libffi.a ./rts/dist/build/libCffi_p.a ./rts/dist/build/libffi.so ./rts/dist/build/libffi.so.7 ./rts/dist/build/libffi.so.7.1.0 ./rts/dist/build/libCffi_l.a ./rts/dist/build/libCffi_debug.a ./rts/dist/build/libCffi_thr.a ./rts/dist/build/libCffi_thr_debug.a ./rts/dist/build/libCffi_thr_l.a ./rts/dist/build/libCffi_thr_p.a ./rts/dist/build/libCffi_thr_debug_p.a ./rts/dist/build/libCffi_debug_p.a ./rts/dist/build/libCffi.a }}} Note that all the `libCffi*.a` files are identical, and all `libCffi*.so` files are identical. == Dynamic This matches closely with my previous comments, but with the addition of some extra versioned .so files. Note the symlinks: {{{ $ ls -l _build/stage1/libffi/build/inst/lib/libffi.so* lrwxrwxrwx 1 david david 15 Dec 6 10:28 _build/stage1/libffi/build/inst/lib/libffi.so -> libffi.so.7.1.0 lrwxrwxrwx 1 david david 15 Dec 6 10:28 _build/stage1/libffi/build/inst/lib/libffi.so.7 -> libffi.so.7.1.0 -rwxr-xr-x 1 david david 70232 Dec 6 10:28 _build/stage1/libffi/build/inst/lib/libffi.so.7.1.0 }}} == Static This matches hadrians behavior w.r.t static libffi. On that grounds I'm going to leave the static libs behavior as is, but add a note about possible simplification here: only copy a single .a file as we will do with the dynamic version. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 Phab:D5423 -------------------------------------+------------------------------------- Changes (by davide): * differential: Phab:D5385 Phab:D5327 => Phab:D5385 Phab:D5327 Phab:D5423 Comment: I've created a patch Phab:D5423, with a note about future improvement. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary
-------------------------------------+-------------------------------------
Reporter: davide | Owner: davide
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build System | Version: 8.6.1
(Hadrian) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5385
Wiki Page: | Phab:D5327 Phab:D5423
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 Phab:D5423 -------------------------------------+------------------------------------- Comment (by davide): This is mostly resolved in https://gitlab.haskell.org/ghc/ghc/merge_requests/174 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary
-------------------------------------+-------------------------------------
Reporter: davide | Owner: davide
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build System | Version: 8.6.1
(Hadrian) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5385
Wiki Page: | Phab:D5327 Phab:D5423
-------------------------------------+-------------------------------------
Comment (by Marge Bot

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 Phab:D5423 -------------------------------------+------------------------------------- Comment (by bgamari): Is this now fixed, davide? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15837: Hadrian should build dynamically linked ghc binary -------------------------------------+------------------------------------- Reporter: davide | Owner: davide Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.6.1 (Hadrian) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5385 Wiki Page: | Phab:D5327 Phab:D5423 -------------------------------------+------------------------------------- Changes (by davide): * status: new => closed * resolution: => fixed Comment: For the most part yes. Any further issues can be documented in separate tickets. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15837#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC