Cross compile for aarch64-elf baremetel

Hi,

I’m trying to use Linaro aarch64-elf (e.g. ) with clang.

I set the --gcc-toolchain and -sysroot to the corresponding patsh but it still uses my host /usr/bin/ld instead of the one in my GCC. I find that, in getToolChain(), it gets Generic_ELF and the GCCInstallationDetector is only used by Linux toolchain.

Should we fix the driver or if I missed something?

Thanks,

Weiming

Hi Weiming,

Did you use the -triple as "aarch64-elf"? On ARM, I found that this is
all you need to get the driver to find the right tools. I haven't
needed to use -gcc-tools or anything.

Also, be careful that bare-metal GNU toolchains are also bare. You'll
need to add -l* to all libraries that you need, maybe include paths,
etc.

cheers,
--renato

Hi Renato,

Thanks a lot!

I need to add the GCC/bin into my $PATH.

Previously, I was using --gcc-toolchain, which doesn’t require the toolchain be in my $PATH.

Thanks,

Weiming

Indeed, that'd do. :slight_smile:

cheers,
--renato