[LLVMdev] llvm compiler

Óscar Fuentes ofv at wanadoo.es
Wed Jan 30 06:36:22 PST 2013


Manoj C <manoj.chinthala at gmail.com> writes:

>   i compiled simple c program for printing hello world using clang front
> end it generates  .s file successfully but while generating bit code it is
> showing error as
>
>
> llvm-as: test.s:5:17: error: expected 'global' or 'constant'
> @.str = private unnamed_addr constant [12 x i8] c"hello world\00"
>
> how to fix this error?
>
> the .s file is  in assembly language(not understandable) to rectify the
> error.please help me to rectify it.

That seems to indicate that llvm-as is not compatible with the LLVM
assembly generated by Clang, probably because llvm-as is more modern
than clang or vice-versa.

Check that Clang and LLVM are built from the source code that
corresponds to roughly the same date and time.

Failing that, show the exact commands you use for executing clang and
llvm-as, along with the output of `clang --version' and `llvm-as
--version'.




More information about the llvm-dev mailing list