Open karawitan opened 4 years ago
Ok finally solved it thanks to "brew install --debug" When install step failed, Brew offered me a few choices, among which I choose to run a shell.
Then, I just add to remove the offending flags,
bash-3.2$ pwd /private/tmp/ghc--binary20200126-81029-sp839b/ghc-7.10.2
bash-3.2$ find . -name *mk | xargs grep token grep: ./mk: Is a directory ./mk/config.mk:RAWCPP_FLAGS += -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs
And, 'make install'
Thank you! I'll try to fix this in the formula.
Tried the following patch to ghc.rb Formula:
iMac:Formula admin$ gd --patch ghc.rb diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb index b1be66ff94..a1c37116b5 100644 --- a/Library/Formula/ghc.rb +++ b/Library/Formula/ghc.rb @@ -12,6 +12,11 @@ class Ghc < Formula sha256 "b94cb5912e23a86a475a10114bf14da05fcbbb6b5b85584998f566fc64c01461" => :mountain_lion end + patch :p0 do + url "https://raw.githubusercontent.com/berryamin/tigerbrew/master/Patches/ghc-7.0.2-mlion.diff" + sha256 "a1251e065866322f5524cad4dd1d4fce521c27e2cb6b2f53f1093f18c402eed2" + end + option "with-tests", "Verify the build using the testsuite." deprecated_option "tests" => "with-tests"
But still fails later on with:
Warning: Bottle installation failed: building from source. ==> Downloading https://downloads.haskell.org/~ghc/7.10.2/ghc-7.10.2-src.tar.xz Already downloaded: /Users/admin/Library/Caches/Homebrew/ghc-7.10.2.tar.xz ==> Downloading https://raw.githubusercontent.com/berryamin/tigerbrew/master/Patches/ghc-7.0.2-mlion.diff ################################################################################################################################################################################# 100.0% ==> Patching ==> Applying ghc-7.0.2-mlion.diff patching file mk/config.mk.in Hunk #1 succeeded at 633 with fuzz 1. ==> Downloading http://ftpmirror.gnu.org/gmp/gmp-6.0.0a.tar.bz2 Already downloaded: /Users/admin/Library/Caches/Homebrew/ghc--gmp-6.0.0a.tar.bz2 ==> ./configure --prefix=/usr/local/Cellar/ghc/7.10.2/libexec/integer-gmp --with-pic --disable-shared ==> make ==> make check ==> make install ==> Downloading https://downloads.haskell.org/~ghc/7.10.2/ghc-7.10.2-x86_64-apple-darwin.tar.xz Already downloaded: /Users/admin/Library/Caches/Homebrew/ghc--binary-7.10.2.tar.xz ==> ./configure --prefix=/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary --with-gmp-includes=/usr/local/Cellar/ghc/7.10.2/libexec/integer-gmp/include --with-gmp-libraries=/usr/ ==> make install Last 15 lines from /Users/admin/Library/Logs/Homebrew/ghc/06.make: chmod +x "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/bin/ghc-7.10.2" "rm" -f "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/bin/ghc" ln -s ghc-7.10.2 "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/bin/ghc" /usr/bin/install -c -m 755 -d "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/share/man" /usr/bin/install -c -m 755 -d "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/share/man/man1" /usr/bin/install -c -m 644 docs/man/ghc.1 "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/share/man/man1" # driver/ghc-usage.txt driver/ghci-usage.txt includes/dist-derivedconstants/header/platformConstants settings = libraries to install # "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2" = directory to install to /usr/bin/install -c -m 755 -d "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2" for i in driver/ghc-usage.txt driver/ghci-usage.txt includes/dist-derivedconstants/header/platformConstants settings; do case $i in *.a) /usr/bin/install -c -m 644 $i "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2"; ranlib "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2"/`basename $i` ;; *.dll) /usr/bin/install -c -m 755 $i "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2" ; strip "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2"/`basename $i` ;; *.so) /usr/bin/install -c -m 755 $i "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2" ;; *.dylib) /usr/bin/install -c -m 755 $i "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2";; *) /usr/bin/install -c -m 644 $i "/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2"; esac; done llvm-gcc -E -m64 -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs -P -DINSTALLING -DLIB_DIR='"/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2"' -DINCLUDE_DIR='"/private/tmp/ghc20200212-43502-qi6om8/ghc-7.10.2/binary/lib/ghc-7.10.2/include"' -DPAPI_INCLUDE_DIR="" -DPAPI_LIB_DIR="" -DFFI_INCLUDE_DIR= -DFFI_LIB_DIR= '-DFFI_LIB="Cffi"' -x c -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header rts/package.conf.in -o rts/dist/package.conf.install.raw cc1: error: unrecognized command line option "-Wno-invalid-pp-token" cc1: error: unrecognized command line option "-Wno-unicode" make[1]: *** [rts/dist/package.conf.install] Error 1 make: *** [install] Error 2
I will try again later :)
Might be related to https://gitlab.haskell.org/ghc/ghc/issues/9257
I have a bunch of ghc versions for 64bit Intel 10.6 and up, and stack/cabal here https://github.com/kencu/ghc-for-older-darwin-systems/releases .
I have not tried 10.4 or 10.5, however. Last I looked both the PPC and i386 code generation has bitrotted, but I haven't tried recently.
Hello,
when trying to compile ghc on Mountain Lion, here is what I get .. I tried to look at the ghc "Formula" ( /usr/local/Homebrew/Library/Formula/ghc.rb ), but I don't understand (yet) how to strip off the offending llvm-gcc flags "-Wno-invalid-pp-token" and "-Wno-unicode" .
any hints would be greatly appreciated;