Clang cross-compiler for ELF under OS X
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Clang cross-compiler for ELF under OS X
I've been trying to get a cross compiler set up under OS X, but can't seem to get it right. I have i586-elf-binutils, nasm, and qemu installed properly, but clang simply refuses to accept the target configuration I give it. I configure the latest trunk build with "--target=i586-elf", and it seems to work (configure reports that build and host are x86_64-apple-darwin and target is i586-elf) but once it compiles the resulting executable reports its target as x86_64-apple-darwin and produces only Mach-O executables. Any idea of what I'm doing wrong?
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Clang cross-compiler for ELF under OS X
Okay, then how do you tell clang to output ELF when you invoke it? I've been searching the user documentation and various other sites for hours, and I can only find options that switch architecture, not executable format. The only command line option I've been giving it is -m32.