All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: kernel bpf test_progs - vm wrong libc version
Date: Tue, 15 Jun 2021 12:00:02 -0700	[thread overview]
Message-ID: <CAEf4BzbttnVxHccPjeFednpZ24Q4UHzTE96xbpMrFBBrZZXFDg@mail.gmail.com> (raw)
In-Reply-To: <CAGG-pURkzDB5na9OpZ5QJFofG7YWm1EYCENs2O988T3QpbhwTA@mail.gmail.com>

On Tue, Jun 15, 2021 at 9:42 AM Geyslan G. Bem <geyslan@gmail.com> wrote:
>
> On Tue, 15 Jun 2021 at 12:58, KP Singh <kpsingh@kernel.org> wrote:
> >
> > On Tue, Jun 15, 2021 at 4:57 PM Geyslan G. Bem <geyslan@gmail.com> wrote:
> > >
> > > On Tue, 15 Jun 2021 at 11:33, KP Singh <kpsingh@kernel.org> wrote:
> > > >
> > > > On Tue, Jun 15, 2021 at 2:34 PM Geyslan G. Bem <geyslan@gmail.com> wrote:
> > > > >
> > > > > On Tue, 15 Jun 2021 at 06:58, KP Singh <kpsingh@kernel.org> wrote:
> > > > > >
> > > > > > On Tue, Jun 15, 2021 at 10:06 AM Jussi Maki <joamaki@gmail.com> wrote:
> > > > > > >
> > > > > > > On Tue, Jun 15, 2021 at 8:28 AM Andrii Nakryiko
> > > > > > > <andrii.nakryiko@gmail.com> wrote:
> > > > > > > > It seems kind of silly to update our perfectly working image just
> > > > > > > > because a new version of glibc was released. Is there any way for you
> > > > > > > > to down-grade glibc or build it in some compatibility mode, etc?
> > > > > > > > selftests don't really rely on any bleeding-edge features of glibc.
> > > > > > >
> > > > > > > I've also hit this issue as Ubuntu 21.04 ships with glibc 2.33. I
> > > > > > > ended up solving it the hard way by rebuilding the image (I needed few
> > > > > > > other tools at the time anyway). Definitely agree it's a bit silly if
> > > > > > > we'd need to bump the image every time there's a new glibc version out
> > > > > > > there. I did try and see if there's a way to build against newer
> > > > > > > glibc, but target older versions and I didn't find a way to do that.
> > > > > > > Would statically linking test-progs be an option to avoid this kind of
> > > > > > > breakage in the future?
> > > > > >
> > > > > > I think static linking tests_progs is the only real way one can solve this.
> > > > > > Even if we keep updating the image, there will still be users that will hit
> > > > > > glibc version issues.
> > > > >
> > > > > I agree once the image remains static.
> > > > >
> > > > > >
> > > > > > Andrii, Maybe we can have a mode for vmtest.sh can build test_progs
> > > > > > statically?
> > > > > >
> > > > > > maybe something like:
> > > > >
> > > > > These changes generates the output:
> > > > >
> > > > >   BINARY   test_maps
> > > > > /usr/bin/ld: cannot find -lcap
> > > > > collect2: error: ld returned 1 exit status
> > > > > make: *** [Makefile:492:
> > > > > /home/uzu/code/bpf-next/tools/testing/selftests/bpf/test_maps] Error 1
> > > > >
> > > > > libcap and acl are installed
> > > >
> > > > Are you sure you have libcap-dev installed? I don't see this on my system.
> > >
> > > As Arch packages maintain headers, I suppose libcap has everything.
> > >
> > > $ yay -F libcap.so
> > > core/libcap 2.49-1 [installed: 2.50-2]
> > >     usr/lib/libcap.so
> > > multilib/lib32-libcap 2.49-1 [installed: 2.50-1]
> > >     usr/lib32/libcap.so
> > >
> > > $ yay -F cap-ng.h
> > > core/libcap-ng 0.8.2-1 [installed]
> > >     usr/include/cap-ng.h
> > >
> > > $ ls -l /usr/include/cap*
> > > -rw-r--r-- 1 root root 3402 dez  9  2020 /usr/include/cap-ng.h
> > >
> > > $ ls -l /usr/lib/libcap*
> > > lrwxrwxrwx 1 root root    18 dez  9  2020 /usr/lib/libcap-ng.so ->
> > > libcap-ng.so.0.0.0
> > > lrwxrwxrwx 1 root root    18 dez  9  2020 /usr/lib/libcap-ng.so.0 ->
> > > libcap-ng.so.0.0.0
> > > -rwxr-xr-x 1 root root 26424 dez  9  2020 /usr/lib/libcap-ng.so.0.0.0
> > > lrwxrwxrwx 1 root root    11 jun  7 14:25 /usr/lib/libcap.so -> libcap.so.2
> > > lrwxrwxrwx 1 root root    14 jun  7 14:25 /usr/lib/libcap.so.2 -> libcap.so.2.50
> > > -rw-r--r-- 1 root root 38704 jun  7 14:25 /usr/lib/libcap.so.2.50
> > >
> > > https://archlinux.org/packages/core/x86_64/libcap/
> > > https://archlinux.org/packages/core/x86_64/libcap-ng/
> > >
> > > Anything, please contact me. I want to help.
> >
> > Apologies I missed adding the list in my previous reply.
> >
> > I think your distribution is missing static libcap
> >
> > $ dpkg -L libcap-dev
> >
> > [...]
> >
> > /usr/lib/x86_64-linux-gnu
> > /usr/lib/x86_64-linux-gnu/libcap.a
> > /usr/lib/x86_64-linux-gnu/libpsx.a
> >
> > [...]
> >
> > It seems like arch does not have them:
> >
> > https://bbs.archlinux.org/viewtopic.php?id=245303
>
> Indeed.
>
> >
> > and they don't plan to either. So you can either build the library locally
> > or possibly move to a distribution that provides static linking.
>
> I think this would keep things in different host environments
> complicated. I'm more likely to create a proper VM to handle kernel
> source and bpf tests, since bpf also demands llvm13 (cutting edge)
> which is conflicting with other projects.
>

KP, how do you feel about teaching vmtest.sh to (optionally, if
requested or if we detect that environment clang is too old) checkout
clang and build it before building selftests? So many people would be
grateful for this, I imagine! ;)

> >
> > [incase we decide to use the static linking for vmtest.sh]
>
> It's still a good decision for environments with readily available
> static binaries.

yeah, it's a good option to have at the very least

>
> Thanks a million for your attention.
>
> --
> Regards,
>
> Geyslan G. Bem

  reply	other threads:[~2021-06-15 19:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 20:18 kernel bpf test_progs - vm wrong libc version Geyslan G. Bem
2021-06-15  6:27 ` Andrii Nakryiko
2021-06-15  8:06   ` Jussi Maki
2021-06-15  9:57     ` KP Singh
2021-06-15 12:32       ` Geyslan G. Bem
     [not found]         ` <CACYkzJ5odOMQzcbfnvJmW52uxs50FY1=kSbADvD4UCF9fh3X5w@mail.gmail.com>
     [not found]           ` <CAGG-pURQ4hxQe8w3zdW4y1hBRn1sGikB_5oodid_NHaw_U=9iw@mail.gmail.com>
2021-06-15 15:58             ` KP Singh
2021-06-15 16:40               ` Geyslan G. Bem
2021-06-15 19:00                 ` Andrii Nakryiko [this message]
2021-06-18 14:34                   ` KP Singh
2021-06-15 11:54   ` Geyslan G. Bem

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzbttnVxHccPjeFednpZ24Q4UHzTE96xbpMrFBBrZZXFDg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=geyslan@gmail.com \
    --cc=kpsingh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.