Bug 161356 - lang/ghc: bootstrap assumes `gcc', ignoring CC
lang/ghc: bootstrap assumes `gcc', ignoring CC
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: haskell
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-07 10:30 UTC by nalitoja
Modified: 2013-01-22 11:06 UTC (History)
0 users

See Also:


Attachments
pass_CC_from_environment_always.diff (1.08 KB, patch)
2011-10-07 10:30 UTC, nalitoja
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nalitoja 2011-10-07 10:30:06 UTC
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.

Fix: The first part seems trivial. As for `-pgmc ${CC}' not sure yet.
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
Comment 1 Edwin Groothuis freebsd_committer 2011-10-07 10:30:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->haskell

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter freebsd_committer 2013-01-22 10:52:50 UTC
Author: pgj
Date: Tue Jan 22 10:52:37 2013
New Revision: 310825
URL: http://svnweb.freebsd.org/changeset/ports/310825

Log:
  - Fix configure flags for the bootstrap compiler, so now it works for
    clang-only base systems too [1]
  - Allow to use GCC 4.6 and later (requested by: gerald)
  - Add USE_NCURSES, so now it can pick up ports ncurses when installed
  - Fix COMMENT to comply with the Porter's Handbook
  
  PR:		ports/161356 [1]
  Submitted by:	David Marker <dmarker@freedave.net> (reworked by: ashish) [1]
  Obtained from:	FreeBSD Haskell

Modified:
  head/lang/ghc/Makefile
  head/lang/ghc/bsd.cabal.mk

Modified: head/lang/ghc/Makefile
==============================================================================
--- head/lang/ghc/Makefile	Tue Jan 22 10:51:18 2013	(r310824)
+++ head/lang/ghc/Makefile	Tue Jan 22 10:52:37 2013	(r310825)
@@ -10,7 +10,7 @@ MASTER_SITE_SUBDIR=	pgj/:boot
 DISTFILES=	ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source
 
 MAINTAINER=	haskell@FreeBSD.org
-COMMENT=	A Compiler for the functional language Haskell
+COMMENT=	Compiler for the functional language Haskell
 
 ONLY_FOR_ARCHS=	i386 amd64
 
@@ -30,7 +30,8 @@ USE_PERL5_BUILD=	yes
 USE_GMAKE=		yes
 USE_ICONV=		yes
 USE_BINUTILS=		yes
-USE_GCC=		4.6
+USE_GCC=		4.6+
+USE_NCURSES=		yes
 
 LICENSE=	BSD
 LICENSE_FILE=	${WRKSRC}/LICENSE
@@ -121,7 +122,7 @@ BOOT_HSC2HS=	${BOOT_DIR}/bin/hsc2hs
 
 SLAVE_CMD=	${SETENV} PATH=${BOOT_DIR}/bin:${PATH}
 
-CONFIGURE_ARGS_BOOT=	--prefix=${BOOT_DIR} CC=${CC}
+CONFIGURE_ARGS_BOOT=	--prefix=${BOOT_DIR} --with-gcc=${CC}
 CONFIGURE_ARGS+=	--with-ghc=${BOOT_GHC}
 
 .else # MBOOT
@@ -201,13 +202,13 @@ post-extract:
 .else
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "BSD_PATH_TO_HSC2HS = ${BOOT_HSC2HS}"
 .endif
-	@${ECHO} >> ${WRKSRC}/mk/build.mk "SRC_HC_OPTS += -I/usr/include -L/usr/lib -I${LOCALBASE}/include -L${LOCALBASE}/lib"
+	@${ECHO} >> ${WRKSRC}/mk/build.mk "SRC_HC_OPTS += -I${NCURSESINC} -L${NCURSESLIB} -I${LOCALBASE}/include -L${LOCALBASE}/lib"
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "SRC_CC_OPTS += ${CFLAGS}"
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "EXTRA_HSC2HS_OPTS += -I${LOCALBASE}/include --lflag=-L${LOCALBASE}/lib"
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "EXTRA_LD_OPTS += -L${LOCALBASE}/lib"
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "EXTRA_CABAL_CONFIGURE_FLAGS += --extra-include-dirs=${LOCALBASE}/include"
 	@${ECHO} >> ${WRKSRC}/mk/build.mk "EXTRA_CABAL_CONFIGURE_FLAGS += --extra-lib-dirs=${LOCALBASE}/lib"
-	@${ECHO} >> ${WRKSRC}/mk/build.mk "libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes=/usr/include --configure-option=--with-curses-libraries=/usr/lib"
+	@${ECHO} >> ${WRKSRC}/mk/build.mk "libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes=${NCURSESINC} --configure-option=--with-curses-libraries=${NCURSESLIB}"
 #	@${ECHO} >> ${WRKSRC}/mk/build.mk "BIN_DIST_NAME = ghc-\$$(ProjectVersion)-boot"
 #	@${ECHO} >> ${WRKSRC}/mk/build.mk "BIN_DIST_TAR  = ghc-\$$(ProjectVersion)-amd64-ash0-freebsd8-boot.tar"
 

Modified: head/lang/ghc/bsd.cabal.mk
==============================================================================
--- head/lang/ghc/bsd.cabal.mk	Tue Jan 22 10:51:18 2013	(r310824)
+++ head/lang/ghc/bsd.cabal.mk	Tue Jan 22 10:52:37 2013	(r310825)
@@ -81,7 +81,7 @@ BUILD_DEPENDS+=	ghc>=${GHC_VERSION}:${PO
 .endif
 
 USE_BINUTILS=	yes
-USE_GCC=	4.6
+USE_GCC=	4.6+
 
 .if ${PORT_OPTIONS:MDYNAMIC}
 LIB_DEPENDS+=	ffi.5:${PORTSDIR}/devel/libffi
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Gabor Pali freebsd_committer 2013-01-22 11:02:54 UTC
State Changed
From-To: open->closed

We have added ports GCC as an explicit dependency to the port and now we 
have fixed to make the bootstrap compiler work with that correctly. 
Note that clang is not supported by the port yet this way, but enables 
to build when GCC is not used for the base system.