[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3d29dfa6-0aa6-5a9d-6997-88b76c4938bf@iogearbox.net>
Date: Mon, 23 Apr 2018 12:05:33 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Wang Sheng-Hui <shhuiw@...mail.com>, ast <ast@...nel.org>,
kstewart <kstewart@...uxfoundation.org>,
gregkh <gregkh@...uxfoundation.org>, tglx <tglx@...utronix.de>,
pombredanne <pombredanne@...b.com>
Cc: netdev <netdev@...r.kernel.org>, acme@...hat.com,
jakub.kicinski@...ronome.com, quentin.monnet@...ronome.com
Subject: Re: How to detect libbfd when building tools/bpf?
On 04/22/2018 09:51 AM, Wang Sheng-Hui wrote:
> Sorry to trouble you !
>
> I run debian and installed binutils-dev beforehand.
> Then I copied tools/build/feature/test-libbfd.c to t.c and run:
> ------------------------------------------------------------------------
> root@...yfintech:~# cat t.c
> #include <bfd.h>
>
> extern int printf(const char *format, ...);
>
> int main(void)
> {
> char symbol[4096] = "FieldName__9ClassNameFd";
> char *tmp;
>
> tmp = bfd_demangle(0, symbol, 0);
>
> printf("demangled symbol: {%s}\n", tmp);
>
> return 0;
> }
> root@...yfintech:~# gcc t.c -lbfd
Can you run with 'gcc t.c -lbfd -lz -liberty -ldl' since this is
what the Makefile for the feature test is doing:
$(OUTPUT)test-libbfd.bin:
$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
Seems most likely that you're missing some of the remaining libs
to have the feature test properly detect it?
> root@...yfintech:~# ./a.out
> demangled symbol: {ClassName::FieldName}
>
>
> I thought libbfd can be reached from above.
> But when I built tools/bpf, libbfd cannot be detected:
> -------------------------------------------------------------------------
> /linux# make O=../buildkernel/ tools/bpf
> make[1]: Entering directory '/root/buildkernel'
> DESCEND bpf
>
> Auto-detecting system features:
> ... libbfd: [ OFF ]
> ... disassembler-four-args: [ on ]
>
> DESCEND bpftool
>
> Auto-detecting system features:
> ... libbfd: [ OFF ]
> ... disassembler-four-args: [ on ]
>
> make[1]: Leaving directory '/root/buildkernel'
>
>
> I wonder how should I do to get libbfd auto detected when building bpf tool?
>
> Regards,
> shenghui
Powered by blists - more mailing lists