GHCup installed ghc fails to link on Ubuntu 20-04.4

I had stack based Haskell installation and I used mostly used ghci but I wanted to restart my Haskell studies properly so I installed Haskell va GHCup on Ubuntu 20.04-4 (running in VMWare).
Installation went OK but then I tried to compile with ghc it fails, runghc still works but get linker error when trying ghc. I ran GHCup installer as non admin. I installed all the prereq tools - I can compile C programs without a problem.
I also installed GHCup on Windows and it works.

PS. It only seems to fail on /mnt shared folders. On a file that is created in Ubuntu it works correctly. So it is a bit of annoyance - cannot share Haskell project between Win10 and Ubuntu - but OK - not a sev 1 issue.

Here is output from compiler on Ubuntu:

(base) tom@ubuntu:/mnt/hgfs/work/_Languages/Haskell/learn/GHCup/first steps$ ghc -v hello.hs
Glasgow Haskell Compiler, Version 8.10.7, stage 2 booted by GHC version 8.10.4
*** initializing package database:
Using binary package database: /home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d/package.cache
package flags []
loading package database /home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.6.1
wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0
wired-in package base mapped to base-4.14.3.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.16.0.0
wired-in package ghc mapped to ghc-8.10.7
!!! initializing package database: finished in 25.71 milliseconds, allocated 8.172 megabytes
*** initializing package database:
package flags []
loading package database /home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.6.1
wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0
wired-in package base mapped to base-4.14.3.0
wired-in package rts mapped to rts-1.0.1
wired-in package template-haskell mapped to template-haskell-2.16.0.0
wired-in package ghc mapped to ghc-8.10.7
!!! initializing package database: finished in 20.41 milliseconds, allocated 3.319 megabytes
*** Chasing dependencies:
Chasing modules from: *hello.hs
!!! Chasing dependencies: finished in 0.73 milliseconds, allocated 0.284 megabytes
Stable obj: {Main}
Stable BCO: {}
Ready for upsweep
  [NONREC
      ModSummary {
         ms_hs_date = 2022-04-02 20:04:39 UTC
         ms_mod = Main,
         ms_textual_imps = [(Nothing, Prelude)]
         ms_srcimps = []
      }]
*** Deleting temp files:
Deleting: 
compile: input file hello.hs
*** Checking old interface for Main (use -ddump-hi-diffs for more details):
[1 of 1] Skipping  Main             ( hello.hs, hello.o )
Upsweep completely successful.
*** Deleting temp files:
Deleting: 
link: linkables are ...
LinkableM (2022-04-02 20:12:25 UTC) Main
   [DotO hello.o]
Linking hello ...
Created temporary directory: /tmp/ghc21731_0
*** systool:cc:
*** C Compiler:
gcc -c /tmp/ghc21731_0/ghc_1.c -o /tmp/ghc21731_0/ghc_2.o -no-pie -fno-PIC -I/home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include
!!! systool:cc: finished in 0.72 milliseconds, allocated 0.142 megabytes
*** systool:cc:
*** C Compiler:
gcc -c /tmp/ghc21731_0/ghc_4.s -o /tmp/ghc21731_0/ghc_5.o
!!! systool:cc: finished in 0.63 milliseconds, allocated 0.126 megabytes
*** systool:linker:
*** Linker:
gcc '-fuse-ld=gold' -Wl,--no-as-needed -o hello -no-pie -fno-PIC -Wl,--gc-sections hello.o -L/home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/base-4.14.3.0 -L/home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0 -L/home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/ghc-prim-0.6.1 -L/home/tom/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/rts /tmp/ghc21731_0/ghc_2.o /tmp/ghc21731_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 -lHSbase-4.14.3.0 -lHSinteger-gmp-1.0.3.0 -lHSghc-prim-0.6.1 -lHSrts -lCffi -lgmp -lc -lm -lm -lrt -ldl -lpthread
/usr/bin/ld.gold: fatal error: hello: Input/output error
collect2: error: ld returned 1 exit status
*** Deleting temp files:
Deleting: /tmp/ghc21731_0/ghc_1.c /tmp/ghc21731_0/ghc_3.rsp /tmp/ghc21731_0/ghc_4.s /tmp/ghc21731_0/ghc_6.rsp /tmp/ghc21731_0/ghc_7.rsp /tmp/ghc21731_0/ghc_2.o /tmp/ghc21731_0/ghc_5.o
*** Deleting temp dirs:
Deleting: /tmp/ghc21731_0
`gcc' failed in phase `Linker'. (Exit code: 1)

https://www.reddit.com/r/haskell/comments/oa1w84/ghc_linker_inputoutput_error/ suggests that there may be a funny character in a path name.