failed to build DKMS fwts-efi-runtime-dkms/19.11.00 against v5.4-rc1 and on: numerous compile errors

Bug #1853090 reported by You-Sheng Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fwts (Ubuntu)
Fix Released
High
Colin Ian King

Bug Description

1. Install ubuntu mainline kernel from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4-rc1/
2. sudo dkms install fwts-efi-runtime-dkms/19.11.00 -k 5.4.0-050400rc1-generic

make[1]: Entering directory '/usr/src/linux-headers-5.4.0-050400rc1-generic'
  CC [M] /var/lib/dkms/fwts-efi-runtime-dkms/19.11.00/build/efi_runtime.o
In file included from <command-line>:0:0:
./arch/x86/include/asm/segment.h: In function ‘vdso_read_cpunode’:
././include/linux/compiler_types.h:210:24: error: expected ‘(’ before ‘__inline’
 #define asm_inline asm __inline
                        ^
./arch/x86/include/asm/alternative.h:240:2: note: in expansion of macro ‘asm_inline’
  asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, feature) \
  ^~~~~~~~~~
./arch/x86/include/asm/segment.h:254:2: note: in expansion of macro ‘alternative_io’
  alternative_io ("lsl %[seg],%[p]",
  ^~~~~~~~~~~~~~
In file included from ./arch/x86/include/asm/barrier.h:5:0,
                 from ./include/linux/compiler.h:256,
                 from ./include/linux/export.h:44,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:8,
                 from ./include/linux/list.h:9,
                 from ./include/linux/miscdevice.h:5,
                 from /var/lib/dkms/fwts-efi-runtime-dkms/19.11.00/build/efi_runtime.c:23:
./arch/x86/include/asm/alternative.h:108:2: error: expected identifier or ‘(’ before string constant
...

Many errors dumped in the make.log.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: fwts 19.11.00-0ubuntu1
ProcVersionSignature: Ubuntu 5.0.0-1016.18-oem-osp1 5.0.18
Uname: Linux 5.0.0-1016-oem-osp1 x86_64
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Mon Nov 18 23:59:52 2019
DistributionChannelDescriptor:
 # This is the distribution channel descriptor for the OEM CDs
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-bionic-amd64-20190418-59+beaver-osp1-loras+X20
InstallationDate: Installed on 2019-11-14 (4 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20190418-12:10
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: fwts
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
You-Sheng Yang (vicamo) wrote :
summary: - failed to build against v5.4-rc1 and on: numerous compile errors
+ failed to build DKMS fwts-efi-runtime-dkms/19.11.00 against v5.4-rc1 and
+ on: numerous compile errors
description: updated
Changed in fwts (Ubuntu):
status: New → Confirmed
Revision history for this message
Colin Ian King (colin-king) wrote :

fwts builds on non-rc 5.4 kernels. I believe the issue you are seeing is an issue with the kernel header file and not the fwts dkms module, so this is not fixable.

Changed in fwts (Ubuntu):
status: Confirmed → Won't Fix
importance: Undecided → Low
assignee: nobody → Colin Ian King (colin-king)
status: Won't Fix → In Progress
Revision history for this message
Colin Ian King (colin-king) wrote :

Actually, I'll double check this with the lastest 5.4 kernel.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

I've checked this also fails on latest v5.4-rc8.

Revision history for this message
Colin Ian King (colin-king) wrote :

We have not seen this issue as it builds fine against the current -unstable ubuntu 5.4.0-5-generic kernel with the ubuntu focal configs. I'll dig into this further for the ppa/mainline kernels.

Revision history for this message
Colin Ian King (colin-king) wrote :
Download full text (6.8 KiB)

I've tried this out with 5.4-rc1, rc7 and rc8 from the same PPA on focal and it works for me. Perhaps you are using a version of GCC on an older release that won't build against those kernel headers.

cking@focal-amd64-efi:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
Codename: focal
cking@focal-amd64-efi:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191109 (Ubuntu 9.2.1-19ubuntu1)
cking@focal-amd64-efi:~$ sudo apt-get install fwts-efi-runtime-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfdt1 libfwts1 libfwtsacpica1 libfwtsiasl1
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed
  fwts-efi-runtime-dkms
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/13.4 kB of archives.
After this operation, 103 kB of additional disk space will be used.
Selecting previously unselected package fwts-efi-runtime-dkms.
(Reading database ... 258496 files and directories currently installed.)
Preparing to unpack .../fwts-efi-runtime-dkms_19.11.00-0ubuntu1_amd64.deb ...
Unpacking fwts-efi-runtime-dkms (19.11.00-0ubuntu1) ...
Setting up fwts-efi-runtime-dkms (19.11.00-0ubuntu1) ...
Loading new fwts-efi-runtime-dkms-19.11.00 DKMS files...
Building for 5.4.0-5-generic 5.4.0-050400rc8-generic
Building initial module for 5.4.0-5-generic
Secure Boot not enabled on this system.
Done.

efi_runtime.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-5-generic/updates/dkms/

depmod...

DKMS: install completed.
Building initial module for 5.4.0-050400rc8-generic
Secure Boot not enabled on this system.
Done.

efi_runtime.ko:
Running module version sanity check.
 - ...

Read more...

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Indeed. As you may have seen I was compiling this on Bionic, because QA is installing a backport version of latest fwts for testing OEM projects, which are all currently based on Bionic and using gcc-7.

Revision history for this message
Colin Ian King (colin-king) wrote :

Building any kernel related modules with older versions of gcc-7 can be problematic because of the linux headers. I'm note sure of a way to fix this as it's predicated on the kernel being built with a more recent compiler.

However, newer kernels do have the fwts kernel driver built in, so the dkms module is not required.

Revision history for this message
Alex Hung (alexhung) wrote :

The kernel module for fwts discussed in #8 is as below.

filename: /lib/modules/5.0.0-36-generic/kernel/drivers/firmware/efi/test/efi_test.ko
license: GPL
description: EFI Test Driver
author: Ivan Hu <email address hidden>
srcversion: 2FED4AC2FE8B461267F9F7F
depends:
retpoline: Y
intree: Y
name: efi_test
vermagic: 5.0.0-36-generic SMP mod_unload
signat: PKCS#7
signer:
sig_key:

Changed in fwts (Ubuntu):
status: In Progress → Won't Fix
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Either that module should not be built against recent kernels on Bionic, or it should pass the build process.

Changed in fwts (Ubuntu):
status: Won't Fix → Confirmed
assignee: Colin Ian King (colin-king) → You-Sheng Yang (vicamo)
Revision history for this message
Colin Ian King (colin-king) wrote :

It will not pass the build process with newer kernel headers and older incompatible versions of gcc. So I guess we are down to it should not be built against recent kernels. I reluctantly think that is the only way forward. But, this said, it is not a driver issue, or a kernel issue, it's an issue with using an older toolchain building a driver against headers that won't build with that version of gcc (if I am correct on that assertion).

Revision history for this message
Colin Ian King (colin-king) wrote :

Basically, don't build the dkms module if it's already provided as a kernel module, e.g. check if

/lib/modules/$(uname -r)/kernel/drivers/firmware/efi/test/efi_test.ko

exists, if so, don't build a kernel module with dkms.

Revision history for this message
Colin Ian King (colin-king) wrote :

I propose that something like the following patch could be used to skip over dkms builds for fwts if the kernel module is built-in to a specific kernel version.

I've not tried this in a final a packaged version of fwts, so I'm not 100% sure it will work, but it's a starting point.

tags: added: patch
Revision history for this message
Colin Ian King (colin-king) wrote :

OK, found that dkms allows one to check for specific kernel versions. Attached is the dkms fix.

Revision history for this message
Colin Ian King (colin-king) wrote :

Fix sent to fwts-devel for review. Once it is applied and released in fwts 19.12.00 I'll SRU this fix.

See: https://lists.ubuntu.com/archives/fwts-devel/2019-November/011621.html

Changed in fwts (Ubuntu):
assignee: You-Sheng Yang (vicamo) → Colin Ian King (colin-king)
importance: Low → High
status: Confirmed → In Progress
Revision history for this message
You-Sheng Yang (vicamo) wrote :

@Colin, thank you very much. Verified with packages built in https://launchpad.net/~vicamo/+archive/ubuntu/bug-1853090. Would like to ACK the thread if I have had subscribed fwts-devel.

Changed in fwts (Ubuntu):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Colin Ian King (colin-king) wrote :
Changed in fwts (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fwts - 19.12.00-0ubuntu1

---------------
fwts (19.12.00-0ubuntu1) focal; urgency=medium

  [Colin Ian King]
  * efi_runtime: don't build dkms module for kernels 4.8.0 and above
    (LP: #1853090)
  * debian/tests: only run dkms test when dkms module is run
  * debugger: check for memory allocation failure on object Elements
  * debugger: fix spelling mistake "adress" -> "address"
  * cpu: microcode: remove redundant check on pointer entry
  * fwts_wakealarm: remove unused function fwts_wakealarm_exits

  [Erik Schmauss]
  * iASL: remove unneeded NULL checks

 -- Alex Hung <email address hidden> Sun, 08 Dec 2019 22:01:38 -0700

Changed in fwts (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.