intel / tdx-tools

Cloud Stack and Solutions for Intel TDX (Trust Domain Extension)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fails with intel-mvp-tdx-kernel for RHEL

darragh-walker opened this issue · comments

When I try to run the ./build.sh script for the RHEL kernel I get alot of syntax errors in relation to a swab.h file and the kernel does not build successfully:

/usr/include/linux/swab.h:136:23: error: expected ';' before 'unsigned'
static __always_inline unsigned long __swab(const unsigned long y)
^~~~~~~~~
;
/usr/include/linux/swab.h:171:8: error: unknown type name '__always_inline'
static __always_inline __u16 __swab16p(const __u16 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/swab.h:171:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__swab16p'
static __always_inline __u16 __swab16p(const __u16 *p)
^~~~~~~~~
/usr/include/linux/swab.h:184:8: error: unknown type name '__always_inline'
static __always_inline __u32 __swab32p(const __u32 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/swab.h:184:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__swab32p'
static __always_inline __u32 __swab32p(const __u32 *p)
^~~~~~~~~
/usr/include/linux/swab.h:197:8: error: unknown type name '__always_inline'
static __always_inline __u64 __swab64p(const __u64 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/swab.h:197:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__swab64p'
static __always_inline __u64 __swab64p(const __u64 *p)
^~~~~~~~~
/usr/include/linux/swab.h:252:23: error: expected ';' before 'void'
static __always_inline void __swab32s(__u32 *p)
^~~~~
;
/usr/include/linux/swab.h:265:23: error: expected ';' before 'void'
static __always_inline void __swab64s(__u64 *p)
^~~~~
;
In file included from /usr/include/asm/byteorder.h:5,
from /local/dwalker/tdx-tools/build/rhel-8/intel-mvp-tdx-kernel/rpmbuild/BUILD/intel-mvp-tdx-kernel-6.2.16/linux-6.2.16-tdx.v3.7.mvp30.el8.x86_64/tools/arch/x86/include/asm/insn.h:10,
from arch/x86/decode.c:10:
/usr/include/linux/byteorder/little_endian.h:44:8: error: unknown type name '__always_inline'
static __always_inline __le64 __cpu_to_le64p(const __u64 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:44:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_le64p'
static __always_inline __le64 __cpu_to_le64p(const __u64 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:48:8: error: unknown type name '__always_inline'
static __always_inline __u64 __le64_to_cpup(const __le64 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:48:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__le64_to_cpup'
static __always_inline __u64 __le64_to_cpup(const __le64 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:52:8: error: unknown type name '__always_inline'
static __always_inline __le32 __cpu_to_le32p(const __u32 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:52:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_le32p'
static __always_inline __le32 __cpu_to_le32p(const __u32 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:56:8: error: unknown type name '__always_inline'
static __always_inline __u32 __le32_to_cpup(const __le32 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:56:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__le32_to_cpup'
static __always_inline __u32 __le32_to_cpup(const __le32 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:60:8: error: unknown type name '__always_inline'
static __always_inline __le16 __cpu_to_le16p(const __u16 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:60:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_le16p'
static __always_inline __le16 __cpu_to_le16p(const __u16 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:64:8: error: unknown type name '__always_inline'
static __always_inline __u16 __le16_to_cpup(const __le16 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:64:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__le16_to_cpup'
static __always_inline __u16 __le16_to_cpup(const __le16 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:68:8: error: unknown type name '__always_inline'
static __always_inline __be64 __cpu_to_be64p(const __u64 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:68:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_be64p'
static __always_inline __be64 __cpu_to_be64p(const __u64 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:72:8: error: unknown type name '__always_inline'
static __always_inline __u64 __be64_to_cpup(const __be64 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:72:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__be64_to_cpup'
static __always_inline __u64 __be64_to_cpup(const __be64 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:76:8: error: unknown type name '__always_inline'
static __always_inline __be32 __cpu_to_be32p(const __u32 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:76:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_be32p'
static __always_inline __be32 __cpu_to_be32p(const __u32 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:80:8: error: unknown type name '__always_inline'
static __always_inline __u32 __be32_to_cpup(const __be32 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:80:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__be32_to_cpup'
static __always_inline __u32 __be32_to_cpup(const __be32 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:84:8: error: unknown type name '__always_inline'
static __always_inline __be16 __cpu_to_be16p(const __u16 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:84:31: error: expected '=', ',', ';', 'asm' or 'attribute' before '__cpu_to_be16p'
static __always_inline __be16 __cpu_to_be16p(const __u16 *p)
^~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:88:8: error: unknown type name '__always_inline'
static __always_inline __u16 __be16_to_cpup(const __be16 *p)
^~~~~~~~~~~~~~~
/usr/include/linux/byteorder/little_endian.h:88:30: error: expected '=', ',', ';', 'asm' or 'attribute' before '__be16_to_cpup'
static __always_inline __u16 __be16_to_cpup(const __be16 *p)

Could this be a system issue or is it to do with the tdx-tools script?

@darragh-walker hi,
tdx-tools check builds for all the packages on RHEL 8.7, please see github action https://github.com/intel/tdx-tools/actions/runs/5481691522
Please try to check the system install the build requirements,
cat /etc/os-release
dnf install -y bzip2 coreutils cpio diffutils gcc gcc-c++ make patch unzip which
git wget sudo python3 python3-pyyaml python3-requests redhat-rpm-config rpm-build createrepo_c
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
If the problem still not resolved, can you share the full build log via email.

The host is a customized CentOS, which is not officially supported.

For that error, try to check kernel-headers and upgrade to the latest.