Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#21847 - [llvm] Fail to link against llvm libraries

Attached to Project: Community Packages
Opened by Wei (roy_hu) - Saturday, 27 November 2010, 09:11 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 28 November 2010, 01:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
I'm not familiar with LLVM at all, but failing to link such a simple program makes me believe that there's a bug in how LLVM was built.

Additional info:
* package version(s) llvm 2.8-1

Steps to reproduce:
Compile and link the attached program:
g++ `llvm-config --cxxflags --libs --ldflags` a.cc

Compiling succeeds but linking fails. The llvm::outs() function can be browsed at http://llvm.org/docs/doxygen/html/raw__ostream_8cpp_source.html
   a.cc (0.1 KiB)
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Sunday, 28 November 2010, 01:41 GMT
Reason for closing:  Not a bug
Comment by Evangelos Foutras (foutrelis) - Saturday, 27 November 2010, 14:58 GMT
Libraries must be listed at the end, after any source/object file that uses them. (This is not specific to LLVM.)

Either of the following should work:

1) g++ $(llvm-config --cxxflags --ldflags) a.cc $(llvm-config --libs)
2) g++ $(llvm-config --cflags --ldflags) a.cc -lLLVM-2.8

First command will statically link against LLVM, while the second one will link to the shared LLVM library.

Loading...