Hello.
Are you still saying that you are creating another program that does not rely
on the pkg command?
Then again, let's look at elf_tables.h.
It would be necessary to have such a conversion table.
static struct arch_trans machine_arch_translation[] = {
{ "x86:32", "i386" },
{ "x86:64", "amd64" },
{ "powerpc:32:eb", "powerpc" },
{ "powerpc:64:eb", "powerpc64" },
{ "powerpc:64:el", "powerpc64le" },
{ "sparc64:64", "sparc64" },
{ "ia64:64", "ia64" },
/* All the ARM stuff */
{ "arm:32:el:eabi:softfp", "arm" },
{ "arm:32:el:oabi:softfp", "arm" },
(omitted below)
Regards.