/tc_l2_redirect_kern.o
:1:2: error: invalid register/token name
rev16 r3, r0
This decision is arguable, probably there is another way, but
it doesn't have impact on samples/bpf, so it's easier just ignore
it for clang, at least for now.
Signed-off-by: Ivan Khoronzhuk
---
arch/arm/include/asm/swab.h | 3 +++
1
It can overlap with CFLAGS used for libraries built with gcc if
not now then in following patches. Correct it here for simplicity.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/samples/bpf/Makefile b/samples
eded for samples/bpf, potentially
can be reused and sophisticated for other prog sets later and now
needed only for unblocking tricky samples/bpf cross compilation.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile.prog | 77 +++
1 file changed, 77 insertions(+)
For cross compiling the target triple can be inherited from
cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
So copy-paste this decision from kernel Makefile.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git
verified it on clang 5, 6 ,7, 8, 9, 10
as on native platform as for cross-compiling. This decision is
arguable, but it doesn't have impact on samples/bpf so it's easier
just ignore it for clang, at least for now...
Signed-off-by: Ivan Khoronzhuk
---
arch/arm/include/asm/unified.h | 6 +-
1
In case of LDFLAGS and EXTRA_CC flags there is no way to pass them
correctly to build command, for instance when --sysroot is used or
external libraries are used, like -lelf. In follow patches this is
used for samples/bpf cross-compiling.
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf
The kernel headers are reused from samples bpf, and autoconf.h is not
enough to reflect complete configuration for clang. One of such
configurations is __LINUX_ARM_ARCH__ min version used as instruction
set selector. In another case an error like "SMP is not
supported" for arm and others errors
On Wed, Sep 11, 2019 at 02:02:11PM +0300, Sergei Shtylyov wrote:
On 10.09.2019 17:54, Ivan Khoronzhuk wrote:
Hello!
On 10.09.2019 13:38, Ivan Khoronzhuk wrote:
echo should be replaced on echo -e to handle \n correctly, but instead,
s/on/with/?
s/echo/printf/ instead of s/echo/echo -e
On Fri, Sep 13, 2019 at 09:12:01PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
The kernel headers are reused from samples bpf, and autoconf.h is not
enough to reflect complete arch configuration for clang. But CLANG-bpf
cmds are sensitive for assembler part taken
On Fri, Sep 13, 2019 at 08:48:37PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
Don't list userspace "cookie_uid_helper_example" object in list for
bpf objects.
per_socket_stats_example-opjs is used to list additional dependencies
s/opjs/objs
for
On Fri, Sep 13, 2019 at 09:33:58PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
The makefile.prog is added only, will be used in sample/bpf/Makefile
later in order to switch cross-compiling on CC from HOSTCC.
The HOSTCC is supposed to build binaries and tools
On Fri, Sep 13, 2019 at 09:41:25PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
The main reason for that - HOSTCC and CC have different aims.
It was tested for arm cross compilation, based on linaro toolchain,
but should work for others.
In order to split cross
On Fri, Sep 13, 2019 at 09:43:22PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
In case of LDFLAGS and EXTRA_CC/CXX flags there is no way to pass them
correctly to build command, for instance when --sysroot is used or
external libraries are used, like -lelf, wich
On Fri, Sep 13, 2019 at 09:45:31PM +, Yonghong Song wrote:
On 9/10/19 11:38 AM, Ivan Khoronzhuk wrote:
Basically it only enables that was added by previous couple fixes.
For sure, just make tools/include to be included after sysroot
headers.
export ARCH=arm
export CROSS_COMPILE=arm-linux
ve `always += cookie_uid_helper_example.o`, which avoids
breaking cross compilation due to mismatched includes.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index f50ca852c2a8..43dee90df
echo should be replaced with echo -e to handle '\n' correctly, but
instead, replace it with printf as some systems can't handle echo -e.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf
compilation (CC) with host build (HOSTCC),
lets base samples on Makefile.target. It allows to cross-compile
samples/bpf programs with CC while auxialry tools running on host
built with HOSTCC.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 135 ++-
1
No need in hacking HOSTCC to be cross-compiler any more, so drop
this trick and use target CC for HDR_PROBE.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index
pf cross compilation.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile.target | 75 +
1 file changed, 75 insertions(+)
create mode 100644 samples/bpf/Makefile.target
diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target
new fi
.
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf/Makefile | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index c6f94cffe06e..bccfa556ef4e 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -94,6
clean
configure and install headers:
make ARCH=arm defconfig
make ARCH=arm headers_install
build samples/bpf:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \
SYSROOT="path/to/sysroot"
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 +
1 fi
Add couple preparation steps: clean and configuration. Also add newly
added sysroot support info to cross-compile section.
---
samples/bpf/README.rst | 41 -
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/samples/bpf/README.rst
For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction
set selector and is absolutely required while parsing some parts of
headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's
retrieve it from and add to programs cflags. In another case errors
like "SMP is not
In order to build libs using C/CXX/LD flags of target arch,
provide them to libbpf make.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 18ec22e7b444
potential
option mistmatches for existent environments.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 9 +
1 file changed, 9 insertions(+)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 1579cc16a1c2..b5c87a8b8b51 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf
It can overlap with CFLAGS used for libraries built with gcc if
not now then in next patches. Correct it here for simplicity.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is
included for all objects anyway, with above line:
KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf
For cross compiling the target triple can be inherited from
cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
So copy-paste this decision from kernel Makefile.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion
uild"
- added fix:
"samples: bpf: makefile: fix cookie_uid_helper_example obj build"
- limited -D option filter only for arm
- improved comments
- added couple instructions to verify cross compilation for arm and
arm64 arches based on TI am57xx and am65xx sdks.
- corrected i
.
Signed-off-by: Ivan Khoronzhuk
---
tools/testing/selftests/bpf/cgroup_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/cgroup_helpers.c
b/tools/testing/selftests/bpf/cgroup_helpers.c
index e95c33e333a4..4d74f3c4619b 100644
--- a/tools
This micro series fixes annoying warn described in patches
while samples/bpf build. Second patch fixes new warn that
comes after fixing warn of first patch, that was masked.
Ivan Khoronzhuk (2):
selftests/bpf: add static to enable_all_controllers()
selftests/bpf: correct path to include msg
th);
"
In order to avoid warns, lets decrease buf size for cgroup workdir on
24 bytes with assumption to include also "/cgroup.subtree_control" to
the address. The cut will never happen anyway.
Signed-off-by: Ivan Khoronzhuk
---
tools/testing/selftests/bpf/cgroup_helpers.c | 2
][opts][,end[.offset][opts]] [-t CHAR] [FILE]...
Lets modify command a little to avoid -V option.
Fixes: dadb81d0afe732 ("libbpf: make libbpf.map source of truth for libbpf
version")
Signed-off-by: Ivan Khoronzhuk
---
Based on bpf/master
tools/lib/bpf/Makefile | 2 +-
1 file changed, 1
On Thu, Sep 19, 2019 at 07:05:18PM +0300, Ivan Khoronzhuk wrote:
It's very often for embedded to have stripped version of sort in
busybox, when no -V option present. It breaks build natively on target
board causing recursive loop.
BusyBox v1.24.1 (2019-04-06 04:09:16 UTC) multi-call binary
On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote:
On Thu, Sep 19, 2019 at 11:22 AM Ivan Khoronzhuk
wrote:
It's very often for embedded to have stripped version of sort in
busybox, when no -V option present. It breaks build natively on target
board causing recursive loop
On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote:
On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk
wrote:
On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote:
>On Thu, Sep 19, 2019 at 11:22 AM Ivan Khoronzhuk
> wrote:
>>
>> It's very often fo
On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote:
On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote:
On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk
wrote:
On Thu, Sep 19, 2019 at 01:02:40PM -0700, Andrii Nakryiko wrote:
On Thu, Sep 19, 2019 at 11:22 AM Ivan
On Fri, Sep 20, 2019 at 10:19:43PM +0300, Ivan Khoronzhuk wrote:
On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote:
On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote:
On Fri, Sep 20, 2019 at 1:22 AM Ivan Khoronzhuk
wrote:
On Thu, Sep 19, 2019 at 01:02:40PM -0700
On Fri, Sep 20, 2019 at 02:51:14PM -0700, Andrii Nakryiko wrote:
On Fri, Sep 20, 2019 at 12:19 PM Ivan Khoronzhuk
wrote:
On Fri, Sep 20, 2019 at 09:34:51PM +0300, Ivan Khoronzhuk wrote:
>On Fri, Sep 20, 2019 at 09:41:54AM -0700, Andrii Nakryiko wrote:
>>On Fri, Sep 20, 2019 at 1:2
On Tue, Aug 13, 2019 at 10:02:54AM +0200, Magnus Karlsson wrote:
On Mon, Aug 12, 2019 at 2:45 PM Ivan Khoronzhuk
wrote:
The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING
and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are
established already
For arm32 xdp sockets mmap2 is preferred, so use it if it's defined.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/syscall_nrs.c | 5 +
samples/bpf/tracex5_kern.c | 11 +++
2 files changed, 16 insertions(+)
diff --git a/samples/bpf/syscall_nrs.c b/samples/bpf/syscall_nrs.c
index
block and should be used rather
for dynamic mm.
Signed-off-by: Ivan Khoronzhuk
---
net/xdp/xdp_umem.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index a0607969f8c0..907c9019fe21 100644
--- a/net/xdp/xdp_umem.c
+++ b
uot;
https://lkml.org/lkml/2019/8/12/549
Based on bpf-next/master
Ivan Khoronzhuk (3):
libbpf: add asm/unistd.h to xsk to get __NR_mmap2
xdp: xdp_umem: replace kmap on vmap for umem map
samples: bpf: syscal_nrs: use mmap2 if defined
net/xdp/xdp_umem.c | 16
s
That's needed to get __NR_mmap2 when mmap2 syscall is used.
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf/xsk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
index 5007b5d4fd2c..f2fc40f9804c 100644
--- a/tools/lib/bpf/xsk.c
+++ b/tools/lib/bpf
On Tue, Aug 13, 2019 at 10:42:18AM -0700, Jonathan Lemon wrote:
On 13 Aug 2019, at 3:23, Ivan Khoronzhuk wrote:
For 64-bit there is no reason to use vmap/vunmap, so use page_address
as it was initially. For 32 bits, in some apps, like in samples
xdpsock_user.c when number of pgs in use
On Tue, Aug 13, 2019 at 10:41:54AM -0700, Jonathan Lemon wrote:
On 13 Aug 2019, at 3:23, Ivan Khoronzhuk wrote:
For arm32 xdp sockets mmap2 is preferred, so use it if it's defined.
Signed-off-by: Ivan Khoronzhuk
Doesn't this change the application API?
--
Jonathan
From what I know
On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote:
Hi, Andrii
On Tue, Aug 13, 2019 at 3:24 AM Ivan Khoronzhuk
wrote:
That's needed to get __NR_mmap2 when mmap2 syscall is used.
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf/xsk.c | 1 +
1 file changed, 1 insertion
On Wed, Aug 14, 2019 at 12:32:41AM +, Yonghong Song wrote:
Hi, Yonghong Song
On 8/13/19 3:23 AM, Ivan Khoronzhuk wrote:
That's needed to get __NR_mmap2 when mmap2 syscall is used.
It seems I did not have this issue on x64 machine e.g., Fedora 29.
My glibc version is 2.28. gcc 8.2.1
On Wed, Aug 14, 2019 at 12:24:05PM +0300, Ivan Khoronzhuk wrote:
On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote:
Hi, Andrii
On Tue, Aug 13, 2019 at 3:24 AM Ivan Khoronzhuk
wrote:
That's needed to get __NR_mmap2 when mmap2 syscall is used.
Signed-off-by: Ivan Khoronzhuk
On Mon, Aug 12, 2019 at 02:19:24PM -0700, Andrew Morton wrote:
Hi, Andrew
On Mon, 12 Aug 2019 15:43:26 +0300 Ivan Khoronzhuk
wrote:
The AF_XDP sockets umem mapping interface uses XDP_UMEM_PGOFF_FILL_RING
and XDP_UMEM_PGOFF_COMPLETION_RING offsets. The offsets seems like are
established
On Wed, Aug 14, 2019 at 03:32:24PM +0200, Björn Töpel wrote:
On Wed, 14 Aug 2019 at 13:57, Ivan Khoronzhuk
wrote:
On Wed, Aug 14, 2019 at 12:24:05PM +0300, Ivan Khoronzhuk wrote:
>On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote:
>
>Hi, Andrii
>
>>On Tue, Au
maximum allowed file size verification.
The offsets can be tuned ofc, but instead of changing existent
interface - extend max allowed file size for sockets. The 64-bit
systems seems like ok with this, so extend threshold only for
32-bits for now.
Signed-off-by: Ivan Khoronzhuk
---
Based on bpf-next
maximum allowed file size verification.
The offsets can be tuned ofc, but instead of changing existent
interface - extend max allowed file size for sockets.
Signed-off-by: Ivan Khoronzhuk
---
Based on bpf-next/master
v2..v1:
removed not necessarily #ifdev as ULL and UL for 64 has same size
ited -D option filter only for arm
- improved comments
- added couple instructions to verify cross compilation for arm and
arm64 arches based on TI am57xx and am65xx sdks.
- corrected include a little order
Ivan Khoronzhuk (15):
samples/bpf: fix HDR_PROBE "echo"
samples/bpf: fi
It can overlap with CFLAGS used for libraries built with gcc if
not now then in next patches. Correct it here for simplicity.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/samples
For cross compiling the target triple can be inherited from
cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
So copy-paste this decision from kernel Makefile.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1
-Wmissing-prototypes
-Wstrict-prototypes
So, add them as they were verified and used before adding
Makefile.target and lets omit "-fomit-frame-pointer" as were
proposed while review, as no sense in such optimization for samples.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 6
No need in hacking HOSTCC to be cross-compiler any more, so drop
this trick and use target CC for HDR_PROBE.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/samples/bpf/Makefile b/samples
clean
configure and install headers:
make ARCH=arm defconfig
make ARCH=arm headers_install
build samples/bpf:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \
SYSROOT="path/to/sysroot"
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 +++
In case of C/LDFLAGS there is no way to pass them correctly to build
command, for instance when --sysroot is used or external libraries
are used, like -lelf, wich can be absent in toolchain. This can be
used for samples/bpf cross-compiling allowing to get elf lib from
sysroot.
Signed-off-by: Ivan
In order to build lib using C/LD flags of target arch, provide them
to libbpf make.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index a6c33496e8ca..6b161326ac67 100644
Add couple preparation steps: clean and configuration. Also add newly
added sysroot support info to cross-compile section.
---
samples/bpf/README.rst | 41 -
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/samples/bpf/README.rst
lso remove spaces at
start of the lines to keep same style and avoid warns while apply.
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf/Makefile | 18 +-
.../lib/bpf/{test_libbpf.cpp => test_libbpf.c} | 14 --
2 files changed, 13 insertions(+),
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is
included for all objects anyway, with above line:
KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion
pf cross compilation.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile.target | 75 +
1 file changed, 75 insertions(+)
create mode 100644 samples/bpf/Makefile.target
diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target
new fi
compilation (CC) with host build (HOSTCC),
lets base samples on Makefile.target. It allows to cross-compile
samples/bpf programs with CC while auxialry tools running on host
built with HOSTCC.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 135 ++-
1
For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction
set selector and is absolutely required while parsing some parts of
headers. It's present in KBUILD_CFLAGS but not in autoconf.h, so let's
retrieve it from and add to programs cflags. In another case errors
like "SMP is not
ve `always += cookie_uid_helper_example.o`, which avoids
breaking cross compilation due to mismatched includes.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4f
echo should be replaced with echo -e to handle '\n' correctly, but
instead, replace it with printf as some systems can't handle echo -e.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf
echo should be replaced with echo -e to handle '\n' correctly, but
instead, replace it with printf as some systems can't handle echo -e.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples
Add couple preparation steps: clean and configuration. Also add newly
added sysroot support info to cross-compile section.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/README.rst | 41 -
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git
It can overlap with CFLAGS used for libraries built with gcc if
not now then in next patches. Correct it here for simplicity.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/samples
clean
configure and install headers:
make ARCH=arm defconfig
make ARCH=arm headers_install
build samples/bpf:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- samples/bpf/ \
SYSROOT="path/to/sysroot"
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 +++
On Fri, Oct 11, 2019 at 02:00:56AM +0200, Daniel Borkmann wrote:
On Wed, Oct 09, 2019 at 11:41:19PM +0300, Ivan Khoronzhuk wrote:
This series contains mainly fixes/improvements for cross-compilation
but not only, tested for arm, arm64, and intended for any arch.
Also verified on native build
lso remove spaces at
start of the lines to keep same style and avoid warns while apply.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
tools/lib/bpf/Makefile | 18 +-
.../lib/bpf/{test_libbpf.cpp => test_libbpf.c} | 14 --
2 file
t;SMP is not supported" for armv7 and bunch of other errors are
issued resulting to incorrect final object.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 8
1 file changed, 8 insertions(+)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index cf882e43648a..9b33e7395
In order to build lib using C/LD flags of target arch, provide them
to libbpf make.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index a6c33496e8ca..6b161326ac67 100644
ve `always += cookie_uid_helper_example.o`, which avoids
breaking cross compilation due to mismatched includes.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 4f
compilation (CC) with host build (HOSTCC),
lets base samples on Makefile.target. It allows to cross-compile
samples/bpf programs with CC while auxialry tools running on host
built with HOSTCC.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 135 ++-
1
-Wmissing-prototypes
-Wstrict-prototypes
So, add them as they were verified and used before adding
Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
while review, as no sense in such optimization for samples.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 6
In case of C/LDFLAGS there is no way to pass them correctly to build
command, for instance when --sysroot is used or external libraries
are used, like -lelf, wich can be absent in toolchain. This can be
used for samples/bpf cross-compiling allowing to get elf lib from
sysroot.
Signed-off-by: Ivan
Drop inclusion for bpf_load -I$(objtree)/usr/include as it is
included for all objects anyway, with above line:
KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion
pf cross compilation.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile.target | 75 +
1 file changed, 75 insertions(+)
create mode 100644 samples/bpf/Makefile.target
diff --git a/samples/bpf/Makefile.target b/samples/bpf/Makefile.target
new fi
No need in hacking HOSTCC to be cross-compiler any more, so drop
this trick and use target CC for HDR_PROBE.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/samples/bpf/Makefile b/samples
ile: fix cookie_uid_helper_example obj build"
- limited -D option filter only for arm
- improved comments
- added couple instructions to verify cross compilation for arm and
arm64 arches based on TI am57xx and am65xx sdks.
- corrected include a little order
Ivan Khoronzhuk (15):
samples/bpf: fix
For cross compiling the target triple can be inherited from
cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
So copy-paste this decision from kernel Makefile.
Acked-by: Andrii Nakryiko
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1
On Fri, Oct 11, 2019 at 11:46:54AM +0300, Sergei Shtylyov wrote:
Hello!
Sorry, didn't comment on v4...
On 11.10.2019 3:27, Ivan Khoronzhuk wrote:
For arm, -D__LINUX_ARM_ARCH__=X is min version used as instruction
set selector and is absolutely required while parsing some parts of
headers
On Fri, Oct 11, 2019 at 11:49:38AM +0300, Sergei Shtylyov wrote:
More grammar nitpicking...
On 11.10.2019 3:28, Ivan Khoronzhuk wrote:
While compiling natively, the host's cflags and ldflags are equal to
ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
should have own
On Fri, Oct 11, 2019 at 02:16:05PM +0300, Sergei Shtylyov wrote:
On 10/11/2019 12:57 PM, Ivan Khoronzhuk wrote:
While compiling natively, the host's cflags and ldflags are equal to
ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
should have own, used for target arch. While
-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 61b7394b811e..a2953357927e 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -197,8 +197,6 @@ BTF_PAHOLE ?= pahole
ifdef CROSS_COMPILE
For cross compiling the target triple can be inherited from
cross-compile prefix as it's done in CLANG_FLAGS from kernel makefile.
So copy-paste this decision from kernel Makefile.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git
The kernel headers are reused from samples bpf, and autoconf.h is not
enough to reflect complete configuration for clang. One of such
configurations is __LINUX_ARM_ARCH__ min version used as instruction
set selector. In another case an error like "SMP is not
supported" for arm and others errors
In case of LDFLAGS and EXTRA_CC flags there is no way to pass them
correctly to build command, for instance when --sysroot is used or
external libraries are used, like -lelf. In follow up patches this is
used for samples/bpf cross-compiling getting elf lib from sysroot.
Signed-off-by: Ivan
eded for samples/bpf, potentially
can be reused and extended for other prog sets later and now needed
only for unblocking tricky samples/bpf cross compilation.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile.prog | 77 +++
1 file changed, 77 insertions(+)
create
echo should be replaced on echo -e to handle \n correctly, but instead,
replace it on printf as some systems can't handle echo -e.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/bpf/Makefile b/samples/bpf
ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make samples/bpf/ SYSROOT="path/to/sysroot"
Sysroot contains correct headers installed ofc.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 164 -
samples/bpf/README.rst | 7 ++
2 fil
It can overlap with CFLAGS used for libraries built with gcc if
not now then in next patches. Correct it here for simplicity.
Signed-off-by: Ivan Khoronzhuk
---
samples/bpf/Makefile | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/samples/bpf/Makefile b/samples/bpf
, some warn options could be
tuned also.
Ivan Khoronzhuk (8):
samples: bpf: Makefile: use --target from cross-compile
samples: bpf: Makefile: remove target for native build
libbpf: Makefile: add C/CXX/LDFLAGS to libbpf.so and test_libpf
targets
samples: bpf: use own EXTRA_CFLAGS
On Fri, Sep 06, 2019 at 04:31:39PM -0700, Alexei Starovoitov wrote:
On Thu, Sep 05, 2019 at 12:22:06AM +0300, Ivan Khoronzhuk wrote:
No need to set --target for native build, at least for arm, the
default target will be used anyway. In case of arm, for at least
clang 5 - 10 it causes error like
On Fri, Sep 06, 2019 at 05:04:08PM -0700, Alexei Starovoitov wrote:
On Fri, Sep 6, 2019 at 4:52 PM Ivan Khoronzhuk
wrote:
On Fri, Sep 06, 2019 at 04:31:39PM -0700, Alexei Starovoitov wrote:
>On Thu, Sep 05, 2019 at 12:22:06AM +0300, Ivan Khoronzhuk wrote:
>> No need to set --target f
801 - 900 of 1224 matches
Mail list logo