Switch to a previous version of gcc

The current version of gcc is :

gcc (Clear Linux OS for Intel Architecture) 10.2.1 20210303 releases/gcc-10.2.0-895-g2939b35893

I need an older version 8 or 9 for compiling riscv-toolchain and openocd.
These versions are already installed.
I tryed to export CC and CCX with a new path before ./configure and make, but gcc remains on 10.2.1.
Any help would be appreciated.
Marie

c-extras-gcc9

Hello
I really appreciate your help.
Could you provide more details?
I have already installed c-extras-gcc9 from swupd bundle-add.
How to switch before compiling between gcc10.2.1 to gcc9?
Switching is required only for few applications. Is a backward possible?
Many thanks
Marie

change environment variable cc

How do you do this exactly?

What fella ment is:

CC=gcc-9 [NM=gcc-nm-9 AR=gcc-ar-9 RANLIB=gcc-ranlib-9] [command]

I thought I buried enough time in other systems. I was wrong :blush:
Still, I rather do it by commands, than let someone decide for me.