ACK: [J/linux][L/linux][PATCH] UBUNTU: [Packaging] Copy expoline.o only when the relevant config is enabled

Andrea Righi andrea.righi at canonical.com
Thu Mar 30 09:47:17 UTC 2023


On Thu, Mar 30, 2023 at 10:00:49AM +0200, Stefan Bader wrote:
> On 30.03.23 09:31, Andrea Righi wrote:
> > On Wed, Mar 29, 2023 at 03:13:56PM +0100, Andrei Gherzan wrote:
> > > BugLink: https://bugs.launchpad.net/bugs/2013209
> > > 
> > > The Jammy kernel enabled CONFIG_EXPOLINE_EXTERN for s390x. While this
> > > works as expected on Jammy, it won't work on some derivatives of it: for
> > > example focal:hwe-5.15. On Focal, this config can't be enabled due to
> > > the GCC version it comes with. CONFIG_EXPOLINE_EXTERN requires >= 110200
> > > while Focal comes with 90400.
> > > 
> > > This change adds a config check when packaging of the expoline.o.
> > > 
> > > Signed-off-by: Andrei Gherzan <andrei.gherzan at canonical.com>
> > > ---
> > >   debian/rules.d/2-binary-arch.mk | 6 ++++--
> > >   1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > > index 8e053f832b06..4fd528b0d7fd 100644
> > > --- a/debian/rules.d/2-binary-arch.mk
> > > +++ b/debian/rules.d/2-binary-arch.mk
> > > @@ -335,8 +335,10 @@ ifeq ($(build_arch),powerpc)
> > >   	cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
> > >   endif
> > >   ifeq ($(build_arch),s390)
> > > -	mkdir -p $(hdrdir)/arch/s390/lib/expoline/
> > > -	cp $(builddir)/build-$*/arch/s390/lib/expoline/*.o $(hdrdir)/arch/s390/lib/expoline/
> > > +	if grep -q CONFIG_EXPOLINE_EXTERN=y $(builddir)/build-$*/.config; then \
> > > +		mkdir -p $(hdrdir)/arch/s390/lib/expoline/; \
> > > +		cp $(builddir)/build-$*/arch/s390/lib/expoline/*.o $(hdrdir)/arch/s390/lib/expoline/; \
> > > +	fi
> > 
> > We are implicitly assuming that CONFIG_EXPOLINE_EXTERN=y will always
> > generate the *.o files that want to copy, how about checking for the
> > presence of these files instead?
> > 
> > In this way everything will continue to work even if the config option
> > is renamed/removed or if it changes its behavior.
> 
> There was a little more discussion about this on a related internal thread.
> Ultimately this should be installed by the make install machinery from
> upstream. Which Andrei might be working on in parallel.
> This approach here is a bit of a band-aid which is not really necessary for
> K and L. But we thought we stay consistent. Maybe should make this SAUCE for
> L?

Considering that it's a packaging patch and will be addressed upstream
I don't think we need to mark it as SAUCE. We can apply it as temporary
bandaid and drop it once everything will be fixed upstream. Therefore:

Acked-by: Andrea Righi <andrea.righi at canonical.com>

> 
> -Stefan
> > 
> > Maybe something like this (untested):
> > 
> >   # If there's at least one *.o file in the expoline build directory, copy
> >   # it/them to $(hdrdir)/arch/s390/lib/expoline/
> >   if [ -n "$(find $(builddir)/build-$*/arch/s390/lib/expoline/ -maxdepth 1 -name '*.o' -print -quit)" ]; then
> >   	mkdir -p $(hdrdir)/arch/s390/lib/expoline/; \
> >   	cp $(builddir)/build-$*/arch/s390/lib/expoline/*.o $(hdrdir)/arch/s390/lib/expoline/; \
> >   fi
> > 
> > -Andrea
> > 



More information about the kernel-team mailing list