Ports That Redefine CC / CPP / CXX

Some ports hardcode which version they want by redefining the CC and/or CPP and/or CXX Makevars. In PR 229626 MarkLinimon claims that this is a bad implementation, and that the values instead should be passed via environment variables. However, that PR as yet has not received any attention.

The problem is that each of these ports generates extra output lines at the end of any bulk poudriere run on any GCC-based arch (see more complete list below). Example from a powerpc64 build:

  /bin/sh: clang60: not found
  make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 78: warning: "clang60 --version" returned non-zero status
  make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 133: warning: "clang++60 -### /dev/null 2>&1" returned non-zero status

This is annoying. The usage ought to be discouraged.

/!\ Even if the port correctly parameterizes the version, this is still not the correct way to do things.

Wrong:

CC=             ${LOCALBASE}/bin/clang${LLVM_VER}
CXX=            ${LOCALBASE}/bin/clang++${LLVM_VER}

Correct (certain ports):

CONFIGURE_ENV+= CC=${LOCALBASE}/bin/clang${LLVM_VER} \
                CXX=${LOCALBASE}/bin/clang++${LLVM_VER} \
                LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_VER}

Correct (gmake-based ports):

MAKE_ENV+=      CC=${LOCALBASE}/bin/clang${LLVM_VER} \
                CXX=${LOCALBASE}/bin/clang++${LLVM_VER} \
                LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_VER}

Correct (cmake-based ports):

CMAKE_ARGS= -DLLVM_CONFIG_EXECUTABLE:PATH=${LOCALBASE}/bin/llvm-config${LLVM_VER} \

/!\ TODO some ports ignore the passed parameters. These ports are multiply broken and must be fixed.

portname

redefinition

implied version

technology

patch available?

Mk/bsd.gecko.mk

${LOCALBASE}/bin/clang${LLVM_DEFAULT}, or 80

comms/gnuradio

clang${LLVM_DEFAULT}

cmake

yes

devel/ikos

clang${LLVM_VERSION}

80

cmake

yes

devel/linux_libusb

${LINUXBASE}/usr/bin/gcc

devel/mingw32-libffi

${PKGNAMEPREFIX}gcc

devel/mingw32-libyaml

${PKGNAMEPREFIX}gcc

devel/oclgrind

clang${LLVM_DEFAULT}, or 80

cmake

emulators/virtualbox-ose

${LOCALBASE}/bin/clang${VBOX_LLVM_VER}

60

CONFIGURE_ARGS

graphics/darktable

clang${LLVM_VER}

60

cmake

yes

graphics/pcl-pointclouds

clang${LLVM_DEFAULT}

cmake

yes

lang/ldc

clang70, llvm80

cmake

lang/ponyc

${LOCALBASE}/bin/clang${LLVM_VERSION}

70

MAKE_ENV

yes

mail/openemm2013

clang

MAKE_ENV

(expiring: ignore)

mail/openemm2015

clang

MAKE_ENV (patch under test)

yes

math/blis

clang${LLVM_VER}

60

CONFIGURE_ARGS

yes

math/libpgmath

${LOCALBASE}/llvm60/bin/clang

cmake

yes

math/mingw32-libgmp

${PKGNAMEPREFIX}gcc

math/saga

clang${LLVM_VER}

80

CONFIGURE_ARGS

yes

misc/veles

clang${LLVM_DEFAULT}

cmake

yes

science/agrum

clang${LLVM_DEFAULT}

cmake

yes

science/erkale

clang${LLVM_DEFAULT}

cmake

yes

Example Annoying Results

As of 20191021:

[00:06:03] Cleaning restricted packages
sh: clang70: not found
sh: clang: not found
sh: mingw32-gcc: not found
sh: clang: not found
sh: clang80: not found
make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 78: warning: "clang80 --version" returned non-zero status
make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 133: warning: "clang++80 -### /dev/null 2>&1" returned non-zero status
sh: /compat/linux/usr/bin/gcc: not found
sh: mingw32-gcc: not found
sh: mingw32-gcc: not found
sh: clang: not found
sh: clang80: not found
make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 78: warning: "clang80 --version" returned non-zero status
make[2]: "/usr/ports/Mk/Uses/compiler.mk" line 133: warning: "clang++80 -### /dev/null 2>&1" returned non-zero status


CategoryPorts CategoryTodo

HardcodedCCVersions (last edited 2019-12-04T19:14:59+0000 by MarkLinimon)