Cargo always want to compile to arm-linux-gnueabihf-gcc


I'm trying to figure out what is going on. Since yesterday, cargo by default for any call I do even in a new crate tries to build to arm-linux-gnueabihf-gcc which is not my computer architecture (x86_64-unknown-linux-gnu) which should be the default. I've got this error when doing cargo check in an empty new crate:

error: linker `arm-linux-gnueabihf-gcc` not found
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: could not compile `libm`

To learn more, run the command again with --verbose.

To overcome it, I always need to specify in .cargo/config.toml the architecture of my computer as a target.

Please how can I reset the default of rustc to my computer architecture?

Thanks in advance.


rustup show
# Default isn't what you want? Then:
rustup default stable-x86_64-unknown-linux-gnu

Here is the output of rustup show:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/sinfo/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.52.1 (9bc8c42bb 2021-05-09)

Here rustup seems to have x86_64-unknown-linux-gnu as default architecture, but it seems like cargo does not follow this default...

Look for .cargo/config and rustup-toolchain file (both optionally with .toml) in this or any parent directory. These config files can change the target.