diff options
author | tcberner <tcberner@FreeBSD.org> | 2018-02-10 16:03:22 +0800 |
---|---|---|
committer | tcberner <tcberner@FreeBSD.org> | 2018-02-10 16:03:22 +0800 |
commit | 347f1992f9efbc7f86322f4fdc44ef46077120b6 (patch) | |
tree | 595a1c21749cc18bad532e9f0d057b340bc9d7c3 /lang | |
parent | 59ccc6de2fad4f99c2fc31778fcbcf89ddc82c71 (diff) | |
download | freebsd-ports-gnome-347f1992f9efbc7f86322f4fdc44ef46077120b6.tar.gz freebsd-ports-gnome-347f1992f9efbc7f86322f4fdc44ef46077120b6.tar.zst freebsd-ports-gnome-347f1992f9efbc7f86322f4fdc44ef46077120b6.zip |
Switch C compiler used to compile GHC to base Clang.
This removes build dependency on gcc and runtime dependency on gcc's runtime libraries.
Big thanks to Gleb for working on this.
PR: 225185
Submitted by: Gleb Popov <6yearold@gmail.com>
Exp-run by: antoine
Reviewed by: pgj
Differential Revision: https://reviews.freebsd.org/D12043
Diffstat (limited to 'lang')
-rw-r--r-- | lang/ghc/Makefile | 9 | ||||
-rw-r--r-- | lang/ghc/bsd.cabal.mk | 7 | ||||
-rw-r--r-- | lang/ghc/files/patch-compiler_main_SysTools.hs | 12 | ||||
-rw-r--r-- | lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h | 22 | ||||
-rw-r--r-- | lang/ghc/files/patch-rts_Linker.c | 11 | ||||
-rw-r--r-- | lang/hs-brainfuck/Makefile | 1 | ||||
-rw-r--r-- | lang/hs-unlambda/Makefile | 1 |
7 files changed, 48 insertions, 15 deletions
diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile index 7be0be63f8b3..812265537e4a 100644 --- a/lang/ghc/Makefile +++ b/lang/ghc/Makefile @@ -3,7 +3,7 @@ PORTNAME= ghc PORTVERSION= ${GHC_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= lang haskell MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ LOCAL/pgj/:boot @@ -94,13 +94,6 @@ BOOT_GHC_VERSION= 7.10.2 DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot .endif # MBOOT -# LLVM is still not properly supported, further it does not make sense to have -# to depend on old llvm ports that will be removed from the ports soon. -# So for now, stick to GCC. -# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing -# We should however investigate whether base's clang is enough to build ghc&co. -# This will likely require some modifications to compiler/main/*hs -USE_GCC= yes CONFIGURE_ARGS+= -with-gcc=${CC} .if empty(PORT_OPTIONS:MBOOT) CONFIGURE_ARGS_BOOT+= --with-gcc=${CC} diff --git a/lang/ghc/bsd.cabal.mk b/lang/ghc/bsd.cabal.mk index 3a096ea45eae..fe34b743e6e1 100644 --- a/lang/ghc/bsd.cabal.mk +++ b/lang/ghc/bsd.cabal.mk @@ -96,13 +96,6 @@ BUILD_DEPENDS+= ghc:lang/ghc BUILD_DEPENDS+= ghc>=${GHC_VERSION}:lang/ghc .endif -# LLVM is still not properly supported, further it does not make sense to have -# to depend on old llvm ports that will be removed from the ports soon. -# So for now, stick to GCC -- this might change with ghc-8.4. -# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing -# We should however investigate whether base's clang is enough to build ghc&co. -USE_GCC= yes - CONFIGURE_ARGS+= --with-gcc=${CC} --with-ld=${LD} --with-ar=${AR} diff --git a/lang/ghc/files/patch-compiler_main_SysTools.hs b/lang/ghc/files/patch-compiler_main_SysTools.hs new file mode 100644 index 000000000000..06dce352555a --- /dev/null +++ b/lang/ghc/files/patch-compiler_main_SysTools.hs @@ -0,0 +1,12 @@ +--- compiler/main/SysTools.hs.orig 2017-08-12 09:25:57 UTC ++++ compiler/main/SysTools.hs +@@ -907,6 +907,9 @@ getCompilerInfo' dflags = do + -- Regular clang + | any ("clang version" `isInfixOf`) stde = + return Clang ++ -- FreeBSD clang ++ | any ("FreeBSD clang version" `isInfixOf`) stde = ++ return Clang + -- XCode 5.1 clang + | any ("Apple LLVM version 5.1" `isPrefixOf`) stde = + return AppleClang51 diff --git a/lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h b/lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h new file mode 100644 index 000000000000..77e317c60036 --- /dev/null +++ b/lang/ghc/files/patch-includes_rts_storage_ClosureMacros.h @@ -0,0 +1,22 @@ +--- includes/rts/storage/ClosureMacros.h.orig 2018-01-03 13:27:55 UTC ++++ includes/rts/storage/ClosureMacros.h +@@ -499,8 +499,17 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard ( + + -------------------------------------------------------------------------- */ + +-#define ZERO_SLOP_FOR_LDV_PROF (defined(PROFILING)) +-#define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS)) ++#if defined(PROFILING) ++#define ZERO_SLOP_FOR_LDV_PROF 1 ++#else ++#define ZERO_SLOP_FOR_LDV_PROF 0 ++#endif ++ ++#if defined(DEBUG) && !defined(THREADED_RTS) ++#define ZERO_SLOP_FOR_SANITY_CHECK 1 ++#else ++#define ZERO_SLOP_FOR_SANITY_CHECK 0 ++#endif + + #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK + #define OVERWRITING_CLOSURE(c) overwritingClosure(c) diff --git a/lang/ghc/files/patch-rts_Linker.c b/lang/ghc/files/patch-rts_Linker.c new file mode 100644 index 000000000000..9597fe887603 --- /dev/null +++ b/lang/ghc/files/patch-rts_Linker.c @@ -0,0 +1,11 @@ +--- rts/Linker.c.orig 2017-08-12 09:22:13 UTC ++++ rts/Linker.c +@@ -797,7 +797,7 @@ initLinker_ (int retain_cafs) + # endif /* RTLD_DEFAULT */ + + compileResult = regcomp(&re_invalid, +- "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)", ++ "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)", + REG_EXTENDED); + if (compileResult != 0) { + barf("Compiling re_invalid failed"); diff --git a/lang/hs-brainfuck/Makefile b/lang/hs-brainfuck/Makefile index 5605e5237b7e..bbe84280616e 100644 --- a/lang/hs-brainfuck/Makefile +++ b/lang/hs-brainfuck/Makefile @@ -3,6 +3,7 @@ PORTNAME= brainfuck PORTVERSION= 0.1.0.3 +PORTREVISION= 1 CATEGORIES= lang haskell MAINTAINER= haskell@FreeBSD.org diff --git a/lang/hs-unlambda/Makefile b/lang/hs-unlambda/Makefile index 0d448a0366d6..1f0b20f729e0 100644 --- a/lang/hs-unlambda/Makefile +++ b/lang/hs-unlambda/Makefile @@ -3,6 +3,7 @@ PORTNAME= unlambda PORTVERSION= 0.1.4.2 +PORTREVISION= 1 CATEGORIES= lang haskell MAINTAINER= haskell@FreeBSD.org |