Build fails on riscv64 in qemu user emulation

Bug #1942895 reported by Alexandre Ghiti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pocl (Debian)
Fix Released
Unknown
pocl (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Ubuntu release: hirsute/impish

pocl gets the host machine cache line size using getconf(LEVEL1_DCACHE_LINESIZE) and when this value is not defined by the underlying architecture, glibc returns 0 which is correctly handled by pocl CMakeLists.txt. But riscv64 defines this system variable since glibc 2.33 (cf commit 15b38ffc104a ("riscv: Get cache information through sysconf")) and amd64 does not. Then when using qemu usermode emulation to build pocl for riscv64 on an amd64 host, this system variable is not created and then the riscv implementation now returns -1 instead of 0, which is mapped to the string "undefined" by getconf utility. This value is not handled by pocl and then the build fails.

Tags: patch fr-1690
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached a debdiff patch that fixes riscv64 build as seen here: https://launchpad.net/~alexghiti/+archive/ubuntu/riscv/+build/22048127

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "pocl_debdiff.patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

The correct syntax for closing a Launchpad bug report is 'LP: #'.

tags: added: fr-1690
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Updated the syntax in the attached patch, thanks.

Revision history for this message
Brian Murray (brian-murray) wrote :

This package is in sync with Debian and by adding this patch the package will no longer be automatically imported from Debian. Which is fine for a short period of time, but we need a plan for getting the package back in sync. Could you forward your patch to Debian and upstream? Additionally, adding DEP-3 headers to the patch would be helpful.

https://dep-team.pages.debian.net/deps/dep3/

Thanks for working on this!

Changed in pocl (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Actually, launchpad builders use qemu-system, not qemu user mode, so the build used to fail in launchpad because the riscv64 kernel was too old: v5.8 whereas the commit 38f5bd23deae ("riscv: Add cache information in AUX vector") that introduced the missing values for pocl landed in v5.10. So the bump to kernel v5.11 explained the recent build success.

The proposed fix is still valid though for qemu user mode.

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Patch was applied upstream (https://github.com/pocl/pocl/commit/9bd3b404a2ac307b0f238970381c4265a5b734f4) and bug report was open in debian (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994797).

The attached debdiff was updated with DEP-3 header and debian version numbering.

Changed in pocl (Debian):
status: Unknown → New
Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached a debdiff containing no changes in order to trigger a new build so that packages get to the archive.

summary: - Build fails on riscv64
+ Build fails on riscv64 in qemu user emulation
Changed in pocl (Debian):
status: New → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

A version of pocl which includes this fix is currently in -proposed for Jammy however the package failed to build on every architecture besides riscv64. Regardless, there is no longer anything for the sponsors team to do here so I am unsubscribing them.

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

This patch was merged upstream in 1.8, and currently 1.8-3 built fine, so this bug is Fix-Released.

Changed in pocl (Ubuntu):
status: In Progress → 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.