hello sir, 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130130/e946112e/attachment.html>
Hi, it sounds like you are using llvm-as from an older version of LLVM. Use the same version as you are using for clang. Ciao, Duncan. On 30/01/13 14:09, Manoj C wrote:> hello sir, > 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. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
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'.