All of lore.kernel.org
 help / color / mirror / Atom feed
* How to detect libbfd when building tools/bpf?
@ 2018-04-22  7:51 Wang Sheng-Hui
  2018-04-23 10:05 ` Daniel Borkmann
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Sheng-Hui @ 2018-04-22  7:51 UTC (permalink / raw)
  To: ast, daniel, kstewart, gregkh, tglx, pombredanne; +Cc: netdev

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@lazyfintech:~# 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@lazyfintech:~# gcc t.c -lbfd
root@lazyfintech:~# ./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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-25 12:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-22  7:51 How to detect libbfd when building tools/bpf? Wang Sheng-Hui
2018-04-23 10:05 ` Daniel Borkmann
     [not found]   ` <5ade9631.046f370a.24af5.a921SMTPIN_ADDED_BROKEN@mx.google.com>
2018-04-25 12:01     ` Quentin Monnet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.