When I try to compile the kernel modules for vmware Workstation 16 on my rhel8 host, I get the following:
> sudo /usr/bin/vmware-config.pl
*snip*
Your kernel was built with "gcc" version "8.3.1", while you are trying to use
"/bin/gcc" version "8". This configuration is not supported and VMware
Workstation cannot work in such configuration. Please either recompile your
kernel with "/bin/gcc" version "8", or restart /usr/bin/vmware-config.pl with
CC environment variable pointing to the "gcc" version "8.3.1".
Yet /bin/gcc -v gives me:
> /bin/gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
Setting 'export CC=/bin/gcc' doesn't help.
How can I get vmware-config.pl to pick up the correct gcc version?