Hi:
I have just started to use llvm and confronted with a problem:
when I want to transform something very simple for name.ll to name.bc with
llvm-as name.ll, some errors occured:
error: parse error, expecting `GLOBAL' or `CONSTANT' while reading
token: 'target'
btw, the name.ll file is as follows:
; ModuleID = 'tst.bc'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
@.str = internal constant [13 x i8] c"hello world.\00" ; <[13 x
i8]*> [#uses=1]
define i32 @main() nounwind {
entry:
%tmp2 = tail call i32 @puts( i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0)
) nounwind ; <i32> [#uses=0]
ret i32 0
}
declare i32 @puts(i8*)
Thank you for your help.
2008-04-14
code_nf
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20080414/68f107fc/attachment.html>
On Apr 14, 2008, at 4:35 PM, code_nf wrote:> Hi: > I have just started to use llvm and confronted with a problem: > when I want to transform something very simple for name.ll to > name.bc with llvm-as name.ll, some errors occured: > > error: parse error, expecting `GLOBAL' or `CONSTANT' while reading > token: 'target'Hi. I am having exactly the same problem. Currently I suspect that the reason lies within my Bison version, that is 2.3, and maybe within my Flex version, that is 2.5.34. These are the current Bison/ Flex versions from the Ubuntu hardy universe. The rationale to my suspicion derives from the following messages that emerge during compilation of llvm 2.2 (gcc 4.2.3): llvm[2]: Compiling llvmAsmParser.cpp for Release build /usr/share/bison.simple: In function ‘int llvmAsmparse()’: /usr/share/bison.simple:614: warning: comparison between signed and unsigned integer expressions /usr/share/bison.simple:626: warning: comparison between signed and unsigned integer expressions llvm[2]: Flexing UpgradeLexer.l /usr/local/src/llvm-2.2/tools/llvm-upgrade/UpgradeLexer.l:405: warning, rule cannot be matched llvm[2]: Bisoning UpgradeParser.y /usr/local/src/llvm-2.2/tools/llvm-upgrade/UpgradeParser.y: conflicts: 8 shift/reduce, 7 reduce/reduce I'm going to install older versions (those "officially" supported) of the tools and try again. -- Arto Vuori avuori at cs.helsinki.fi
On Apr 14, 2008, at 9:16 PM, Arto Vuori wrote:> On Apr 14, 2008, at 4:35 PM, code_nf wrote: >> Hi: >> I have just started to use llvm and confronted with a problem: >> when I want to transform something very simple for name.ll to >> name.bc with llvm-as name.ll, some errors occured: >> >> error: parse error, expecting `GLOBAL' or `CONSTANT' while reading >> token: 'target' > > Hi. I am having exactly the same problem. Currently I suspect that > the reason lies within my Bison version, that is 2.3, and maybe > within my Flex version, that is 2.5.34. These are the current Bison/ > Flex versions from the Ubuntu hardy universe.I can confirm this problem went away when I downgraded Bison to 2.1. Using Bison 2.3 results in an invalid build of llvm 2.2. -- Arto Vuori avuori at cs.helsinki.fi