Compile modules with `-fobject-code` enabled to byte-code when loaded with `*`...

Compile modules with `-fobject-code` enabled to byte-code when loaded with `*` prefix in ghci (#8042)

The documentation states that when using :add and :load, the `*` prefix forces a module
to be loaded as byte-code. However, this seems to be ignored when -fobject-code has been
enabled. In that case, the compiled code is always used, regardless of whether the *-form
is used.

The idea is to consult the Targets in HscEnv and check the 'targetAllowObjCode' flag. If
the flag for given module is set, then patch up DynFlags and select compilation backend
accordingly.

This would require a linear scan of course, but that shouldn't be too costly.
23 jobs for !4301 with T8042 in 323 minutes and 43 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Tool Lint
passed #475866
lint
ghc-linters

00:01:09

passed #475867
lint
lint-linters

00:01:04

passed #475870
lint
lint-submods

00:00:21

passed #475868
lint
lint-testsuite

00:00:16

passed #475869
lint
typecheck-testsuite

00:00:14

 
  Quick Build
passed #475871
x86_64-linux
hadrian-ghc-in-ghci

00:11:48

 
  Lint
passed #475872
lint
lint-base

00:14:14

 
  Build
passed #475873
x86_64-linux
stack-hadrian-build

00:09:04

passed #475874
x86_64-linux
validate-x86_64-linux-deb9-hadrian

01:06:31

 
  Full Build
failed #475877
aarch64-linux allowed to fail
validate-aarch64-linux-deb10

00:17:48

failed #475878
armv7-linux allowed to fail
validate-armv7-linux-deb10

00:18:53

passed #475879
x86_64-linux
validate-i386-linux-deb9

01:30:20

passed #475876
x86_64-darwin
validate-x86_64-darwin

01:10:21

passed #475880
x86_64-linux
validate-x86_64-linux-deb9-debug

01:46:21

passed #475882
x86_64-linux
validate-x86_64-linux-deb9-dwarf

02:08:02

passed #475881
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:24:52

passed #475875
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

02:35:10

passed #475883
x86_64-linux
validate-x86_64-linux-fedora27

01:53:30

passed #475884
new-x86_64-windows test
validate-x86_64-windows-hadrian

03:37:12

 
  Packaging
failed #475885
x86_64-linux allowed to fail
doc-tarball

00:01:55

 
  Testing
manual #475886
x86_64-linux allowed to fail manual
hackage
passed #475888
x86_64-linux-perf
perf

00:08:14

passed #475887
x86_64-linux
perf-nofib

00:24:28

 
Name Stage Failure
failed
doc-tarball Packaging
+ cd ..
+ '[' 0 -eq 0 ']'
+ rm -r linux
+ tar -Jxf /builds/nineonine/ghc/ghc-x86_64-unknown-mingw32.tar.xz
+ mv ghc-9.1.0.20201019-x86_64-unknown-mingw32 windows
+ cd inst/share/doc/ghc-9.1.0.20201019/html/libraries
+ mv '../../../../../../windows/doc/html/libraries/Win32-*' .
mv: cannot stat '../../../../../../windows/doc/html/libraries/Win32-*': No such file or directory
ERROR: Job failed: exit code 1
failed
validate-aarch64-linux-deb10 Full Build
Uploading artifacts...
WARNING: ghc-aarch64-linux-deb10.tar.xz: no matching files
WARNING: junit.xml: no matching files
WARNING: performance-metrics.tsv: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
validate-armv7-linux-deb10 Full Build
Uploading artifacts...
WARNING: ghc-armv7-linux-deb10.tar.xz: no matching files
WARNING: junit.xml: no matching files
WARNING: performance-metrics.tsv: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1