View Issue Details

IDProjectCategoryView StatusLast Update
0001426channel: kernel/el9kernel-mlpublic2024-02-08 12:42
Reportertoracat Assigned Totoracat  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Summary0001426: Build kernel-ml for 6.8.0-rcX
DescriptionLinus released linux-6.8-rc1 on 2024-01-21.

*** el7 and el8 ***

Steve was abke to build kernel-ml-6.8.0-0.rc1 for both el7 and el8 with no issue.

*** el9 ***

(1) build error on aarch64

+ chmod +x tools/perf/check-headers.sh
+ /usr/bin/make -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 CORESIGHT=1 prefix=/usr PYTHON=/usr/bin/python3 all
  BUILD: Doing 'make -j160' parallel build

Makefile.config:528: *** Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. Stop.
make[1]: *** [Makefile.perf:251: sub-make] Error 2
make: *** [Makefile:70: all] Error 2

CORESIGHT is aarch64 only

  ==> A temporary workaround is to disable perf
  ==> Could not be fixed by disabling CORESIGHT: CONFIG_CORESIGHT=m
      (same error)

(2) build error on x86_64

+ /usr/bin/make -s 'HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' -j3 ARCH=x86_64 bzImage
scripts/link-vmlinux.sh: line 111: 225170 Killed LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${PAHOLE_FLAGS} ${1}
libbpf: failed to find '.BTF' ELF section in vmlinux
FAILED: load BTF from vmlinux: No data available
make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 255
make[2]: *** Deleting file 'vmlinux'
make[1]: *** [/data/rpmbuild/elrepo/kernel/6.8/BUILD/kernel-ml-6.8.0/linux-6.8.0-0.rc1.el9.elrepo.x86_64/Makefile:1158: vmlinux] Error 2
make: *** [Makefile:240: __sub-make] Error 2

  ===> resolved by increasing the memory on the build system
(details: Got 'No space left on device' on Build64R9. Moved to my local VM. Memory 2.7Gi -> 5.6Gi to fix the problem)

TagsNo tags attached.

Activities

toracat

2024-01-28 13:13

administrator   ~0009537

Additional note for (2):
"The issue was that pahole ran out of memory (peak memory usage of pahole was around 2.5GB)."
"Current linux build needs at least 10GB of RAM!"to build kernel 6.5"

toracat

2024-01-28 13:33

administrator   ~0009538

Regarding (1), "Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1. "

============================
commit 2dbba30fd69b604802a9535b74bddb5bcca23793
Author: James Clark <james.clark@arm.com>
Date: Fri Sep 1 14:37:15 2023 +0100

    perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present

+#error "OpenCSD >= 1.2.1 is required"
============================

Note that the system has version 1.2.0:
opencsd-1.2.0-2.el9.aarch64

Therefore the problem seems to be 'No libopencsd library found' rather than the version number.

toracat

2024-01-28 21:48

administrator   ~0009542

linux 6.8-rc2 is out.

Same result: build succeeds only when perf is disabled.

toracat

2024-02-02 21:03

administrator   ~0009545

To find out the patch that causes error (1), I did a git bisection. The result is:

[toracat@aarch64-02 linux]$ git bisect good
2dbba30fd69b604802a9535b74bddb5bcca23793 is the first bad commit
commit 2dbba30fd69b604802a9535b74bddb5bcca23793
Author: James Clark <james.clark@arm.com>
Date: Fri Sep 1 14:37:15 2023 +0100

    perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present
    
    Since commit d927ef5004ef ("perf cs-etm: Add exception level consistency
    check"), the exception that was added to Perf will be triggered unless
    the following bugfix from OpenCSD is present:
    
     - _Version 1.2.1_:
      - __Bugfix__:
        ETM4x / ETE - output of context elements to client can in some
        circumstances be delayed until after subsequent atoms have been
        processed leading to incorrect memory decode access via the client
        callbacks. Fixed to flush context elements immediately they are
        committed.
    
    Rather than remove the assert and silently fail, just increase the
    minimum version requirement to avoid hard to debug issues and
    regressions.
    
    Reviewed-by: Ian Rogers <irogers@google.com>
    Signed-off-by: James Clark <james.clark@arm.com>
    Tested-by: Leo Yan <leo.yan@linaro.org>
    Cc: John Garry <john.g.garry@oracle.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: linux-arm-kernel@lists.infradead.org
    Link: https://lore.kernel.org/r/20230901133716.677499-1-james.clark@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
index eb6303ff446e..4cfcef9da3e4 100644
--- a/tools/build/feature/test-libopencsd.c
+++ b/tools/build/feature/test-libopencsd.c
@@ -4,9 +4,9 @@
 /*
  * Check OpenCSD library version is sufficient to provide required features
  */
-#define OCSD_MIN_VER ((1 << 16) | (1 << 8) | (1))
+#define OCSD_MIN_VER ((1 << 16) | (2 << 8) | (1))
 #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
-#error "OpenCSD >= 1.1.1 is required"
+#error "OpenCSD >= 1.2.1 is required"
 #endif
 
 int main(void)

toracat

2024-02-02 21:08

administrator   ~0009546

The bisect result was not surprising. The "culprit" patch checks to see if opencsd is version 1.2.1 or newer. For some reason this check fails on aarch64-02, Therefore omitting the patch leads to a successful build.

The system does have opencsd 1.2.1. Knowing that,, it may be OK to skip the patch. But the question remains as to why the patch does not see the version correctly.

toracat

2024-02-03 13:59

administrator   ~0009548

D'oh !

The commit says "OpenCSD >= 1.2.1 is required". But we have 1.2.0.

That explains it.

toracat

2024-02-06 01:54

administrator   ~0009552

Last edited: 2024-02-08 12:42

Solution/workaround

- Build opencsd-1.3.1 using the src.rpm from Fedora 39
- Provide opencsd-1.3.1 through a local repo in mock

As of linux-6.7.4 and linux-6.1.77, the commit that changed the requirement for opencsd >= 1.2.1 was added.

Therefore the customized mock is needed for all current and future builds (aarch64).

toracat

2024-02-07 04:42

administrator   ~0009554

Closing as 'resolved'.

Issue History

Date Modified Username Field Change
2024-01-28 13:06 toracat New Issue
2024-01-28 13:06 toracat Status new => assigned
2024-01-28 13:06 toracat Assigned To => toracat
2024-01-28 13:13 toracat Note Added: 0009537
2024-01-28 13:33 toracat Note Added: 0009538
2024-01-28 21:48 toracat Note Added: 0009542
2024-02-02 21:03 toracat Note Added: 0009545
2024-02-02 21:08 toracat Note Added: 0009546
2024-02-03 13:59 toracat Note Added: 0009548
2024-02-06 01:54 toracat Note Added: 0009552
2024-02-07 04:40 toracat Note Edited: 0009552
2024-02-07 04:42 toracat Status assigned => resolved
2024-02-07 04:42 toracat Resolution open => fixed
2024-02-07 04:42 toracat Note Added: 0009554
2024-02-08 12:42 toracat Note Edited: 0009552