[Bug 264192] lang/ghc: poudriere based build used odd mix of devel/llvm10 and system toolchain

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 27 Aug 2022 01:02:23 UTC

--- Comment #41 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Gleb Popov from comment #40)

You have not answered how lang/ghc/Makefile leads to
bootstrap 8.10.7 using LLVM10's clang for/during its
build. There is evidence of use:

# grep -r "\<CC\>" work/ghc-8.10.7-boot/ | more
Binary file
work/ghc-8.10.7-boot/utils/ghc-cabal/dist-install/build/tmp/ghc-cabal matches
Binary file work/ghc-8.10.7-boot/utils/ghc-pkg/dist-install/build/tmp/ghc-pkg
Binary file work/ghc-8.10.7-boot/utils/iserv/stage2/build/tmp/ghc-iserv matches
work/ghc-8.10.7-boot/mk/config.mk.in:# NB. Don't override $(CC) using build.mk,
 re-configure using
work/ghc-8.10.7-boot/mk/config.mk.in:# the flag CC=<blah> instead.  The reason
is that the configure script
work/ghc-8.10.7-boot/mk/config.mk.in:CC              = @CC@
work/ghc-8.10.7-boot/mk/config.mk.in:CC_STAGE1       = $(CC)
work/ghc-8.10.7-boot/mk/config.mk.in:CC_STAGE2       = $(CC)
work/ghc-8.10.7-boot/mk/config.mk.in:CC_STAGE3       = $(CC)
work/ghc-8.10.7-boot/mk/config.mk.in:AS              = @CC@
work/ghc-8.10.7-boot/includes/ghc.mk:DERIVE_CONSTANTS_FLAGS += --gcc-program
. . .

# grep -r "\<CLANG\>" work/ghc-8.10.7-boot/ | more
work/ghc-8.10.7-boot/mk/config.mk.in:CLANG = @ClangCmd@

Similarly for how lang/ghc/Makefile leads to 9.2.4
using LLVM12's clang for/during its build. There is
evidence of use:

# grep -r "\<CC\>" work/ghc-9.2.4/ | more
work/ghc-9.2.4/configure:To assign environment variables (e.g., CC, CFLAGS...),
specify them as
work/ghc-9.2.4/configure:  --with-gcc=ARG          Use ARG as the path to gcc
(obsolete, use CC=ARG
work/ghc-9.2.4/configure:  --with-clang=ARG        Use ARG as the path to clang
(obsolete, use CC=ARG
work/ghc-9.2.4/configure:  CC          C compiler command
work/ghc-9.2.4/configure:ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext
work/ghc-9.2.4/configure:ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS
$LDFLAGS conftest.$ac_ext $LIBS >&5'
work/ghc-9.2.4/configure:    CC="${mingwbin}gcc.exe"
. . .

# grep -r "\<CLANG\>" work/ghc-9.2.4/ | more
work/ghc-9.2.4/configure:  CLANG       Use as the path to clang
work/ghc-9.2.4/configure:  if test -n "$CLANG"; then
work/ghc-9.2.4/configure:  ac_cv_prog_CLANG="$CLANG" # Let the user override
the test.
work/ghc-9.2.4/configure:if test -n "$CLANG"; then
work/ghc-9.2.4/configure:  { printf "%s\n" "$as_me:${as_lineno-$LINENO}:
result: $CLANG" >&5
work/ghc-9.2.4/configure:printf "%s\n" "$CLANG" >&6; }
work/ghc-9.2.4/configure:    ac_ct_CLANG=$CLANG
work/ghc-9.2.4/configure:    CLANG=$ac_ct_CLANG
work/ghc-9.2.4/configure:    CLANG=""
work/ghc-9.2.4/configure:  CLANG="$ac_cv_prog_CLANG"
. . .

You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.