[LLVMdev] setting up LLVM to *run on* amd64 but *generate code* for alpha

Bill Wendling isanbard at gmail.com
Sat Mar 14 02:35:35 PDT 2009


On Fri, Mar 13, 2009 at 6:20 PM, Zack Weinberg <zackw at panix.com> wrote:
> On Fri, Mar 13, 2009 at 6:09 PM, Bill Wendling <isanbard at gmail.com> wrote:
>> On Fri, Mar 13, 2009 at 4:41 PM, Zack Weinberg <zackw at panix.com> wrote:
>>> I'm trying to persuade llvm (svn trunk) to build in a mode where it
>>> *runs on* amd64 but *generates code* for alpha, exclusively.
> ...
>>>  - The "natural" way to do that (by which I mean "the way you would do
>>> it if you believe what it says in the autoconf manual") would be to
>>> specify --build=x86_64-unknown-linux --target=alpha-unknown-linux.
>>> This produces Makefiles that bomb out on the very first file in the
>>> tree:
>>>
>>> $ make
>>> llvm[1]: Compiling Alarm.cpp for Debug build
>>> cc1plus: error: unrecognized command line option "-mieee"
>>> cc1plus: error: unrecognized command line option "-mieee"
>>>
>>> because Makefile.config has ARCH=Alpha, and Makefile.rules changes the
>>> options passed to the build compiler based on ARCH.  IMO this is a
>>> bug, but I don't understand your makefile system well enough to fix
>>> it.
>>>
>> LLVM has different back-ends that it generates. These back-ends are
>> loaded when needed. You select them with the "-march" option of the
>> "llc" tool. What you're trying to do here is have the LLVM *binaries*
>> be Alpha binaries.
>
> That does appear to be what the makefiles are doing, but that is not
> what I want and not what --target is supposed to do; to "have the LLVM
> *binaries* be Alpha binaries" I ought to say --build=amd64-linux
> --host=alpha-linux and leave --target alone.
>
What point does this serve? We already have the ability to generate
code for any of our supported targets from the build/host machine.

> Specifying --build and --target but not --host [again, according to
> the autoconf manual] is supposed to create binaries that run on the
> --build machine and generate code for the --target
> machine, which is what I want.
>
It makes no sense. I told you how to do that without using these
flags. Why do you insist on using them? Who said that we had to follow
autoconf exactly and support all of it's flags, which are legion in
number?

>> llvmc will wrap around the llvm-gcc executable. If your built llvm-gcc
>> doesn't allow the "-arch" flag, then that would be the reason. I don't
>> think that the shipped llvm-gcc supports Alpha. I don't use "llvmc",
>> though, so I'm not sure how to help you with this.
>
> I don't understand this.  I am not using llvm-gcc and did not even install it.
>
>> You are going to have to build llvm-gcc as a cross-compiler so that
>> you can get the features you are wanting here. By default, llvm-gcc is
>> built for the host platform, so there are no need for such
>> <target-triplet> drivers.
>
> Same observation ...
>
My observation: You mentioned llvmc. That uses llvm-gcc, from what I
understand. Maybe it also uses clang? I don't know. Perhaps you could
use "-v" to see what command it's really using?

-bw




More information about the llvm-dev mailing list