Re: [PATCH] Link binaries with system libraries needed by LLVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> 
> 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


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux