Hi, Apparently there are two bugs in tools/llvmc/c: /.../llvm/tools/llvmc/c:12: Error: Invalid top level configuration item /.../llvm/tools/llvmc/c:28: Error: Expecting a program name /.../llvm/tools/llvmc/c had 2 errors. Terminating. The first error relates to the following line(s): lang.libs=%llvmgccdir%/lib %llvmgccdir%/lib \ %llvmgccdir%/lib/gcc/%llvmgccarch% ... the other one to: translator.command=%llvmcc1% -quiet %in% -o %out% \ ... Apparently, %llvmgccdir% and %llvmcc1% are not recognized as a useful variable by the llvmc configuration parser. I found out in tools/ llvmc/Configuration.cpp that two other library-related variables exist, notably %libdir% and %libs%, but it's not clear what they do. Currently, I tried to solve the problems like this: lang.libs=%libdir% #this does not work: lang.libs=%libdir% %libs% ... and: translator.command=llvm-gcc -quiet %in% -o %out% \ ... Only the solution to the second problem really seems to work, the other one is accepted by llvmc, but I also get: /usr/bin/ld: Undefined symbols: _main collect2: ld returned 1 exit status llvmc: Action failed How can this library problem be solved? Kind regards, Bram Adams GH-SEL, INTEC, Ghent University (Belgium)
On Sun, 2006-08-13 at 21:18 +0200, Bram Adams wrote:> Hi, > > Apparently there are two bugs in tools/llvmc/c:This tool is, as yet, unfinished.> > /.../llvm/tools/llvmc/c:12: Error: Invalid top level configuration item > /.../llvm/tools/llvmc/c:28: Error: Expecting a program name > /.../llvm/tools/llvmc/c had 2 errors. Terminating. > > The first error relates to the following line(s): > > lang.libs=%llvmgccdir%/lib %llvmgccdir%/lib \ > %llvmgccdir%/lib/gcc/%llvmgccarch% > > ... the other one to: > > translator.command=%llvmcc1% -quiet %in% -o %out% \ > ... >Okay.> Apparently, %llvmgccdir% and %llvmcc1% are not recognized as a useful > variable by the llvmc configuration parser.Actually, they are. See tools/llvmc/ConfigurationDriver.cpp around line 304. Also, they are recognized by the lexer. Its more likely that when you configured LLVM you didn't provide the --with-llvmgccdir= option.> I found out in tools/ > llvmc/Configuration.cpp that two other library-related variables > exist, notably %libdir% and %libs%, but it's not clear what they do.%libdir% expands to LLVM_LIBDIR which is the installation location of LLVM libraries. %libs% expands to the list of system (non-LLVM) libraries needed to link with LLVM.> > Currently, I tried to solve the problems like this: > > lang.libs=%libdir% > #this does not work: lang.libs=%libdir% %libs%Did you install LLVM yet? If not, the directories are empty.> > ... and: > > translator.command=llvm-gcc -quiet %in% -o %out% \ > ... > > Only the solution to the second problem really seems to work, the > other one is accepted by llvmc, but I also get: > > /usr/bin/ld: Undefined symbols: > _main > collect2: ld returned 1 exit status > llvmc: Action failed > > How can this library problem be solved?Probably with "make install" from LLVM build directory and by configuring LLVM with --with-llvmgccdir=. Please note that llvmc is (still!) a work in progress. The configuration code, in particular, is due for some improvement. Please see PR686 (http://llvm.org/bugs/show_bug.cgi?id=686) for further details.> > Kind regards, > > Bram Adams > GH-SEL, INTEC, Ghent University (Belgium)Hope it helps, Reid
Hi, Op 14-aug-06, om 09:29 heeft Reid Spencer het volgende geschreven:> >> Apparently, %llvmgccdir% and %llvmcc1% are not recognized as a useful >> variable by the llvmc configuration parser. > > Actually, they are. See tools/llvmc/ConfigurationDriver.cpp around > line > 304. Also, they are recognized by the lexer. Its more likely that when > you configured LLVM you didn't provide the --with-llvmgccdir= option.They're indeed mentioned, but somehow they were not added to the switch-statements in the corresponding parsing functions for the various configuration options. I attached a patch in which this is resolved, as well as two other bugs: * an off-by-one error in a loop copying a command's arguments into an array (first argument was dismissed; garbage added at the end); * %...%'s in a command name were not substituted, whereas they were in the command's arguments. The patch solved things for me, but it's not perfect yet.> >> I found out in tools/ >> llvmc/Configuration.cpp that two other library-related variables >> exist, notably %libdir% and %libs%, but it's not clear what they do. > > %libdir% expands to LLVM_LIBDIR which is the installation location of > LLVM libraries. > %libs% expands to the list of system (non-LLVM) libraries needed to > link > with LLVM.OK. Kind regards, Bram Adams GH-SEL, INTEC, Ghent University (Belgium) PS: I recently saw an email passing by in which someone else was talking about a patch for llvmc. Has that one been committed yet? -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.llvmc-1.8 Type: application/octet-stream Size: 4483 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060816/9fe380ba/attachment.obj>
Seemingly Similar Threads
- [LLVMdev] Problem with stock llvmc configuration for C
- [LLVMdev] Problem with stock llvmc configuration for C
- [LLVMdev] Problem with stock llvmc configuration for C
- [LLVMdev] llvmc doesn't work for compilation nor linking
- [LLVMdev] llvmc doesn't work for compilation nor linking