diff mbox series

[bpf-next,1/2] bpf/docs: Update vmtest docs for static linking

Message ID 20220307133048.1287644-1-kpsingh@kernel.org (mailing list archive)
State Accepted
Commit 5ad0a415da6be8c13ed45c655e5acc9fa93557a9
Delegated to: BPF
Headers show
Series [bpf-next,1/2] bpf/docs: Update vmtest docs for static linking | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: linux-kselftest@vger.kernel.org john.fastabend@gmail.com kafai@fb.com songliubraving@fb.com shuah@kernel.org yhs@fb.com netdev@vger.kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next success VM_Test

Commit Message

KP Singh March 7, 2022, 1:30 p.m. UTC
Dynamic linking when compiling on the host can cause issues when the
libc version does not match the one in the VM image. Update the
docs to explain how to do this.

Before:
  ./vmtest.sh -- ./test_progs -t test_ima
  ./test_progs: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by ./test_progs)

After:

  LDLIBS=-static ./vmtest.sh -- ./test_progs -t test_ima
  test_ima:OK
  Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

Reported-by: "Geyslan G. Bem" <geyslan@gmail.com>
Signed-off-by: KP Singh <kpsingh@kernel.org>
---
 tools/testing/selftests/bpf/README.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Andrii Nakryiko March 8, 2022, 6:28 a.m. UTC | #1
On Mon, Mar 7, 2022 at 5:30 AM KP Singh <kpsingh@kernel.org> wrote:
>
> Dynamic linking when compiling on the host can cause issues when the
> libc version does not match the one in the VM image. Update the
> docs to explain how to do this.
>
> Before:
>   ./vmtest.sh -- ./test_progs -t test_ima
>   ./test_progs: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by ./test_progs)
>
> After:
>
>   LDLIBS=-static ./vmtest.sh -- ./test_progs -t test_ima
>   test_ima:OK
>   Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
>
> Reported-by: "Geyslan G. Bem" <geyslan@gmail.com>
> Signed-off-by: KP Singh <kpsingh@kernel.org>
> ---
>  tools/testing/selftests/bpf/README.rst | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst
> index d099d91adc3b..f7fa74448492 100644
> --- a/tools/testing/selftests/bpf/README.rst
> +++ b/tools/testing/selftests/bpf/README.rst
> @@ -32,6 +32,14 @@ For more information on about using the script, run:
>
>    $ tools/testing/selftests/bpf/vmtest.sh -h
>
> +Incase of linker errors when running selftests, try using static linking:

fixed typo here and pushed to bpf-next.

It would still be good to fix the use of LDFLAGS, of course ;)

> +
> +.. code-block:: console
> +
> +  $ LDLIBS=-static vmtest.sh
> +
> +.. note:: Some distros may not support static linking.
> +
>  .. note:: The script uses pahole and clang based on host environment setting.
>            If you want to change pahole and llvm, you can change `PATH` environment
>            variable in the beginning of script.
> --
> 2.35.1.616.g0bdcbb4464-goog
>
patchwork-bot+netdevbpf@kernel.org March 8, 2022, 6:30 a.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon,  7 Mar 2022 13:30:47 +0000 you wrote:
> Dynamic linking when compiling on the host can cause issues when the
> libc version does not match the one in the VM image. Update the
> docs to explain how to do this.
> 
> Before:
>   ./vmtest.sh -- ./test_progs -t test_ima
>   ./test_progs: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by ./test_progs)
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/2] bpf/docs: Update vmtest docs for static linking
    https://git.kernel.org/bpf/bpf-next/c/5ad0a415da6b
  - [bpf-next,2/2] bpf/docs: Update list of architectures supported.
    https://git.kernel.org/bpf/bpf-next/c/e878ae2d1df5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst
index d099d91adc3b..f7fa74448492 100644
--- a/tools/testing/selftests/bpf/README.rst
+++ b/tools/testing/selftests/bpf/README.rst
@@ -32,6 +32,14 @@  For more information on about using the script, run:
 
   $ tools/testing/selftests/bpf/vmtest.sh -h
 
+Incase of linker errors when running selftests, try using static linking:
+
+.. code-block:: console
+
+  $ LDLIBS=-static vmtest.sh
+
+.. note:: Some distros may not support static linking.
+
 .. note:: The script uses pahole and clang based on host environment setting.
           If you want to change pahole and llvm, you can change `PATH` environment
           variable in the beginning of script.