How to make a cross compiler for xilinx microblaze

Hello,

i am trying to create a LLVM stack to cross compile c code targeting the xilinx microblaze.

I built LLVM configured with target=microblaze however cland doesn't like it. When i try to emit llvm code i get the following
error: unknown target triple 'microblaze-unknown-none', please use -triple or -arch

How should i configure my LLVM stack and then how should i run the tools to produce microblaze-elf?

Thank you
Foivos

Try "mblaze-elf".

-Eli

Hi Fivos,

LLVM refers to the target as "mblaze" for -target.

-Jim

conmfigure does not accept mblaze nor mblaze-elf as target.

checking target system type... Invalid configuration `mblaze': machine `mblaze' not recognized
configure: error: /bin/bash ../../spare/llvm/autoconf/config.sub mblaze failed

However with microblaze it proceeds fine. But when i try to use clang i get:
clang: error: 'microblaze-unknown-none': unable to pass LLVM bit-code files to linker

if i give mblaze as the target it still fails with:
clang: error: 'mblaze': unable to pass LLVM bit-code files to linker

I also built LLVM without giving a target to the configuration and it still gives
clang: error: 'mblaze': unable to pass LLVM bit-code files to linker

Foivos

Ok, i figured it out. It was my fault trying to pass the bit-code to the linker as it is the hosts linker and not the targets.

clang -S -emit-llvm -target mblaze test.c -o test.ll
works fine

However i would like to be able to configure llvm so that i don't need to pass -target and -march to the command line (i know i can do it with alias).

Thank you
Foivos