Discussion:
[Cygwin-ports-general] llvm-config is broken, again
KIMURA Masaru
2013-12-05 08:11:42 UTC
Permalink
Hi,

i realized that my previous patch WRT llvm-config produces more
brokeness after installing, sorry. :(

here is reviced version. after this patch is applied,

* order of print for --libs is kept.
* no invalid error and usage print is performed.

is expected. and it will be nicer than ATM.

Peace,
KIMURA Masaru
2013-12-05 08:11:43 UTC
Permalink
This patch only workaound cygwin specific issue for --libs.
FYI, current upstream LLVM devs do not interest --enable-shared
llvm-config as NAKAMURA Takumi said.
http://llvm.org/bugs/show_bug.cgi?id=13430
https://twitter.com/chapuni/status/407790915382558720

Signed-off-by: KIMURA Masaru <***@gmail.com>
---
3.1-llvm-config.patch | 34 ++++++++++++++++++++++++----------
llvm.cygport | 2 +-
2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/3.1-llvm-config.patch b/3.1-llvm-config.patch
index e5cd2b7..330844f 100644
--- a/3.1-llvm-config.patch
+++ b/3.1-llvm-config.patch
@@ -1,11 +1,25 @@
---- origsrc/llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2012-05-15 17:06:08.000000000 -0500
-+++ src/llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2012-07-04 16:49:45.965537100 -0500
-@@ -279,7 +279,7 @@ int main(int argc, char **argv) {
- OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS
- << ' ' << LLVM_SYSTEM_LIBS << '\n';
- } else if (Arg == "--libs") {
-- PrintLibs = true;
+--- origsrc/llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2013-12-05 09:41:03.214992500 +0900
++++ src/llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2013-12-05 10:12:08.462285800 +0900
+@@ -335,6 +335,10 @@
+ } else if (PrintLibFiles) {
+ OS << ActiveLibDir << '/' << Lib;
+ } else if (PrintLibs) {
++ // FIXME: Do not print modular libs until llvm-config is really fixed.
+ OS << "-lLLVM-" << PACKAGE_VERSION << '\n';
- } else if (Arg == "--libnames") {
- PrintLibNames = true;
- } else if (Arg == "--libfiles") {
++ break;
++
+ // If this is a typical library name, include it using -l.
+ if (Lib.startswith("lib") && Lib.endswith(".a")) {
+ OS << "-l" << Lib.slice(3, Lib.size()-2);
+@@ -347,8 +351,9 @@
+ }
+ OS << '\n';
+ } else if (!Components.empty()) {
+- errs() << "llvm-config: error: components given, but unused\n\n";
+- usage();
++ // FIXME: Do nothing until llvm-config is really fixed.
++ // errs() << "llvm-config: error: components given, but unused\n\n";
++ // usage();
+ }
+
+ return 0;
diff --git a/llvm.cygport b/llvm.cygport
index 8fead96..22e0fcb 100644
--- a/llvm.cygport
+++ b/llvm.cygport
@@ -2,7 +2,7 @@ inherit ocaml python python3

NAME="llvm"
VERSION=3.1
-RELEASE=3
+RELEASE=4
CATEGORY="Interpreters Devel"
SUMMARY="LLVM bytecode interpreter and toolchain"
DESCRIPTION="The LLVM Core libraries provide a modern source- and target-
--
1.7.9
Yaakov (Cygwin/X)
2014-01-01 05:27:33 UTC
Permalink
Post by KIMURA Masaru
This patch only workaound cygwin specific issue for --libs.
FYI, current upstream LLVM devs do not interest --enable-shared
llvm-config as NAKAMURA Takumi said.
LLVM/Clang still needs to be updated to 3.3 and ported to x86_64, so
I'll look at this then. But I'm curious, why do you want to use the
static libs?


Yaakov
Cygwin Ports
KIMURA Masaru
2014-01-03 10:11:50 UTC
Permalink
Post by Yaakov (Cygwin/X)
Post by KIMURA Masaru
This patch only workaound cygwin specific issue for --libs.
FYI, current upstream LLVM devs do not interest --enable-shared
llvm-config as NAKAMURA Takumi said.
LLVM/Clang still needs to be updated to 3.3 and ported to x86_64, so
I'll look at this then. But I'm curious, why do you want to use the
static libs?
yes, im also interested version bumping to 3.3 and x86_64.
and no, im not paranoid about static library, w/ this fix llvm-config
--libs continues to work for use of shared library.

maybe, upstream devs have future plan for llvm-config, but i dunno its details.
NAKAMURA Takumi just answered old version of llvm-config is not
actively maintained, especially for --enable-shared. then i just
workaround.
KIMURA Masaru
2015-05-28 01:42:20 UTC
Permalink
ping.

3.5.2 still looks having broken llvm-config.
"llvm-config: error: components given, but unused" and following help
message should not print.

***@lynx ~
$ uname -a
CYGWIN_NT-6.1-WOW lynx 2.0.2(0.287/5/3) 2015-05-08 17:03 i686 Cygwin

***@lynx ~
$ llvm-config.exe --version
3.5.2

***@lynx ~
$ llvm-config.exe --libs all
-lLLVM-3.5.2
llvm-config: error: components given, but unused

usage: llvm-config <OPTION>... [<COMPONENT>...]

Get various configuration information needed to compile programs which use
LLVM. Typically called from 'configure' scripts. Examples:
llvm-config --cxxflags
llvm-config --ldflags
llvm-config --libs engine bcreader scalaropts

Options:
--version Print LLVM version.
--prefix Print the installation prefix.
--src-root Print the source root LLVM was built from.
--obj-root Print the object root used to build LLVM.
--bindir Directory containing LLVM executables.
--includedir Directory containing LLVM headers.
--libdir Directory containing LLVM libraries.
--cppflags C preprocessor flags for files that include LLVM headers.
--cflags C compiler flags for files that include LLVM headers.
--cxxflags C++ compiler flags for files that include LLVM headers.
--ldflags Print Linker flags.
--system-libs System Libraries needed to link against LLVM components.
--libs Libraries needed to link against LLVM components.
--libnames Bare library names for in-tree builds.
--libfiles Fully qualified library filenames for makefile depends.
--components List of all possible components.
--targets-built List of all targets currently built.
--host-target Target triple used to configure LLVM.
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
--assertion-mode Print assertion mode of LLVM tree (ON or OFF).
Typical components:
all All LLVM libraries (default).
engine Either a native JIT or a bitcode interpreter.

------------------------------------------------------------------------------
Loading...