[LLVMdev] Issue compiling llvm-gcc frontend on sparc

Chia-Wei Yeh leafy7382 at gmail.com
Mon Sep 27 18:17:08 PDT 2010


On Tue, Sep 28, 2010 at 12:51 AM, Dale Johannesen <dalej at apple.com> wrote:

>
> On Sep 26, 2010, at 3:23 PMPDT, Raghu Prabhakar wrote:
>
> > 1) During configuration, the default assembler (installed at
> /usr/ccs/bin) is chosen to be used, but I want to use the GNU assembler
> (installed at /vm/GNU/bin in my machine). In spite of re-arranging paths on
> the PATH variable, and even after removing /usr/ccs/bin from PATH, configure
> still chooses the default assembler itself. Is there any other way I can
> tell configure to use the GNU assembler ?
>
> --with-as=pathname
>
> The assembler is chosen by the gcc that you compile clang with. In my case,
GCC is configured with

./configure --prefix=/opt/gcc44 --with-gnu-as --with-as=/usr/sfw/bin/gas
--without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-shared
--enable-languages=c,c++

And clang/llvm will be compiled with the as chosen here.

There is another catch when actually running llvm/clang. clang will try to
use the gcc that is installed in the same directory with clang and use that
as a hint to find the assembler. So if you install gcc3.4.6 in /usr/local
and then install the gcc4.4-compiled Clang in /usr/local, no matter how you
tweak $PATH, it will always pick /usr/local/bin/gcc instead of the other
gcc4.4. The solution is to install llvm/clang into another location where no
gcc can be found, than use $PATH to manipulate the order of discovery for
the gcc binary, llvm/clang will than pick up the correct assembler when
running.

My 2 cents,

CW


-- 
"If it looks like a duck, walks like a duck, and quacks like a duck, then to
the end user it's a duck, and end users have made it pretty clear they want
a duck; whether the duck drinks hot chocolate or coffee is irrelevant."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100928/4bd80a34/attachment.html>


More information about the llvm-dev mailing list