I am trying to build a binary for the Intel “silvermont” architecture. I do not want to build on the concerned systems directly because it is slow and there is not enough disk space to download dependencies.

I tried to mess with cargo configuration (with RUSTFLAGS and target) but every time I get the same issue: I cannot run the binary on the target machine because it appears to be a shared object.

I think older versions of file just didn’t recognize PIE – such executables have the same ELF type as shared objects, ET_DYN. And fun fact, you can execute shared objects anyway if they have a defined entry point – for example libc.so has this.