Skip to content

SPECS: linux-tools: fix build failure on RISC-V due to arch-specific hardware tracing.#381

Draft
Leetfs wants to merge 1 commit into
openRuyi-Project:mainfrom
Leetfs:linux-tools
Draft

SPECS: linux-tools: fix build failure on RISC-V due to arch-specific hardware tracing.#381
Leetfs wants to merge 1 commit into
openRuyi-Project:mainfrom
Leetfs:linux-tools

Conversation

@Leetfs
Copy link
Copy Markdown
Contributor

@Leetfs Leetfs commented May 13, 2026

The current perf build system hardcodes architecture-specific hardware tracing objects (e.g., intel-pt.o, arm-spe.o) into the generic perf-util-y list. This leads to linker failures on architectures like RISC-V where these objects are not generated.

This patch decouples these drivers from the generic build process:

  1. Makefile.config: Only export CONFIG_PERF_XYZ (e.g., CONFIG_PERF_INTEL_PT) feature flags for their respective supported architectures.
  2. util/Build: Link hardware tracing objects conditionally based on these exported feature flags.
  3. util/auxtrace.c: Implement __weak stub functions returning -ENOSYS to ensure successful linking on all architectures.

Additionally, resolve GCC 14 build errors by adding explicit type casting for string functions to comply with stricter pointer safety and syntax requirements.

…hardware tracing.

Signed-off-by: Li Guan <guanli.oerv@isrc.iscas.ac.cn>
@openruyi-bot openruyi-bot Bot added Community: Student contribution Used by contributors that are currently students at an educational institution. BuildSystem: misc Issue/PR not related to any BuildSystem. Target: Rolling Targeting rolling/current branch. labels May 13, 2026
@Leetfs
Copy link
Copy Markdown
Contributor Author

Leetfs commented May 13, 2026

Build log:

[ 1742s] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[ 1742s] Supplements: (linux-tools = 7.0.5-17.1.or and langpacks-pt)
[ 1742s] Processing files: linux-tools-langpack-zh-7.0.5-17.1.or.noarch
[ 1742s] Provides: linux-tools-langpack-zh = 7.0.5-17.1.or
[ 1742s] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[ 1742s] Supplements: (linux-tools = 7.0.5-17.1.or and langpacks-zh)
[ 1742s] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/abuild/rpmbuild/BUILD/linux-tools-7.0.5-build/BUILDROOT
[ 1754s] Wrote: /home/abuild/rpmbuild/SRPMS/linux-tools-7.0.5-17.1.or.src.rpm
[ 1754s] Wrote: /home/abuild/rpmbuild/RPMS/riscv64/linux-tools-devel-7.0.5-17.1.or.riscv64.rpm
[ 1754s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-ka-7.0.5-17.1.or.noarch.rpm
[ 1754s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-zh-7.0.5-17.1.or.noarch.rpm
[ 1754s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-de-7.0.5-17.1.or.noarch.rpm
[ 1755s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-it-7.0.5-17.1.or.noarch.rpm
[ 1755s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-pt-7.0.5-17.1.or.noarch.rpm
[ 1755s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-fr-7.0.5-17.1.or.noarch.rpm
[ 1755s] Wrote: /home/abuild/rpmbuild/RPMS/noarch/linux-tools-langpack-cs-7.0.5-17.1.or.noarch.rpm
[ 1755s] Wrote: /home/abuild/rpmbuild/RPMS/riscv64/linux-tools-7.0.5-17.1.or.riscv64.rpm
[ 1761s] Wrote: /home/abuild/rpmbuild/RPMS/riscv64/perf-7.0.5-17.1.or.riscv64.rpm
[ 1761s] Executing(rmbuild): /usr/bin/bash -e /var/tmp/rpm-tmp.nT4RTz
[ 1761s] + umask 022
[ 1761s] + cd /home/abuild/rpmbuild/BUILD/linux-tools-7.0.5-build
[ 1761s] + test -d /home/abuild/rpmbuild/BUILD/linux-tools-7.0.5-build
[ 1761s] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/abuild/rpmbuild/BUILD/linux-tools-7.0.5-build
[ 1762s] + rm -rf /home/abuild/rpmbuild/BUILD/linux-tools-7.0.5-build
[ 1769s] + RPM_EC=0
[ 1769s] ++ jobs -p
[ 1769s] + exit 0
[ 1770s] ... checking for files with abuild user/group
[ 1770s] Warning: mkbaselibs missing in build root, skipping baselibs
[ 1770s] 
[ 1770s] obsworker-sg2044-0316-1 finished "build linux-tools.spec" at Wed May 13 00:59:37 UTC 2026.
[ 1770s] 

@Z572
Copy link
Copy Markdown
Contributor

Z572 commented May 13, 2026

You can try sending it upstream.

@Leetfs Leetfs marked this pull request as draft May 13, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BuildSystem: misc Issue/PR not related to any BuildSystem. Community: Student contribution Used by contributors that are currently students at an educational institution. Target: Rolling Targeting rolling/current branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants