Sync with the following bug fix:
commit a8a1f7d09cfc7e18874786c7634c9e71384fcd4e (HEAD -> bpf-next2, bpf-next/master)
Author: Stanislav Fomichev <sdf@google.com>
Date: Mon Feb 4 16:20:55 2019 -0800
libbpf: fix libbpf_print
With the recent print rework we now have the following problem:
pr_{warning,info,debug} expand to __pr which calls libbpf_print.
libbpf_print does va_start and calls __libbpf_pr with va_list argument.
In __base_pr we again do va_start. Because the next argument is a
va_list, we don't get correct pointer to the argument (and print noting
in my case, I don't know why it doesn't crash tbh).
......
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Otherwise, we will have the following compilation error:
/home/yhs/work/bcc-new/src/cc/libbpf/src/bpf_prog_linfo.c:
In function ‘dissect_jited_func’:
/home/yhs/work/bcc-new/src/cc/libbpf/src/bpf_prog_linfo.c:88:10:
error: ‘EINVAL’ undeclared (first use in this function)
return -EINVAL;
The original linux/err.h at linux:tools/include directory
does include "asm/errno.h" as well.
Signed-off-by: Yonghong Song <yhs@fb.com>
Builds on debian stretch are failing due to:
../scripts/check-reallocarray.sh: 17: ../scripts/check-reallocarray.sh: Syntax error: Bad fd number
Fix the redirect of stdout and stderr.
Signed-off-by: David Ahern <dsahern@gmail.com>
sync with latest bpf-next tree.
the include/linux/filter.h is created as libbpf.c tries
to use various insn define macros.
Signed-off-by: Yonghong Song <yhs@fb.com>
* Sync from bpf-next
Sync the following commits from bpf-next:
commit ab9e08482122 ("libbpf: Per-symbol visibility for DSO")
commit c034a177d3c8 ("bpf: bpftool, add flag to allow non-compat map definitions")
Signed-off-by: Andrey Ignatov <rdna@fb.com>
* Use -fvisibility=hidden by default for DSO
This is Makefile part of:
commit ab9e08482122 ("libbpf: Per-symbol visibility for DSO")
See original commit for details.
Introduce multiple improvements to Makefile to make the build more
flexible and support install:
* Support overriding CFLAGS by user but keep required flags in place.
ALL_FLAGS is used in Makefile as recommended in [1].
* Add additional BUILD_SHARED flag to build dynamically linked flavor of
the library. If the flag is set, -fPIC is also passed to make it
possible to build .so.
* Support building in a separate directory provided by OBJDIR variable.
* Add multiple install targets. By default the library itself and libbpf
headers are installed (install target). UAPI headers can be optionally
installed by user.
* All installation paths, including PREFIX, library and include
directories can be overridden. UAPI can be made different from include
directory for libbpf headers. That makes it possible to keep latest
<linux/bpf.h> in a place that doesn't conflict with the one installed
e.g. by kernel-headers package and use it in user's build system.
* Support DESTDIR (see [2]).
* Support overriding LDFLAGS.
* Use utilities such as rm directly as recommended in [3].
* Use compiler and related programs (such as ar) via make variables as
recommended in [3].
* In clean rule remove all possible build artifacts not to rely on passed
options (e.g. if build was done w/ BUILD_SHARED, but clean w/o it).
* Document new build options in README.
[1] https://www.gnu.org/software/make/manual/html_node/Command-Variables.html#Command-Variables
[2] https://www.gnu.org/prep/standards/html_node/DESTDIR.html
[3] https://www.gnu.org/software/make/manual/html_node/Utilities-in-Makefiles.html#Utilities-in-Makefiles
Signed-off-by: Andrey Ignatov <rdna@fb.com>
This initial commit added the following files
from bpf-next repository:
src:
<files from linux:tools/lib/bpf>
bpf.c bpf.h btf.c btf.h libbpf.c libbpf.h
libbpf_errno.c netlink.c nlattr.c nlattr.h
str_error.c str_error.h
include:
<files from linux:tools/include/uapi/linux>
uapi/linux/{bpf.h, btf.h}
<files from linux:tools/include/tools>
tools/libc_compat.h
The following files are also added:
include/linux/{err.h, kernel.h, list.h, overflow.h, types.h}
These files are customized headers to satisfy compilation.
Their original counterparts are at linux:tools/include/linux
directory.
Signed-off-by: Yonghong Song <yhs@fb.com>