/var/folders/xc/jnh69_cx1n32n1qwkgfrlc100000gq/T/encoding-0.6.620435/encoding-0.6.6/dist/setup/setup:
/var/folders/xc/jnh69_cx1n32n1qwkgfrlc100000gq/T/encoding-0.6.620435/encoding-0.6.6/dist/setup/setup:
cannot execute binary file
That suggests something is seriously wrong with your installed ghc. Specifically, cabal is compiling the Setup.{,l}hs that comes with the package, and the result is not a valid executable for some reason. I suggest you see if a simple
> main = putStrLn "hello world"
compiles and runs, and if so then try compiling the Setup.hs or Setup.lhs file in the distribution manually and see if that compiles and runs.
--