Re: [PATCH bpf-next] bpftool: fix linkage with statically built libllvm

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

 



On 22/12/21 11:33, sdf@xxxxxxxxxx wrote:
> On 12/21, Anton Protopopov wrote:
> >   [...]
> 
> > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > index 787b857d3fb5..e4c15095eac7 100644
> > --- a/tools/bpf/bpftool/Makefile
> > +++ b/tools/bpf/bpftool/Makefile
> > @@ -144,7 +144,7 @@ ifeq ($(feature-llvm),1)
> >     CFLAGS  += -DHAVE_LLVM_SUPPORT
> >     LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets
> >     CFLAGS  += $(shell $(LLVM_CONFIG) --cflags --libs
> > $(LLVM_CONFIG_LIB_COMPONENTS))
> > -  LIBS    += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
> > +  LIBS    += $(shell $(LLVM_CONFIG) --libs --system-libs
> > $(LLVM_CONFIG_LIB_COMPONENTS)) -lstdc++
> 
> 
> Why not do separate lines? We can then maybe do a bit safer approach?
> 
> LIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
> ifeq ($(USE_STATIC_COMPONENTS), static)
> LIBS += $(shell $(LLVM_CONFIG) --system-libs))
> LIBS += -lstdc++
> endif
> 
> Can we use `llvm-config --shared-mode` to get USE_STATIC_COMPONENTS?

Thanks, I didn't know about the --shared-mode thing. I will send the v2.

> 
> >     LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags)
> >   else
> >     # Fall back on libbfd
> > --
> > 2.34.1
> 



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux