* [PATCH] Link binaries with system libraries needed by LLVM
@ 2014-10-02 14:19 Anatol Pomozov
2014-10-02 19:53 ` Josh Triplett
0 siblings, 1 reply; 5+ messages in thread
From: Anatol Pomozov @ 2014-10-02 14:19 UTC (permalink / raw)
To: linux-sparse; +Cc: dan.carpenter, sparse, Anatol Pomozov
It is needed on Linux Arch with latest LLVM installed
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 28c4df6..25087d7 100644
--- a/Makefile
+++ b/Makefile
@@ -112,11 +112,12 @@ LLVM_PROGS := sparse-llvm
$(LLVM_PROGS): LD := g++
LLVM_LDFLAGS := $(shell llvm-config --ldflags)
LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
+LLVM_SYSTEM_LIBS := $(shell llvm-config --system-libs)
LLVM_LIBS := $(shell llvm-config --libs)
PROGRAMS += $(LLVM_PROGS)
INST_PROGRAMS += sparse-llvm sparsec
sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
-sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)
+sparse-llvm_EXTRA_OBJS := $(LLVM_SYSTEM_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
endif
endif
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Link binaries with system libraries needed by LLVM
2014-10-02 14:19 [PATCH] Link binaries with system libraries needed by LLVM Anatol Pomozov
@ 2014-10-02 19:53 ` Josh Triplett
2014-10-02 20:05 ` Anatol Pomozov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Josh Triplett @ 2014-10-02 19:53 UTC (permalink / raw)
To: Anatol Pomozov; +Cc: linux-sparse, dan.carpenter, sparse
On Thu, Oct 02, 2014 at 07:19:48AM -0700, Anatol Pomozov wrote:
> It is needed on Linux Arch with latest LLVM installed
>
> Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
One comment below.
> Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 28c4df6..25087d7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -112,11 +112,12 @@ LLVM_PROGS := sparse-llvm
> $(LLVM_PROGS): LD := g++
> LLVM_LDFLAGS := $(shell llvm-config --ldflags)
> LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
> +LLVM_SYSTEM_LIBS := $(shell llvm-config --system-libs)
> LLVM_LIBS := $(shell llvm-config --libs)
> PROGRAMS += $(LLVM_PROGS)
> INST_PROGRAMS += sparse-llvm sparsec
> sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
> -sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)
> +sparse-llvm_EXTRA_OBJS := $(LLVM_SYSTEM_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
Does llvm-config support passing multiple options, such as "llvm-config
--libs --system-libs"? If so, I'd suggest just adding --system-libs to
the call in LLVM_LIBS, rather than adding a second variable.
(It's obnoxious that llvm requires its own configuration tool rather
than using pkg-config.)
- Josh Triplett
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Link binaries with system libraries needed by LLVM
2014-10-02 19:53 ` Josh Triplett
@ 2014-10-02 20:05 ` Anatol Pomozov
2014-10-02 20:09 ` Anatol Pomozov
2014-10-02 20:11 ` Ramsay Jones
2 siblings, 0 replies; 5+ messages in thread
From: Anatol Pomozov @ 2014-10-02 20:05 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-sparse, Dan Carpenter, sparse
Hi
On Thu, Oct 2, 2014 at 12:53 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Thu, Oct 02, 2014 at 07:19:48AM -0700, Anatol Pomozov wrote:
>> It is needed on Linux Arch with latest LLVM installed
>>
>> Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
>
> One comment below.
>
>> Makefile | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 28c4df6..25087d7 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -112,11 +112,12 @@ LLVM_PROGS := sparse-llvm
>> $(LLVM_PROGS): LD := g++
>> LLVM_LDFLAGS := $(shell llvm-config --ldflags)
>> LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
>> +LLVM_SYSTEM_LIBS := $(shell llvm-config --system-libs)
>> LLVM_LIBS := $(shell llvm-config --libs)
>> PROGRAMS += $(LLVM_PROGS)
>> INST_PROGRAMS += sparse-llvm sparsec
>> sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
>> -sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)
>> +sparse-llvm_EXTRA_OBJS := $(LLVM_SYSTEM_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
>
> Does llvm-config support passing multiple options, such as "llvm-config
> --libs --system-libs"? If so, I'd suggest just adding --system-libs to
> the call in LLVM_LIBS, rather than adding a second variable.
Thanks. Yeap it is better. Will send update in a second.
>
> (It's obnoxious that llvm requires its own configuration tool rather
> than using pkg-config.)
>
> - Josh Triplett
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Link binaries with system libraries needed by LLVM
2014-10-02 19:53 ` Josh Triplett
2014-10-02 20:05 ` Anatol Pomozov
@ 2014-10-02 20:09 ` Anatol Pomozov
2014-10-02 20:11 ` Ramsay Jones
2 siblings, 0 replies; 5+ messages in thread
From: Anatol Pomozov @ 2014-10-02 20:09 UTC (permalink / raw)
To: josh, linux-sparse, dan.carpenter, sparse; +Cc: Anatol Pomozov
It is needed on Linux Arch with latest LLVM installed
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 28c4df6..c0ffd04 100644
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@ LLVM_PROGS := sparse-llvm
$(LLVM_PROGS): LD := g++
LLVM_LDFLAGS := $(shell llvm-config --ldflags)
LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
-LLVM_LIBS := $(shell llvm-config --libs)
+LLVM_LIBS := $(shell llvm-config --libs --system-libs)
PROGRAMS += $(LLVM_PROGS)
INST_PROGRAMS += sparse-llvm sparsec
sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Link binaries with system libraries needed by LLVM
2014-10-02 19:53 ` Josh Triplett
2014-10-02 20:05 ` Anatol Pomozov
2014-10-02 20:09 ` Anatol Pomozov
@ 2014-10-02 20:11 ` Ramsay Jones
2 siblings, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2014-10-02 20:11 UTC (permalink / raw)
To: Josh Triplett, Anatol Pomozov; +Cc: linux-sparse, dan.carpenter, sparse
On 02/10/14 20:53, Josh Triplett wrote:
> On Thu, Oct 02, 2014 at 07:19:48AM -0700, Anatol Pomozov wrote:
>> It is needed on Linux Arch with latest LLVM installed
>>
>> Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
>
> One comment below.
>
>> Makefile | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 28c4df6..25087d7 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -112,11 +112,12 @@ LLVM_PROGS := sparse-llvm
>> $(LLVM_PROGS): LD := g++
>> LLVM_LDFLAGS := $(shell llvm-config --ldflags)
>> LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
>> +LLVM_SYSTEM_LIBS := $(shell llvm-config --system-libs)
>> LLVM_LIBS := $(shell llvm-config --libs)
>> PROGRAMS += $(LLVM_PROGS)
>> INST_PROGRAMS += sparse-llvm sparsec
>> sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
>> -sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)
>> +sparse-llvm_EXTRA_OBJS := $(LLVM_SYSTEM_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
>
This issue is addressed in commit d92353b4eacbac54d693edd62fb565f071e3ba86
("sparse-llvm: Fix LLVM 3.5 linker errors", 24-09-2014) in the main sparse
repo and in a follow-up commit a5bdeee9e145cc4313526f9722f80674321ab491
("Use LLVM_CONFIG instead of llvm-config in Makefile", 24-09-2014) in
Christopher's public repo on kernel.org.
Neither commit is in a released version of sparse.
> Does llvm-config support passing multiple options, such as "llvm-config
> --libs --system-libs"? If so, I'd suggest just adding --system-libs to
> the call in LLVM_LIBS, rather than adding a second variable.
An old version of llvm-config (prior to adding --system-libs) would
respond like so:
$ llvm-config --libs --system-libs
-lLLVM-3.4.2
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.
...
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
Typical components:
all All LLVM libraries (default).
engine Either a native JIT or a bitcode interpreter.
$ echo $?
1
$
HTH
ATB,
Ramsay Jones
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-02 20:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 14:19 [PATCH] Link binaries with system libraries needed by LLVM Anatol Pomozov
2014-10-02 19:53 ` Josh Triplett
2014-10-02 20:05 ` Anatol Pomozov
2014-10-02 20:09 ` Anatol Pomozov
2014-10-02 20:11 ` Ramsay Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox