Skip to content

Commit

Permalink
UBUNTU: [Packaging] Copy expoline.o only when produced by the build
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2013209

CONFIG_EXPOLINE_EXTERN has been enabled for s390x [LP:#2013209]. While
this works as expected on the base kernels, it might not work on some
derivatives: for example focal:hwe-5.15 (derived from Jammy). 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 check on the existence of the expoline object file(s)
that are packaged later. This also makes the code more robust generally.

Signed-off-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
  • Loading branch information
Andrei Gherzan authored and Andrea Righi committed Mar 31, 2023
1 parent 29f94a9 commit 789c418
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debian/rules.d/2-binary-arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,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 [ -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
endif
# Copy over scripts/module.lds for building external modules
cp $(builddir)/build-$*/scripts/module.lds $(hdrdir)/scripts
Expand Down

0 comments on commit 789c418

Please sign in to comment.