From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C705C77B78 for ; Wed, 3 May 2023 10:09:09 +0000 (UTC) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com [209.85.222.42]) by mx.groups.io with SMTP id smtpd.web11.15267.1683108542918072237 for ; Wed, 03 May 2023 03:09:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=sNJ4qaVr; spf=pass (domain: gmail.com, ip: 209.85.222.42, mailfrom: quaresma.jose@gmail.com) Received: by mail-ua1-f42.google.com with SMTP id a1e0cc1a2514c-77d0160ed4cso1321107241.0 for ; Wed, 03 May 2023 03:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683108542; x=1685700542; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cCUIp+oGWewwGZhKY1MGMcqvu0ItjqJs6ptHd75J8V0=; b=sNJ4qaVr6ymIl4pog5pyxBAGCiEnNDfXJLkcnZIEYFe6Xd5zb7ORGkRJqHdnsdfxdb CC8w/P0xZrRbD2vDeG4gN08mOZs74jgCtEXv7dGXGOmLLjwqeZX+HjDniFzJx4/jzvpi hOk3Ha3wYz8s9+4XCrpLLRI0gFUi3BritMtqvj+X+gj9OfjYpW4VY36h/xB6SadLbfsN dk4JmNkWACTbqXH62Av+i+axlGv0VdqWqopDT2nrZJPNzPU5EnsJ0Rxvxw7WS8iqIlgo T8NypCR2Dh1IaAY9Gf75fzVlCpU/izGT4NZtN1JtfVlAF06hs/Sp6ukBcPeEHMvWlTsk dBSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683108542; x=1685700542; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cCUIp+oGWewwGZhKY1MGMcqvu0ItjqJs6ptHd75J8V0=; b=g7UgU4jCykyvGWWa0n/xoTxPsTfTZN4AyYNGyBB9LciFJzOAtjdQUb9mHYk1XCx4Up eH/9Ou42NssJx8L68nsdCGIGlXJQ819PzsipNZf2eJjMKrVd9H62766JQRzkTBy5B01L MGw7KvPY06S0JbrT2XsXMPiznHEWQt8SOf+M40PSoTU0DUUbji1ENe0bm5jRjq+l1BFy pyP3YCXi2vgApanFgHQBn3FTK97GN7YE2K/4jrh4ajyENMYH2EwybLbbc/Np5NlUZFZs 4vLjJwMiHcYMI1emrFP1QRP0rRZEN+zD7Dx3nUy79iKt5S6zPjUJaJGCEiYKSf5ANNM0 YBpQ== X-Gm-Message-State: AC+VfDx3JdqE0d9AtjIyx3j0bg0yu/fs8TKgfG83jVLThfHW+kUHE0pR TdZSKs4d4i+yBWBvQjF3bzNLE4c5DysSu64BTeY= X-Google-Smtp-Source: ACHHUZ7lNVIM0G3AnPbyKL1QVOFh0FCxE/HxQmLI1L/8f/SCdOYBFWS0diGmVQdg1MXumMQt0/6+x7OiFIqszQROVP8= X-Received: by 2002:a05:6102:153:b0:42c:7e09:f41f with SMTP id a19-20020a056102015300b0042c7e09f41fmr1051175vsr.16.1683108541727; Wed, 03 May 2023 03:09:01 -0700 (PDT) MIME-Version: 1.0 References: <20230416103052.28268-1-christoph.lauer@email.de> <27b6976546dae12e92dd3af28f657c02eca4afe8.camel@linuxfoundation.org> <652908a6640ffc911d46613cb99159086131416f.camel@linuxfoundation.org> <175785898B60CE37.9727@lists.openembedded.org> <7b254d25-03b9-5d0a-4257-4d43c50d069f@email.de> <1759F4E68EA4E1CC.26969@lists.openembedded.org> In-Reply-To: From: Jose Quaresma Date: Wed, 3 May 2023 11:08:50 +0100 Message-ID: Subject: Re: [OE-core] [PATCH] make-mod-scripts: preserve libraries when rm_work is used To: Bruce Ashfield Cc: Christoph Lauer , Richard Purdie , openembedded-core@lists.openembedded.org, Christoph Lauer Content-Type: multipart/alternative; boundary="000000000000bf89b505fac73e24" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 03 May 2023 10:09:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180805 --000000000000bf89b505fac73e24 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Bruce Ashfield escreveu no dia ter=C3=A7a, 2/05/= 2023 =C3=A0(s) 22:12: > Attached is v2 of the patch. I've consolidated the suggested changes. > > I'm soaking it a bit longer, and then will send it as part of my next > consolidated pull request. > I will do some more tests with the v2 and post my comment later if anything new comes up. Jose > > Bruce > > On Thu, Apr 27, 2023 at 9:26=E2=80=AFPM Bruce Ashfield via > lists.openembedded.org > wrote: > > > > On Thu, Apr 27, 2023 at 6:32=E2=80=AFPM Jose Quaresma > wrote: > > > > > > Hi Bruce, > > > > > > I have been testing your patch and have some comments. > > > In some of my kernels I don't have the pkg-config changes and so I > have some fails linking the scripts/sign-file > > > because for static linking with the libcrypto we need the -ldl > -pthread. > > > > > > To fix my build I need to override the CRYPTO_LIBS in my kernel > because they use the hardcoded pkg-config > > > where it is not possible to pass the --static argument. > > > > > > With following change on top of your patch I can build moist of my > kernels: > > > > > > export HOSTLDFLAGS=3D"-lz" > > > > > > + HOSTPKG_CONFIG=3D"pkg-config --static" > > > + # override CRYPTO_LIBS since HOSTPKG_CONFIG lands only in > v5.19-rc1 > > > + # > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /?id=3Dd5ea4fece4508bf8e72b659cd22fa4840d8d61e5 > > > + CRYPTO_LIBS=3D"$(pkg-config --static --libs libcrypto > 2>/dev/null || echo -lcrypto)" > > > + > > > unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS > > > for t in prepare scripts_basic scripts; do > > > oe_runmake CC=3D"${KERNEL_CC}" LD=3D"${KERNEL_LD}" \ > > > AR=3D"${KERNEL_AR}" OBJCOPY=3D"${KERNEL_OBJCOPY}" \ > > > - HOSTPKG_CONFIG=3D"pkg-config --static" \ > > > + HOSTPKG_CONFIG=3D"${HOSTPKG_CONFIG}" > CRYPTO_LIBS=3D"${CRYPTO_LIBS}" \ > > > -C ${STAGING_KERNEL_DIR} O=3D${STAGING_KERNEL_BUILDDI= R} > $t > > > done > > > > > > > > > I think belive that the LIBELF_LIBS needs the same fix for the cases > where HOSTPKG_CONFIG is not available. > > > Also I think there is a typo in the LIBELF_LIBS because you first > populate it with pkg-config but on the export the variable is redefined > > > with the HOST_LIBELF_LIBS. I made a litle change too on that: > > > > > > # for pre-5.15 kernels > > > - LIBELF_LIBS=3D$(pkg-config libelf --libs 2>/dev/null || echo > -lelf) > > > - export LIBELF_LIBS=3D"$HOST_LIBELF_LIBS -lz" > > > + LIBELF_LIBS=3D$(pkg-config --static libelf --libs 2>/dev/null= || > echo -lelf) > > > + export LIBELF_LIBS=3D"$LIBELF_LIBS -lz" > > > export HOSTLDFLAGS=3D"-lz" > > > > > > Thanks for you help. > > > > Those are definitely plausible tweaks to the patch, I was providing > > the two techniques for that reason, and you've used them > > appropriately. > > > > Let me roll your changes into my patch, re-test and I'll submit it to > > the mailing list as a v2. > > > > Thanks for the testing, and fixup, I knew there would be things missing= ! > :) > > > > Bruce > > > > > > > > Jose > > > > > > Bruce Ashfield escreveu no dia segunda, > 24/04/2023 =C3=A0(s) 20:25: > > >> > > >> On Mon, Apr 24, 2023 at 6:30=E2=80=AFAM Jose Quaresma < > quaresma.jose@gmail.com> wrote: > > >> > > > >> > > > >> > > > >> > Bruce Ashfield escreveu no dia domingo, > 23/04/2023 =C3=A0(s) 20:55: > > >> >> > > >> >> On Sat, Apr 22, 2023 at 9:06=E2=80=AFAM Christoph Lauer > > >> >> wrote: > > >> >> > > > >> >> > Am 21.04.23 um 22:28 schrieb Bruce Ashfield: > > >> >> > > On Wed, Apr 19, 2023 at 11:03=E2=80=AFPM Bruce Ashfield via > > >> >> > > lists.openembedded.org > > >> >> > > wrote: > > >> >> > >> > > >> >> > >> On Wed, Apr 19, 2023 at 6:54=E2=80=AFPM Richard Purdie > > >> >> > >> wrote: > > >> >> > >>> > > >> >> > >>> On Wed, 2023-04-19 at 23:34 +0100, Jose Quaresma wrote: > > >> >> > >>>> Hi, > > >> >> > >>>> > > >> >> > >>>> Not related with the previous discussion but just for > > >> >> > >>>> your information. > > >> >> > >>>> The rm_work.bbclass has an exception for the kernel recipe= s > [1]. > > >> >> > >>>> So I don't understand why we can't do the same for the > make-mod- > > >> >> > >>>> scripts > > >> >> > >>>> who is the twin brother of all these kernel recipes. > > >> >> > >>>> > > >> >> > >>>> [1] > > >> >> > >>>> > https://git.openembedded.org/openembedded-core/tree/meta/classes/rm_work.= bbclass#n168 > > >> >> > >>> > > >> >> > >>> Ideally we wouldn't be doing this for the kernel recipes. > > >> >> > >>> > > >> >> > >>> There is also a big difference to that and the proposed > patch. The > > >> >> > >>> proposed patch was preserving a specific directory rather > than an > > >> >> > >>> entire recipe. Removing the task stamps but leaving a small > piece of > > >> >> > >>> WORKDIR is quite different to preserving WORKDIR and STAMPS > for a > > >> >> > >>> specific recipe. The former is not tested and will break > things. The > > >> >> > >>> latter is better tolerated by bitbake. > > >> >> > >> > > >> >> > >> Agreed. > > >> >> > >> > > >> >> > >> Plus, I am working on this now. > > >> >> > >> > > >> >> > >> I have static linking of the scripts/tools working, but what > I haven't > > >> >> > >> figured out is how to do that without patching the Makefiles= . > > >> >> > >> > > >> >> > > > > >> >> > > It turned out to be quite the battle to get older kernels wha= t > was > > >> >> > > required for static linking of the tools. > > >> >> > > > > >> >> > > Attached is my WIP patch. I'm out of the office early next > week, but > > >> >> > > will revisit it once I'm back. > > >> >> > > > > >> >> > > Bruce > > >> >> > > > > >> >> > >> Next up will be some rpath trickery. > > >> >> > >> > > >> >> > >> Bruce > > >> >> > >> > > >> >> > >>> > > >> >> > >>> So yes, we could do the same. I'm sure there will be other > recipes > > >> >> > >>> people want to preserve for other reasons. Where do we draw > the line? > > >> >> > >>> We could preserve everything and drop rm_work, then we > wouldn't have > > >> >> > >>> these problems? :) > > >> >> > >>> > > >> >> > >>> Cheers, > > >> >> > >>> > > >> >> > >>> Richard > > >> >> > >> > > >> >> > >> > > >> >> > >> > > >> >> > >> -- > > >> >> > >> - Thou shalt not follow the NULL pointer, for chaos and > madness await > > >> >> > >> thee at its end > > >> >> > >> - "Use the force Harry" - Gandalf, Star Trek II > > >> >> > >> > > >> >> > >> > > >> >> > >> > > >> >> > > > > >> >> > > > > >> >> > > > >> >> > Thank you for your work, I see you put some time and effort int= o > it. > > >> >> > HOSTPKG_CONFIG is, as you mentioned, available since kernel > version 5.19 > > >> >> > > >> >> Yes, I realize that and documented it in the patch ... but I also > > >> >> tested on pre-5.19 kernels and what I have in the patch works. Di= d > it > > >> >> not work in your testing ? > > >> > > > >> > > > >> > I will test the patch on a couple of kernel versions with some of > them pre-5.19 > > >> > but all in 5 major versions. > > >> > I will say something about my results later this week. > > >> > > >> 5.15-stable also has the pkg-config changes > > >> > > >> Bruce > > >> > > >> > > > >> > Thanks for working on this one. > > >> > > > >> > Jose > > >> > > > >> >> > > >> >> > > >> >> > (see kernel patch [1]), so we need a way to call 'pkg-config > --static' > > >> >> > with pre-5.19 kernels. A way without modifying the Makefile > would be to > > >> >> > modify openssls pkg-config in recipe-sysroot-native of > make-mod-script, > > >> >> > so 'pkg-config --libs' actually shows the dependencies of > 'pkg-config > > >> >> > --static --libs', but it's a bit hacky. > > >> >> > > >> >> Already considered, and discarded. That's not going to fly. > > >> >> > > >> >> > > > >> >> > Also fully-static executables still need the same glibc during > runtime > > >> >> > that they were built with, which makes them error-prone and is > generally > > >> >> > discouraged. As an alternative, we could build dynamic > executables that > > >> >> > use the static libcrypto library. The linker links by default > against > > >> >> > the shared library, so we could remove them from > recipe-sysroot-native > > >> >> > to force linking against the static library (again, somewhat > hacky). > > >> >> > > >> >> Also considered and discarded. > > >> >> > > >> >> As do the dynamically linked ones for the c runtime. We aren't > talking > > >> >> about using these outside of a single build and they are generate= d > on > > >> >> the fly, so again, there's very little concern about runtimes > changing > > >> >> after linking.. There's less risk in static than in the > alternatives. > > >> >> > > >> >> Bruce > > >> >> > > >> >> > > >> >> > > > >> >> > [1] > > >> >> > > https://github.com/torvalds/linux/commit/d5ea4fece4508bf8e72b659cd22fa484= 0d8d61e5 > > >> >> > > >> >> > > >> >> > > >> >> -- > > >> >> - Thou shalt not follow the NULL pointer, for chaos and madness > await > > >> >> thee at its end > > >> >> - "Use the force Harry" - Gandalf, Star Trek II > > >> > > > >> > > > >> > > > >> > -- > > >> > Best regards, > > >> > > > >> > Jos=C3=A9 Quaresma > > >> > > >> > > >> > > >> -- > > >> - Thou shalt not follow the NULL pointer, for chaos and madness awai= t > > >> thee at its end > > >> - "Use the force Harry" - Gandalf, Star Trek II > > > > > > > > > > > > -- > > > Best regards, > > > > > > Jos=C3=A9 Quaresma > > > > > > > > -- > > - Thou shalt not follow the NULL pointer, for chaos and madness await > > thee at its end > > - "Use the force Harry" - Gandalf, Star Trek II > > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > Links: You receive all messages sent to this group. > > View/Reply Online (#180502): > https://lists.openembedded.org/g/openembedded-core/message/180502 > > Mute This Topic: https://lists.openembedded.org/mt/98296212/1050810 > > Group Owner: openembedded-core+owner@lists.openembedded.org > > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > bruce.ashfield@gmail.com] > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > > > > -- > - Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end > - "Use the force Harry" - Gandalf, Star Trek II > --=20 Best regards, Jos=C3=A9 Quaresma --000000000000bf89b505fac73e24 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
Bruce Ashfield <bruce.ashfield@gmail.com> escreveu no dia = ter=C3=A7a, 2/05/2023 =C3=A0(s) 22:12:
Attached is v2 of the patch. I've consolidated t= he suggested changes.

I'm soaking it a bit longer, and then will send it as part of my next consolidated pull request.

I will do so= me more tests with the v2 and post my comment later if anything new comes u= p.

Jose
=C2=A0

Bruce

On Thu, Apr 27, 2023 at 9:26=E2=80=AFPM Bruce Ashfield via
lists.openembedded.org
<bruce.ashfield=3Dgmail.com@lists.openembedded.org> wrote:
>
> On Thu, Apr 27, 2023 at 6:32=E2=80=AFPM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> >
> > Hi Bruce,
> >
> > I have been testing your patch and have some comments.
> > In some of my kernels I don't have the pkg-config changes and= so I have some fails linking the scripts/sign-file
> > because for static linking with the libcrypto we need the -ldl -p= thread.
> >
> > To fix my build I need to override the CRYPTO_LIBS in my kernel b= ecause they use the hardcoded pkg-config
> > where it is not possible to pass the --static argument.
> >
> > With following change on top of your patch I can build moist of m= y kernels:
> >
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0export HOSTLDFLAGS=3D"-lz&q= uot;
> >
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0HOSTPKG_CONFIG=3D"pkg-config --s= tatic"
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0# override CRYPTO_LIBS since HOSTPKG_= CONFIG lands only in v5.19-rc1
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0#
https://git.ker= nel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3Dd5ea4fece4= 508bf8e72b659cd22fa4840d8d61e5
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0CRYPTO_LIBS=3D"$(pkg-config --st= atic --libs libcrypto 2>/dev/null || echo -lcrypto)"
> > +
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unset CFLAGS CPPFLAGS CXXFLAGS L= DFLAGS
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for t in prepare scripts_basic s= cripts; do
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0oe_r= unmake CC=3D"${KERNEL_CC}" LD=3D"${KERNEL_LD}" \
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AR= =3D"${KERNEL_AR}" OBJCOPY=3D"${KERNEL_OBJCOPY}" \
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HOSTPKG_C= ONFIG=3D"pkg-config --static" \
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HOSTPKG_C= ONFIG=3D"${HOSTPKG_CONFIG}" CRYPTO_LIBS=3D"${CRYPTO_LIBS}&qu= ot; \
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-C $= {STAGING_KERNEL_DIR} O=3D${STAGING_KERNEL_BUILDDIR} $t
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0done
> >
> >
> > I think belive that the LIBELF_LIBS needs the same fix for the ca= ses where HOSTPKG_CONFIG is not available.
> > Also I think there is a typo in the LIBELF_LIBS because you first= populate it with pkg-config but on the export the variable is redefined > > with the HOST_LIBELF_LIBS. I made a litle change too on that:
> >
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# for pre-5.15 kernels
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0LIBELF_LIBS=3D$(pkg-config libelf --l= ibs 2>/dev/null || echo -lelf)
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0export LIBELF_LIBS=3D"$HOST_LIBE= LF_LIBS -lz"
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0LIBELF_LIBS=3D$(pkg-config --static l= ibelf --libs 2>/dev/null || echo -lelf)
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0export LIBELF_LIBS=3D"$LIBELF_LI= BS -lz"
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0export HOSTLDFLAGS=3D"-lz&q= uot;
> >
> > Thanks for you help.
>
> Those are definitely plausible tweaks to the patch, I was providing > the two techniques for that reason, and you've used them
> appropriately.
>
> Let me roll your changes into my patch, re-test and I'll submit it= to
> the mailing list as a v2.
>
> Thanks for the testing, and fixup, I knew there would be things missin= g! :)
>
> Bruce
>
> >
> > Jose
> >
> > Bruce Ashfield <bruce.ashfield@gmail.com> escreveu no dia segunda, 2= 4/04/2023 =C3=A0(s) 20:25:
> >>
> >> On Mon, Apr 24, 2023 at 6:30=E2=80=AFAM Jose Quaresma <quaresma.jose@gma= il.com> wrote:
> >> >
> >> >
> >> >
> >> > Bruce Ashfield <bruce.ashfield@gmail.com> escreveu no dia d= omingo, 23/04/2023 =C3=A0(s) 20:55:
> >> >>
> >> >> On Sat, Apr 22, 2023 at 9:06=E2=80=AFAM Christoph La= uer
> >> >> <Christoph.Lauer@email.de> wrote:
> >> >> >
> >> >> > Am 21.04.23 um 22:28 schrieb Bruce Ashfield: > >> >> > > On Wed, Apr 19, 2023 at 11:03=E2=80=AFPM B= ruce Ashfield via
> >> >> > > lists.openembedded.org
> >> >> > > <bruce.ashfield=3Dgmail.com@lists.openembedd= ed.org> wrote:
> >> >> > >>
> >> >> > >> On Wed, Apr 19, 2023 at 6:54=E2=80=AFP= M Richard Purdie
> >> >> > >> <richard.purdie@linuxfoundation.org> wrote:
> >> >> > >>>
> >> >> > >>> On Wed, 2023-04-19 at 23:34 +0100,= Jose Quaresma wrote:
> >> >> > >>>> Hi,
> >> >> > >>>>
> >> >> > >>>> Not related with the previous = discussion but just for
> >> >> > >>>> your information.
> >> >> > >>>> The rm_work.bbclass has an exc= eption for the kernel recipes [1].
> >> >> > >>>> So I don't understand why = we can't do the same for the make-mod-
> >> >> > >>>> scripts
> >> >> > >>>> who is the twin brother of all= these kernel recipes.
> >> >> > >>>>
> >> >> > >>>> [1]
> >> >> > >>>>
https://git.openembedded.org/openembedded-cor= e/tree/meta/classes/rm_work.bbclass#n168
> >> >> > >>>
> >> >> > >>> Ideally we wouldn't be doing t= his for the kernel recipes.
> >> >> > >>>
> >> >> > >>> There is also a big difference to = that and the proposed patch. The
> >> >> > >>> proposed patch was preserving a sp= ecific directory rather than an
> >> >> > >>> entire recipe. Removing the task s= tamps but leaving a small piece of
> >> >> > >>> WORKDIR is quite different to pres= erving WORKDIR and STAMPS for a
> >> >> > >>> specific recipe. The former is not= tested and will break things. The
> >> >> > >>> latter is better tolerated by bitb= ake.
> >> >> > >>
> >> >> > >> Agreed.
> >> >> > >>
> >> >> > >> Plus, I am working on this now.
> >> >> > >>
> >> >> > >> I have static linking of the scripts/t= ools working, but what I haven't
> >> >> > >> figured out is how to do that without = patching the Makefiles.
> >> >> > >>
> >> >> > >
> >> >> > > It turned out to be quite the battle to ge= t older kernels what was
> >> >> > > required for static linking of the tools.<= br> > >> >> > >
> >> >> > > Attached is my WIP patch. I'm out of t= he office early next week, but
> >> >> > > will revisit it once I'm back.
> >> >> > >
> >> >> > > Bruce
> >> >> > >
> >> >> > >> Next up will be some rpath trickery. > >> >> > >>
> >> >> > >> Bruce
> >> >> > >>
> >> >> > >>>
> >> >> > >>> So yes, we could do the same. I= 9;m sure there will be other recipes
> >> >> > >>> people want to preserve for other = reasons. Where do we draw the line?
> >> >> > >>> We could preserve everything and d= rop rm_work, then we wouldn't have
> >> >> > >>> these problems? :)
> >> >> > >>>
> >> >> > >>> Cheers,
> >> >> > >>>
> >> >> > >>> Richard
> >> >> > >>
> >> >> > >>
> >> >> > >>
> >> >> > >> --
> >> >> > >> - Thou shalt not follow the NULL point= er, for chaos and madness await
> >> >> > >> thee at its end
> >> >> > >> - "Use the force Harry" - Ga= ndalf, Star Trek II
> >> >> > >>
> >> >> > >>
> >> >> > >>
> >> >> > >
> >> >> > >
> >> >> >
> >> >> > Thank you for your work, I see you put some tim= e and effort into it.
> >> >> > HOSTPKG_CONFIG is, as you mentioned, available = since kernel version 5.19
> >> >>
> >> >> Yes, I realize that and documented it in the patch .= .. but I also
> >> >> tested on pre-5.19 kernels and what I have in the pa= tch works. Did it
> >> >> not work in your testing ?
> >> >
> >> >
> >> > I will test the patch on a couple of kernel versions wit= h some of them pre-5.19
> >> > but all in 5 major versions.
> >> > I will say something about my results later this week. > >>
> >> 5.15-stable also has the pkg-config changes
> >>
> >> Bruce
> >>
> >> >
> >> > Thanks for working on this one.
> >> >
> >> > Jose
> >> >
> >> >>
> >> >>
> >> >> > (see kernel patch [1]), so we need a way to cal= l 'pkg-config --static'
> >> >> > with pre-5.19 kernels. A way without modifying = the Makefile would be to
> >> >> > modify openssls pkg-config in recipe-sysroot-na= tive of make-mod-script,
> >> >> > so 'pkg-config --libs' actually shows t= he dependencies of 'pkg-config
> >> >> > --static --libs', but it's a bit hacky.=
> >> >>
> >> >> Already considered, and discarded. That's not go= ing to fly.
> >> >>
> >> >> >
> >> >> > Also fully-static executables still need the sa= me glibc during runtime
> >> >> > that they were built with, which makes them err= or-prone and is generally
> >> >> > discouraged. As an alternative, we could build = dynamic executables that
> >> >> > use the static libcrypto library. The linker li= nks by default against
> >> >> > the shared library, so we could remove them fro= m recipe-sysroot-native
> >> >> > to force linking against the static library (ag= ain, somewhat hacky).
> >> >>
> >> >> Also considered and discarded.
> >> >>
> >> >> As do the dynamically linked ones for the c runtime.= We aren't talking
> >> >> about using these outside of a single build and they= are generated on
> >> >> the fly, so again, there's very little concern a= bout runtimes changing
> >> >> after linking.. There's less risk in static than= in the alternatives.
> >> >>
> >> >> Bruce
> >> >>
> >> >>
> >> >> >
> >> >> > [1]
> >> >> > https://github.com/torvalds/linux/commit/d5ea4fece4508bf8e72b659cd= 22fa4840d8d61e5
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> - Thou shalt not follow the NULL pointer, for chaos = and madness await
> >> >> thee at its end
> >> >> - "Use the force Harry" - Gandalf, Star Tr= ek II
> >> >
> >> >
> >> >
> >> > --
> >> > Best regards,
> >> >
> >> > Jos=C3=A9 Quaresma
> >>
> >>
> >>
> >> --
> >> - Thou shalt not follow the NULL pointer, for chaos and madne= ss await
> >> thee at its end
> >> - "Use the force Harry" - Gandalf, Star Trek II
> >
> >
> >
> > --
> > Best regards,
> >
> > Jos=C3=A9 Quaresma
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await<= br> > thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
> Links: You receive all messages sent to this group.
> View/Reply Online (#180502): h= ttps://lists.openembedded.org/g/openembedded-core/message/180502
> Mute This Topic: https://lists.openembedded.o= rg/mt/98296212/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org=
> Unsubscribe: https://lists.openembedded= .org/g/openembedded-core/unsub [bruce.ashfield@gmail.com]
> -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
>


--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


--
Best regards,

Jos=C3=A9 Quaresma
--000000000000bf89b505fac73e24--