ports/161356: lang/ghc: bootstrap assumes `gcc', ignoring CC

Nali Toja nalitoja at gmail.com
Fri Oct 7 09:30:07 UTC 2011


>Number:         161356
>Category:       ports
>Synopsis:       lang/ghc: bootstrap assumes `gcc', ignoring CC
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 07 09:30:06 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Nali Toja
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
WITHOUT_DOCS=
WITHOUT_PROFILE=

$ export PATH=~/.bin:$PATH
$ for cc in CC cc c++ gcc g++ cpp; do ln -s /usr/bin/false ~/.bin/${cc}; done
>Description:
ghc-boot build wants CC being set in environment, not in a makefile
(e.g. make.conf). And when set its runtime still uses `gcc' compiler
ignoring CC unlike, say, ghc/ghc.wrapper.
>How-To-Repeat:
||| replace only `gcc' with symlink to `false'

# use default `CC = cc' from sys.mk
# or define `CC = clang' in make.conf
$ make 
[...]
checking for ar... /usr/bin/ar
checking whether /usr/bin/ar is GNU ar... no
checking for ar arguments... clqs
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables

$ CC=clang make
[...]
checking for nhc... no
checking for nhc98... no
checking for hbc... no
configure: Building in-tree ghc-pwd
configure: error: Building ghc-pwd failed

WRKDIR/ghc-6.10.4-boot/bin/ghc -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd

~/.bin/gcc -Iutils/ghc-pwd -Iutils/ghc-pwd/dist-boot -c WRKDIR/ghc-7.0.3/tmp/ghc55829_0/ghc55829_0.s -o utils/ghc-pwd/dist-boot/Main.o

>Fix:
The first part seems trivial. As for `-pgmc ${CC}' not sure yet.

--- pass_CC_from_environment_always.diff begins here ---
Index: lang/ghc/Makefile
===================================================================
RCS file: /a/.csup/ports/lang/ghc/Makefile,v
retrieving revision 1.93
diff -u -p -r1.93 Makefile
--- lang/ghc/Makefile	23 Sep 2011 22:23:43 -0000	1.93
+++ lang/ghc/Makefile	7 Oct 2011 09:18:38 -0000
@@ -106,7 +106,7 @@ BOOT_HSC2HS=	${BOOT_DIR}/bin/hsc2hs
 HACKAGE_SITE?=		http://hackage.haskell.org/
 HACKAGE_ARCH?=		packages/archive/
 
-CONFIGURE_ARGS_BOOT=	--prefix=${BOOT_DIR})
+CONFIGURE_ARGS_BOOT=	--prefix=${BOOT_DIR} CC=${CC}
 CONFIGURE_ARGS+=	--with-ghc=${BOOT_GHC} --with-gcc=${CC} \
 			--with-gmp-includes=${LOCALBASE}/include \
 			--with-gmp-libraries=${LOCALBASE}/lib \
@@ -228,7 +228,7 @@ post-patch:
 
 pre-configure:
 	@${MKDIR} ${TMPDIR}
-	@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS_BOOT}
+	@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS_BOOT})
 	@(cd ${BOOT_DIR} && PACKAGES='' ${GMAKE} install)
 #	@(${BOOT_GHC-PKG} unregister haddock-${BOOT_HADDOCK_VERSION})
 #	@(cd ${BOOT_DIR} && ${RM} -rf utils/haddock && ${RM} -f bin/haddock \
--- pass_CC_from_environment_always.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list